OSDL::Engine::BoundingBox Class Reference

Bounding boxes are geometrical shapes that verify the following properties:

More...

#include <OSDLBoundingBox.h>

Inheritance diagram for OSDL::Engine::BoundingBox:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 BoundingBox ()
 Constructor of a bounding box object.
virtual ~BoundingBox () throw ()
 Virtual destructor.
virtual IntersectionResult doesIntersectWith (BoundingBox &other)=0
 Tells what is the nature of the intersection between this bounding box and the specified one.

Static Public Member Functions

static std::string InterpretIntersectionResult (IntersectionResult result)
 Returns a textual description of specified intersection result.

Private Member Functions

 BoundingBox (const BoundingBox &source)
 Copy constructor made private to ensure that it will never be called.
BoundingBoxoperator= (const BoundingBox &source)
 Assignment operator made private to ensure that it will never be called.

Detailed Description

Bounding boxes are geometrical shapes that verify the following properties:

) are faster and/or easier than if they were to be performed on the actual associated object.

Bounding boxes are therefore simple shapes helping managing complex objects.

Various bounding boxes can be used, depending on the dimension of the space they are to be used (ex: 2D, 3D) and the precision they are to provide (ex: cubes demand more processing power than spheres, but for some computations they give more accurate results).

A bounding box is linked to at least an object and must have a reference onto it, since boxes are defined relatively to them, as son Locatable depending on his father. Reciproqually, for a given object its bounding box needs to be found. As objects have to know their bounding box(es), it must be a two-way link.

All bounding boxes should be Locatable instancess, but the type of the Locatable depends on the space they are defined in. Therefore abstract bounding boxes should not inherit from any Locatable at this point.

Bounding boxes are notably useful to check collisions between them.

See also:
IntersectionResult

Definition at line 131 of file OSDLBoundingBox.h.


Constructor & Destructor Documentation

BoundingBox::BoundingBox (  )  [explicit]

Constructor of a bounding box object.

Note:
Not even common parameters are managed here (ex: all bounding-boxes should have a center), since it would have to be for example a Point whereas actually a Bipoint or a Tripoint would be used. This would not be convenient since it would require numerous dynamic casts to transform this data member into a specialized forms.

Definition at line 54 of file OSDLBoundingBox.cc.

BoundingBox::~BoundingBox (  )  throw () [virtual]

Virtual destructor.

Definition at line 61 of file OSDLBoundingBox.cc.

OSDL::Engine::BoundingBox::BoundingBox ( const BoundingBox source  )  [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

virtual IntersectionResult OSDL::Engine::BoundingBox::doesIntersectWith ( BoundingBox other  )  [pure virtual]

Tells what is the nature of the intersection between this bounding box and the specified one.

Parameters:
other the other bounding box.
Returns:
the intersection result
Exceptions:
BoundingBoxException if the type of the two bounding boxes is not compatible (ex: 2D boxes cannot be checked against 3D boxes), or not implemented.
See also:
IntersectionResult
Note:
This method can be called for heterogenous (but compatible) bounding boxes types. For example, if it was implemented, circular and square (both being 2D boxes) could be searched for intersection.
Parameter cannot be 'const' since a referential change may have to happen to compare the boxes.

Implemented in OSDL::Engine::CircleBoundingBox.

string BoundingBox::InterpretIntersectionResult ( IntersectionResult  result  )  [static]

Returns a textual description of specified intersection result.

Exceptions:
BoundingBoxException if the intersection result is not known, and therefore cannot be interpreted.

Definition at line 68 of file OSDLBoundingBox.cc.

References OSDL::Engine::contains, OSDL::Engine::intersects, OSDL::Engine::isContained, OSDL::Engine::isEqual, and OSDL::Engine::isSeparate.

BoundingBox& OSDL::Engine::BoundingBox::operator= ( const BoundingBox source  )  [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 14:05:32 2010 for OSDL by  doxygen 1.6.3