Circular 2D bounding box. More...
#include <OSDLCircleBoundingBox.h>
Public Member Functions | |
CircleBoundingBox (Ceylan::Locatable2D &father, const Ceylan::Maths::Linear::Bipoint ¢er, 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 CircleBoundingBox & | CheckIsCircle (BoundingBox &box) |
Checks that specified bounding box is a circle (two-dimensional) one. | |
static BoundingBox2D & | CheckIs2D (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. | |
CircleBoundingBox & | operator= (const CircleBoundingBox &source) |
Assignment operator made private to ensure that it will never be called. |
Circular 2D bounding box.
Definition at line 57 of file OSDLCircleBoundingBox.h.
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.
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.
BoundingBox2D & BoundingBox2D::CheckIs2D | ( | BoundingBox & | box | ) | [static, protected, inherited] |
Checks that specified bounding box is a two-dimensional one.
box | the bounding box to be checked. |
BoundingBoxException | if it is not a 2D bounding box. |
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.
box | the bounding box to be checked. |
BoundingBoxException | if it is not a 2D circular bounding box. |
Definition at line 215 of file OSDLCircleBoundingBox.cc.
IntersectionResult CircleBoundingBox::compareWith | ( | CircleBoundingBox & | other | ) | [protected, virtual] |
Helper method comparing two circular bounding boxes.
other | the second bounding box to intersect with. |
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).
other | the other 2D bounding box. |
BoundingBoxException | if the type of the two bounding boxes is not compatible (ex: 2D boxes cannot be checked against 3D boxes), or not implemented. |
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.
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.
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.
level | the requested verbosity level. |
Reimplemented from OSDL::Engine::BoundingBox2D.
Definition at line 96 of file OSDLCircleBoundingBox.cc.
References _radius.
Referenced by compareWith().
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().