Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

AABox.h

Go to the documentation of this file.
00001 /************************************************************** ggt-head beg
00002  *
00003  * GGT: Generic Graphics Toolkit
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile: AABox.h,v $
00010  * Date modified: $Date: 2003/03/03 00:54:04 $
00011  * Version:       $Revision: 1.10 $
00012  * -----------------------------------------------------------------
00013  *
00014  *********************************************************** ggt-head end */
00015 /*************************************************************** ggt-cpr beg
00016 *
00017 * GGT: The Generic Graphics Toolkit
00018 * Copyright (C) 2001,2002 Allen Bierbaum
00019 *
00020 * This library is free software; you can redistribute it and/or
00021 * modify it under the terms of the GNU Lesser General Public
00022 * License as published by the Free Software Foundation; either
00023 * version 2.1 of the License, or (at your option) any later version.
00024 *
00025 * This library is distributed in the hope that it will be useful,
00026 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00027 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00028 * Lesser General Public License for more details.
00029 *
00030 * You should have received a copy of the GNU Lesser General Public
00031 * License along with this library; if not, write to the Free Software
00032 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00033 *
00034  ************************************************************ ggt-cpr end */
00035 #ifndef _GMTL_AABOX_H_
00036 #define _GMTL_AABOX_H_
00037 
00038 #include <gmtl/Point.h>
00039 
00040 namespace gmtl
00041 {
00050    template< class DATA_TYPE >
00051    class AABox
00052    {
00053    public:
00054       typedef DATA_TYPE DataType;
00055 
00056    public:
00060       AABox()
00061          : mMin(0,0,0), mMax(0,0,0), mEmpty(true)
00062       {}
00063 
00073       AABox(const Point<DATA_TYPE, 3>& min, const Point<DATA_TYPE, 3>& max)
00074          : mMin(min), mMax(max), mEmpty(false)
00075       {}
00076 
00082       AABox(const AABox<DATA_TYPE>& box)
00083          : mMin(box.mMin), mMax(box.mMax), mEmpty(box.mEmpty)
00084       {}
00085 
00091       const Point<DATA_TYPE, 3>& getMin() const
00092       {
00093          return mMin;
00094       }
00095 
00101       const Point<DATA_TYPE, 3>& getMax() const
00102       {
00103          return mMax;
00104       }
00105 
00111       bool isEmpty() const
00112       {
00113          return mEmpty;
00114       }
00115 
00121       void setMin(const Point<DATA_TYPE, 3>& min)
00122       {
00123          mMin = min;
00124       }
00125 
00131       void setMax(const Point<DATA_TYPE, 3>& max)
00132       {
00133          mMax = max;
00134       }
00135 
00141       void setEmpty(bool empty)
00142       {
00143          mEmpty = empty;
00144       }
00145 
00146    public:
00150       Point<DATA_TYPE, 3> mMin;
00151 
00155       Point<DATA_TYPE, 3> mMax;
00156 
00160       bool mEmpty;
00161    };
00162 
00163    // --- helper types --- //
00164    typedef AABox<float>    AABoxf;
00165    typedef AABox<double>   AABoxd;
00166 }
00167 
00168 #endif

Generated on Mon Apr 7 15:28:54 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002