• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

AABox.h

Go to the documentation of this file.
00001 // GMTL is (C) Copyright 2001-2010 by Allen Bierbaum
00002 // Distributed under the GNU Lesser General Public License 2.1 with an
00003 // addendum covering inlined code. (See accompanying files LICENSE and
00004 // LICENSE.addendum or http://www.gnu.org/copyleft/lesser.txt)
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       // This is a hack to work around a bug with GCC 3.3 on Mac OS X
00025       // where boost::is_polymorphic returns a false positive.  The details
00026       // can be found in the Boost.Python FAQ:
00027       //    http://www.boost.org/libs/python/doc/v2/faq.html#macosx
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    // --- helper types --- //
00143    typedef AABox<float>    AABoxf;
00144    typedef AABox<double>   AABoxd;
00145 }
00146 
00147 #endif

Generated on Sun Sep 19 2010 14:35:14 for GenericMathTemplateLibrary by  doxygen 1.7.1