00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef BOUNDING_BOX_HH
00025 #define BOUNDING_BOX_HH
00026
00027 #include "vertex.hh"
00028 #include "tools-win32.hh"
00029
00035 class DLL_TOOLS CBoundingBox
00036 {
00037 public:
00038
00043
00050 CBoundingBox();
00051
00058 CBoundingBox(const CVertex & APoint);
00059
00066 CBoundingBox(const CVertex & APoint1, const CVertex & APoint2);
00067
00069
00074
00082 static TCoordinate getEpsilon();
00083
00091 static void setEpsilon(TCoordinate AEpsilon);
00092
00101 void addPoint(const CVertex & APoint);
00102
00107 void clear();
00108
00115 bool isEmpty() const;
00116
00125 bool isInBox(const CVertex & APoint) const;
00126
00136 bool isInIntersectionWith(const CBoundingBox & ABB) const;
00137
00144 TCoordinate getVolume() const;
00145
00152 TCoordinate getSurface() const;
00153
00162 const CVertex & getMinBound() const;
00163
00172 const CVertex & getMaxBound() const;
00173
00183 CVertex getEpsMinBound() const;
00184
00194 CVertex getEpsMaxBound() const;
00195
00202 CVertex getCenter() const;
00203
00214 bool operator * (const CBoundingBox & AOther) const;
00215
00224 CBoundingBox operator + (const CBoundingBox & AOther) const;
00225
00227
00228 private:
00229
00234
00238 CVertex FMin, FMax;
00239
00240
00244 bool FIsEmpty;
00245
00247 };
00248
00257 DLL_TOOLS std::ostream & operator << (std::ostream & AStream, const CBoundingBox & ABB);
00258
00259 #endif