Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef _GMTL_AABOX_H_
00007 #define _GMTL_AABOX_H_
00008
00009 #include <gmtl/Point.h>
00010
00011 namespace gmtl
00012 {
00021 template< class DATA_TYPE >
00022 class AABox
00023 {
00024
00025
00026
00027
00028 #if defined(__MACH__) && defined(__APPLE_CC__) && defined(__GNUC__) && \
00029 __GNUC__ == 3 && __GNUC_MINOR__ == 3
00030 bool dummy_;
00031 #endif
00032 public:
00033 typedef DATA_TYPE DataType;
00034
00035 public:
00039 AABox()
00040 : mMin(0,0,0), mMax(0,0,0), mEmpty(true)
00041 {}
00042
00052 AABox(const Point<DATA_TYPE, 3>& min, const Point<DATA_TYPE, 3>& max)
00053 : mMin(min), mMax(max), mEmpty(false)
00054 {}
00055
00061 AABox(const AABox<DATA_TYPE>& box)
00062 : mMin(box.mMin), mMax(box.mMax), mEmpty(box.mEmpty)
00063 {}
00064
00070 const Point<DATA_TYPE, 3>& getMin() const
00071 {
00072 return mMin;
00073 }
00074
00080 const Point<DATA_TYPE, 3>& getMax() const
00081 {
00082 return mMax;
00083 }
00084
00090 bool isEmpty() const
00091 {
00092 return mEmpty;
00093 }
00094
00100 void setMin(const Point<DATA_TYPE, 3>& min)
00101 {
00102 mMin = min;
00103 }
00104
00110 void setMax(const Point<DATA_TYPE, 3>& max)
00111 {
00112 mMax = max;
00113 }
00114
00120 void setEmpty(bool empty)
00121 {
00122 mEmpty = empty;
00123 }
00124
00125 public:
00129 Point<DATA_TYPE, 3> mMin;
00130
00134 Point<DATA_TYPE, 3> mMax;
00135
00139 bool mEmpty;
00140 };
00141
00142
00143 typedef AABox<float> AABoxf;
00144 typedef AABox<double> AABoxd;
00145 }
00146
00147 #endif