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

OSGVolume.inl

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGVOLUME_INL_
00040 #define _OSGVOLUME_INL_
00041 
00042 #include <OSGVolume.h>
00043 #include <OSGBaseTypes.h>
00044 #include <OSGBaseFunctions.h>
00045 
00046 #include "OSGVector.h"
00047 #include "OSGMatrix.h"
00048 #include "OSGLine.h"
00049 
00050 OSG_BEGIN_NAMESPACE
00051 
00052 
00053 inline
00054 Volume::~Volume(void)
00055 {
00056 }
00057 
00058 /*-------------------------- state -----------------------------------------*/
00059 
00062 inline
00063 void Volume::setStatic(const bool value)
00064 {
00065     if(value == true)
00066         _state |= OSGSTATIC;
00067     else
00068         _state &= ~OSGSTATIC;
00069 }
00070 
00073 inline
00074 bool Volume::isStatic(void) const
00075 {
00076     return (_state & OSGSTATIC) ? true : false;
00077 }
00078 
00081 inline
00082 void Volume::setValid(const bool value)
00083 {
00084     if(!isStatic())
00085     {
00086         if(value == true)
00087             _state |=  OSGVALID;
00088         else
00089             _state &= ~OSGVALID;
00090     }
00091 }
00092 
00095 inline
00096 bool Volume::isValid(void) const
00097 {
00098     return (_state & OSGVALID) ? true : false;
00099 }
00100 
00103 inline
00104 void Volume::setEmpty(const bool value)
00105 {
00106     if(value == true)
00107     {
00108         _state |=  OSGEMPTY;
00109         _state |=  OSGVALID;
00110         _state &= ~OSGINFINITE;
00111     }
00112     else
00113     {
00114         _state &= ~OSGEMPTY;
00115     }
00116 }
00117 
00120 inline
00121 bool Volume::isEmpty(void) const
00122 {
00123     return (_state & OSGEMPTY) ? true : false;
00124 }
00125 
00128 inline
00129 void Volume::setInfinite(const bool value)
00130 {
00131     if(value == true)
00132     {
00133         _state |=  OSGINFINITE;
00134         _state |=  OSGVALID;
00135         _state &= ~OSGEMPTY;
00136     }
00137     else
00138     {
00139         _state &= ~OSGINFINITE;
00140     }
00141 }
00142 
00145 inline
00146 bool Volume::isInfinite(void) const
00147 {
00148     return (_state & OSGINFINITE) ? true : false;
00149 }
00150 
00151 
00156 inline
00157 bool Volume::isUntouchable(void) const
00158 {
00159     return (_state & (OSGINFINITE | OSGVALID | OSGSTATIC)) != OSGVALID;
00160 }
00161 
00162 
00165 inline
00166 UInt16 Volume::getState(void) const
00167 {
00168     return _state;
00169 }
00170 
00173 inline
00174 void Volume::setState(UInt16 val)
00175 {
00176     _state = val;
00177 }
00178 
00183 inline
00184 Pnt3f Volume::getMin(void) const
00185 {
00186     Pnt3f pmin; 
00187     Pnt3f pmax;
00188 
00189     getBounds(pmin, pmax);
00190 
00191     return pmin;
00192 }
00193 
00198 inline
00199 Pnt3f Volume::getMax(void) const
00200 {
00201     Pnt3f pmin;
00202     Pnt3f pmax;
00203 
00204     getBounds(pmin, pmax);
00205 
00206     return pmax;
00207 }
00208 
00209 inline
00210 Volume::Volume(void) : 
00211     _state(OSGVALID | OSGEMPTY) 
00212 {
00213 }
00214 
00215 inline
00216 Volume::Volume(const Volume &obj) : 
00217     _state(obj._state) 
00218 {
00219 }
00220 
00221 OSG_END_NAMESPACE
00222 
00223 #endif // _OSGVOLUME_INL_

Generated on Thu Aug 25 04:12:05 2005 for OpenSG by  doxygen 1.4.3