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 "OSDLBoundingBox.h"
00028 
00029 
00030 
00031 using namespace OSDL::Engine ;
00032 
00033 using std::string ;
00034 
00035 
00036 
00037 BoundingBoxException::BoundingBoxException( const string & reason ) :
00038     EngineException( "BoundingBoxException: " + reason )
00039 {
00040 
00041 }
00042 
00043 
00044 
00045 BoundingBoxException::~BoundingBoxException() throw()
00046 {
00047 
00048 }
00049 
00050 
00051 
00052 
00053 
00054 BoundingBox::BoundingBox()
00055 {
00056 
00057 }
00058 
00059 
00060 
00061 BoundingBox::~BoundingBox() throw()
00062 {
00063 
00064 }
00065 
00066 
00067 
00068 string BoundingBox::InterpretIntersectionResult( IntersectionResult result ) 
00069 {
00070 
00071     switch( result )
00072     {
00073     
00074         case isSeparate:
00075             return "The two bounding boxes have no intersection." ;
00076             break ;
00077                 
00078         case contains:
00079             return "The first bounding box contains strictly the second." ;
00080             break ;
00081                 
00082         case isContained:
00083             return "The first bounding box is "
00084                 "strictly contained by the second." ;
00085             break ;
00086                 
00087         case intersects:
00088             return "The two bounding boxes intersect." ;
00089             break ;
00090                 
00091         case isEqual:
00092             return "The two bounding boxes are equal." ;
00093             break ;
00094                 
00095         default:
00096             throw BoundingBoxException(
00097                 "BoundingBox::InterpretIntersectionResult: "
00098                 "unknown intersection outcome." ) ;
00099             break ;
00100                 
00101     }
00102     
00103     return "(abnormal interpretation of intersection result)" ;
00104     
00105 }
00106