OSDL::Engine::CircleBoundingBox Class Reference

Circular 2D bounding box. More...

#include <OSDLCircleBoundingBox.h>

Inheritance diagram for OSDL::Engine::CircleBoundingBox:
Inheritance graph
[legend]
Collaboration diagram for OSDL::Engine::CircleBoundingBox:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CircleBoundingBox (Ceylan::Locatable2D &father, const Ceylan::Maths::Linear::Bipoint &center, Ceylan::Maths::Real radius)
 Constructor of a 2D circular bounding box object.
virtual ~CircleBoundingBox () throw ()
 Virtual destructor.
virtual Ceylan::Maths::Real getRadius () const
 Returns the radius of this circular bounding box.
virtual void setRadius (Ceylan::Maths::Real newRadius)
 Sets the radius of this circular bounding box.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns an user-friendly description of the state of this object.
virtual IntersectionResult doesIntersectWith (BoundingBox &other)
 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)
 Returns a textual description of specified intersection result.

Protected Member Functions

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

Static Protected Member Functions

static CircleBoundingBoxCheckIsCircle (BoundingBox &box)
 Checks that specified bounding box is a circle (two-dimensional) one.
static BoundingBox2DCheckIs2D (BoundingBox &box)
 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)
 Copy constructor made private to ensure that it will never be called.
CircleBoundingBoxoperator= (const CircleBoundingBox &source)
 Assignment operator made private to ensure that it will never be called.

Detailed Description

Circular 2D bounding box.

Definition at line 57 of file OSDLCircleBoundingBox.h.


Constructor & Destructor Documentation

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

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 71 of file OSDLCircleBoundingBox.cc.

OSDL::Engine::CircleBoundingBox::CircleBoundingBox ( const CircleBoundingBox 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

BoundingBox2D & BoundingBox2D::CheckIs2D ( BoundingBox box  )  [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 68 of file OSDLBoundingBox2D.cc.

Referenced by doesIntersectWith().

CircleBoundingBox & CircleBoundingBox::CheckIsCircle ( BoundingBox box  )  [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 215 of file OSDLCircleBoundingBox.cc.

IntersectionResult CircleBoundingBox::compareWith ( CircleBoundingBox other  )  [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 139 of file OSDLCircleBoundingBox.cc.

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

Referenced by doesIntersectWith().

IntersectionResult CircleBoundingBox::doesIntersectWith ( BoundingBox other  )  [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 113 of file OSDLCircleBoundingBox.cc.

References OSDL::Engine::BoundingBox2D::CheckIs2D(), and compareWith().

Real CircleBoundingBox::getRadius (  )  const [virtual]

Returns the radius of this circular bounding box.

Definition at line 78 of file OSDLCircleBoundingBox.cc.

References _radius.

Referenced by compareWith().

string BoundingBox::InterpretIntersectionResult ( IntersectionResult  result  )  [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 68 of file OSDLBoundingBox.cc.

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

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

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

Sets the radius of this circular bounding box.

Parameters:
newRadius the new radius.
const string CircleBoundingBox::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [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 96 of file OSDLCircleBoundingBox.cc.

References _radius.

Referenced by compareWith().


Member Data Documentation

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

Radius of the bounding box.

Definition at line 189 of file OSDLCircleBoundingBox.h.

Referenced by compareWith(), getRadius(), and toString().


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