This is an abstract class for any volume in any sense which can be said to define the locality of reference of a node in a graph, along with all of its descendants. More...
#include "boundingVolume.h"
Public Member Functions | |
bool | around (const BoundingVolume **first, const BoundingVolume **last) |
Resets the volume to enclose only the volumes indicated. More... | |
virtual const BoundingBox * | as_bounding_box () const |
Virtual downcast method. More... | |
virtual const BoundingHexahedron * | as_bounding_hexahedron () const |
Virtual downcast method. More... | |
virtual const BoundingLine * | as_bounding_line () const |
Virtual downcast method. More... | |
virtual const BoundingPlane * | as_bounding_plane () const |
Virtual downcast method. More... | |
virtual const BoundingSphere * | as_bounding_sphere () const |
Virtual downcast method. More... | |
virtual const FiniteBoundingVolume * | as_finite_bounding_volume () const |
Virtual downcast method. More... | |
virtual GeometricBoundingVolume * | as_geometric_bounding_volume () |
Virtual downcast method. More... | |
virtual const GeometricBoundingVolume * | as_geometric_bounding_volume () const |
Virtual downcast method. More... | |
int | contains (const BoundingVolume *vol) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume. More... | |
bool | extend_by (const BoundingVolume *vol) |
Increases the size of the volume to include the given volume. More... | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
bool | is_empty () const |
Any kind of volume might be empty. More... | |
bool | is_infinite () const |
The other side of the empty coin is an infinite volume. More... | |
virtual BoundingVolume * | make_copy () const =0 |
virtual void | output (std::ostream &out) const =0 |
void | set_infinite () |
Marks the volume as infinite, even if it is normally finite. More... | |
virtual void | write (std::ostream &out, int indent_level=0) const |
Public Member Functions inherited from TypedReferenceCount | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
Public Member Functions inherited from TypedObject | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static BoundsType | string_bounds_type (const std::string &str) |
Returns the BoundsType corresponding to the indicated string. More... | |
Static Public Member Functions inherited from TypedReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TypedObject | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Friends | |
class | BoundingBox |
class | BoundingHexahedron |
class | BoundingLine |
class | BoundingPlane |
class | BoundingSphere |
class | IntersectionBoundingVolume |
class | UnionBoundingVolume |
Additional Inherited Members | |
Public Attributes inherited from TypedObject | |
get_type | |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
This is an abstract class for any volume in any sense which can be said to define the locality of reference of a node in a graph, along with all of its descendants.
It is not necessarily a geometric volume (although see GeometricBoundingVolume); this is simply an abstract interface for bounds of any sort.
Definition at line 41 of file boundingVolume.h.
bool BoundingVolume::around | ( | const BoundingVolume ** | first, |
const BoundingVolume ** | last | ||
) |
Resets the volume to enclose only the volumes indicated.
Returns true if successful, false if the volume doesn't know how to do that or can't do that.
Definition at line 40 of file boundingVolume.cxx.
References is_empty().
Referenced by GeometricBoundingVolume::around().
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in BoundingBox.
Definition at line 126 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in BoundingHexahedron.
Definition at line 135 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in BoundingLine.
Definition at line 144 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in BoundingPlane.
Definition at line 153 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in BoundingSphere.
Definition at line 117 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in FiniteBoundingVolume.
Definition at line 108 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in GeometricBoundingVolume.
Definition at line 90 of file boundingVolume.cxx.
|
virtual |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented in GeometricBoundingVolume.
Definition at line 99 of file boundingVolume.cxx.
|
inline |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume.
Definition at line 80 of file boundingVolume.I.
References is_empty(), and is_infinite().
Referenced by GeometricBoundingVolume::contains().
|
inline |
Increases the size of the volume to include the given volume.
Definition at line 61 of file boundingVolume.I.
References is_empty(), is_infinite(), and set_infinite().
Referenced by GeometricBoundingVolume::extend_by().
|
inline |
Any kind of volume might be empty.
This is a degenerate volume that contains no points; it's not the same as, for instance, a sphere with radius zero, since that contains one point (the center). It intersects with no other volumes.
Definition at line 29 of file boundingVolume.I.
Referenced by UnionBoundingVolume::add_component(), around(), GeometricBoundingVolume::contains(), contains(), extend_by(), and PT().
|
inline |
The other side of the empty coin is an infinite volume.
This is a degenerate state of a normally finite volume that contains all points. (Note that some kinds of infinite bounding volumes, like binary separating planes, do not contain all points and thus correctly return is_infinite() == false, even though they are technically infinite. This is a special case of the word 'infinite' meaning the volume covers all points in space.)
It completely intersects with all other volumes except empty volumes.
Definition at line 44 of file boundingVolume.I.
Referenced by UnionBoundingVolume::add_component(), contains(), extend_by(), and PT().
|
inline |
Marks the volume as infinite, even if it is normally finite.
You can think of this as an infinite extend_by() operation.
Definition at line 53 of file boundingVolume.I.
Referenced by extend_by().
|
static |
Returns the BoundsType corresponding to the indicated string.
Definition at line 161 of file boundingVolume.cxx.