MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLCSO/CSOBase/CSOBoundingBox.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 
00011 #ifndef __CSOBoundingBox_H
00012 #define __CSOBoundingBox_H
00013 
00014 #include "MLCSOIncludes.h"
00015 
00016 
00017 ML_START_NAMESPACE
00018 
00019 class CSO;
00020 
00022 
00023 
00025 class MLCSO_EXPORT CSOBoundingBox 
00026 {
00027 
00028 public:
00029 
00031   CSOBoundingBox();
00033   CSOBoundingBox(CSO* cso);
00035   CSOBoundingBox(const Vector3& bbv1, const Vector3& bbv2);
00037   CSOBoundingBox(const CSOBoundingBox &bBox);    
00038 
00040   ~CSOBoundingBox();
00041 
00042 
00044   bool isEmpty() const;
00046   void makeEmpty();
00047 
00049   void correct();
00050 
00052   bool intersects(const CSOBoundingBox& bBox) const;
00053 
00055   bool intersects(const Vector3& argv1, const Vector3& argv2) const;
00056 
00058   bool intersects(const Vector3& center, double radius) const;
00059 
00062   void set(const Vector3& argv1, const Vector3& argv2);
00063 
00065   CSOBoundingBox unify(const CSOBoundingBox& bBox) const;
00066 
00068   CSOBoundingBox intersect(const CSOBoundingBox& bBox) const;
00069 
00071   bool containsPoint(double x, double y, double z) const;
00072 
00074   bool containsBoundingBox(const CSOBoundingBox& innerBoundingBox, const double epsilon=0.0) const;
00075 
00077   void augment(float value);
00078   
00080   CSOBoundingBox getShifted(double dx, double dy, double dz) const;
00081 
00083   void makeCubic();
00084 
00086   double getSize() const;
00087 
00089   Vector3 getCenterPoint() const;
00090 
00092   inline void print() { CSO_PRINT(v1[0] << ", " << v1[1] << ", " << v1[2]);
00093                         CSO_PRINT(v2[0] << ", " << v2[1] << ", " << v2[2]); CSO_PRINT("");}
00094 
00096   Vector3 v1;
00098   Vector3 v2;   
00099 
00100 private:
00101 
00103   void _computeBB(CSO* cso);
00104 
00105 
00106 };
00107 
00108 
00110 
00111 
00112 ML_END_NAMESPACE
00113 
00114 
00115 #endif // __CSOBoundingBox_H
00116 
00117 
00118