OSDLBoundingBox2D.cc

Go to the documentation of this file.
00001 #include "OSDLBoundingBox2D.h"
00002 
00003 
00004 using namespace Ceylan::Maths::Linear ;
00005 
00006 using namespace OSDL::Engine ;
00007 
00008 using std::string ;
00009 
00010 
00011 
00012 BoundingBox2D::BoundingBox2D( Locatable2D & father, const Bipoint & center )
00013         throw() :
00014     Locatable2D( father )
00015 {
00016     setCenter( center ) ;
00017 }
00018 
00019 
00020 BoundingBox2D::~BoundingBox2D() throw()
00021 {
00022 
00023 }
00024 
00025 
00026 const string BoundingBox2D::toString( Ceylan::VerbosityLevels level ) 
00027     const throw()
00028 {   
00029 
00030     return "2D bounding box, whose center is " + getCenter().toString( level )
00031         + ". From a referential point of view, this is a(n) " 
00032         + Locatable2D::toString( level ) ;
00033         
00034 }
00035 
00036 
00037 BoundingBox2D & BoundingBox2D::CheckIs2D( BoundingBox & box ) 
00038     throw( BoundingBoxException )
00039 {
00040 
00041     BoundingBox2D * box2D = dynamic_cast<BoundingBox2D *>( & box ) ;
00042     
00043     if ( box2D == 0 )
00044         throw BoundingBoxException( 
00045             "BoundingBox2D::CheckIs2D : specified box ("
00046             + box.toString() + ") was not a two dimensional box." ) ;
00047     
00048     return * box2D ;
00049         
00050 }
00051 

Generated on Fri Mar 30 14:46:59 2007 for OSDL by  doxygen 1.5.1