OSDL::Engine::CircleBoundingBox Class Reference

#include <OSDLCircleBoundingBox.h>

Inheritance diagram for OSDL::Engine::CircleBoundingBox:

[legend]
Collaboration diagram for OSDL::Engine::CircleBoundingBox:
[legend]
List of all members.

Detailed Description

Circular 2D bounding box.

Definition at line 28 of file OSDLCircleBoundingBox.h.

Public Member Functions

 CircleBoundingBox (Ceylan::Locatable2D &father, const Ceylan::Maths::Linear::Bipoint &center, Ceylan::Maths::Real radius) throw ()
 Constructor of a 2D circular bounding box object.
virtual ~CircleBoundingBox () throw ()
 Virtual destructor.
virtual Ceylan::Maths::Real getRadius () const throw ()
 Returns the radius of this circular bounding box.
virtual void setRadius (Ceylan::Maths::Real newRadius) throw ()
 Sets the radius of this circular bounding box.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.
virtual IntersectionResult doesIntersectWith (BoundingBox &other) throw ( BoundingBoxException )
 Tells what is the nature of the intersection between this 2D bounding box and the specified one.

Static Public Member Functions

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

Protected Member Functions

virtual IntersectionResult compareWith (CircleBoundingBox &other) throw ()
 Helper method comparing two circular bounding boxes.

Static Protected Member Functions

static CircleBoundingBoxCheckIsCircle (BoundingBox &box) throw (BoundingBoxException)
 Checks that specified bounding box is a circle (two-dimensional) one.
static BoundingBox2DCheckIs2D (BoundingBox &box) throw (BoundingBoxException)
 Checks that specified bounding box is a two-dimensional one.

Protected Attributes

Ceylan::Maths::Real _radius
 Radius of the bounding box.

Private Member Functions

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


Constructor & Destructor Documentation

OSDL::Engine::CircleBoundingBox::CircleBoundingBox ( Ceylan::Locatable2D &  father,
const Ceylan::Maths::Linear::Bipoint &  center,
Ceylan::Maths::Real  radius 
) throw ()

Constructor of a 2D circular bounding box object.

Parameters:
center the center of the bounding box.
radius the radius of the circle.

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

Virtual destructor.

Definition at line 40 of file OSDLCircleBoundingBox.cc.

OSDL::Engine::CircleBoundingBox::CircleBoundingBox ( const CircleBoundingBox source  )  throw () [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

Real CircleBoundingBox::getRadius (  )  const throw () [virtual]

Returns the radius of this circular bounding box.

Definition at line 46 of file OSDLCircleBoundingBox.cc.

References _radius.

virtual void OSDL::Engine::CircleBoundingBox::setRadius ( Ceylan::Maths::Real  newRadius  )  throw () [virtual]

Sets the radius of this circular bounding box.

Parameters:
newRadius the new radius.

const string CircleBoundingBox::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Reimplemented from OSDL::Engine::BoundingBox2D.

Definition at line 58 of file OSDLCircleBoundingBox.cc.

References OSDL::Video::Pixels::toString().

IntersectionResult CircleBoundingBox::doesIntersectWith ( BoundingBox other  )  throw ( BoundingBoxException ) [virtual]

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

Externally tangent circles (unique intersection) are not deemed intersecting.

Similarly, internally tangent circles (unique intersection) are deemed intersecting (no one is deemed stricly contained by the second).

Parameters:
other the other 2D 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:
Parameter cannot be 'const' since a referential change may have to happen to compare the boxes.

Implements OSDL::Engine::BoundingBox.

Definition at line 75 of file OSDLCircleBoundingBox.cc.

References OSDL::Engine::BoundingBox2D::CheckIs2D().

IntersectionResult CircleBoundingBox::compareWith ( CircleBoundingBox other  )  throw () [protected, virtual]

Helper method comparing two circular bounding boxes.

Parameters:
other the second bounding box to intersect with.
Note:
Parameter cannot be 'const' since a referential change may have to happen to compare the boxes. For the same reason, the method itself cannot be 'const'.

Definition at line 101 of file OSDLCircleBoundingBox.cc.

References OSDL::Engine::contains, OSDL::Engine::intersects, OSDL::Engine::isContained, OSDL::Engine::isEqual, OSDL::Engine::isSeparate, OSDL_BOX_LOG, and OSDL::Video::Pixels::toString().

CircleBoundingBox & CircleBoundingBox::CheckIsCircle ( BoundingBox box  )  throw (BoundingBoxException) [static, protected]

Checks that specified bounding box is a circle (two-dimensional) one.

Parameters:
box the bounding box to be checked.
Exceptions:
BoundingBoxException if it is not a 2D circular bounding box.
Returns:
the successfully casted 2D circular box.
Note:
Parameter should not be 'const' in order that method to be useful for its caller.

Definition at line 177 of file OSDLCircleBoundingBox.cc.

CircleBoundingBox& OSDL::Engine::CircleBoundingBox::operator= ( const CircleBoundingBox source  )  throw () [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.

BoundingBox2D & BoundingBox2D::CheckIs2D ( BoundingBox box  )  throw (BoundingBoxException) [static, protected, inherited]

Checks that specified bounding box is a two-dimensional one.

Parameters:
box the bounding box to be checked.
Exceptions:
BoundingBoxException if it is not a 2D bounding box.
Returns:
the successfully casted 2D box.
Note:
Parameter should not be 'const' in order that method to be useful for its caller.

Definition at line 37 of file OSDLBoundingBox2D.cc.

Referenced by doesIntersectWith().

string BoundingBox::InterpretIntersectionResult ( IntersectionResult  result  )  throw ( BoundingBoxException ) [static, inherited]

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 37 of file OSDLBoundingBox.cc.

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


Member Data Documentation

Ceylan::Maths::Real OSDL::Engine::CircleBoundingBox::_radius [protected]

Radius of the bounding box.

Definition at line 155 of file OSDLCircleBoundingBox.h.

Referenced by getRadius().


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:25 2007 for OSDL by  doxygen 1.5.1