00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "OSDLBoundingBox2D.h"
00028
00029
00030
00031 using namespace Ceylan::Maths::Linear ;
00032
00033 using namespace OSDL::Engine ;
00034
00035 using std::string ;
00036
00037
00038
00039
00040 BoundingBox2D::BoundingBox2D( Locatable2D & father, const Bipoint & center ) :
00041 Locatable2D( father )
00042 {
00043
00044 setCenter( center ) ;
00045
00046 }
00047
00048
00049
00050 BoundingBox2D::~BoundingBox2D() throw()
00051 {
00052
00053 }
00054
00055
00056
00057 const string BoundingBox2D::toString( Ceylan::VerbosityLevels level ) const
00058 {
00059
00060 return "2D bounding box, whose center is " + getCenter().toString( level )
00061 + ". From a referential point of view, this is a(n) "
00062 + Locatable2D::toString( level ) ;
00063
00064 }
00065
00066
00067
00068 BoundingBox2D & BoundingBox2D::CheckIs2D( BoundingBox & box )
00069 {
00070
00071 BoundingBox2D * box2D = dynamic_cast<BoundingBox2D *>( & box ) ;
00072
00073 if ( box2D == 0 )
00074 throw BoundingBoxException(
00075 "BoundingBox2D::CheckIs2D : specified box ("
00076 + box.toString() + ") was not a two dimensional box." ) ;
00077
00078 return * box2D ;
00079
00080 }
00081