osg::FrustumVolume Class Reference
[Volume]

#include <OSGFrustumVolume.h>

Inheritance diagram for osg::FrustumVolume:

osg::Volume

List of all members.

Public Types

Plane Selection


enum  {
  P_NONE = 0, P_NEAR = 1, P_FAR = 2, P_LEFT = 4,
  P_RIGHT = 8, P_TOP = 16, P_BOTTOM = 32, P_ALL = P_NEAR | P_FAR | P_LEFT | P_RIGHT | P_TOP | P_BOTTOM
}
typedef UInt8 PlaneSet

Public Member Functions

bool operator== (const Volume &other) const
bool operator!= (const Volume &other) const
Constructors


 FrustumVolume (void)
 FrustumVolume (const Plane &pnear, const Plane &pfar, const Plane &left, const Plane &right, const Plane &top, const Plane &bottom)
 FrustumVolume (const FrustumVolume &obj)
Destructors


 ~FrustumVolume (void)
Get


const PlanegetNear (void) const
const PlanegetFar (void) const
const PlanegetLeft (void) const
const PlanegetRight (void) const
const PlanegetTop (void) const
const PlanegetBottom (void) const
const PlanegetPlanes (void) const
virtual void getCenter (Pnt3f &center) const
virtual Real32 getScalarVolume (void) const
virtual void getBounds (Pnt3f &minPnt, Pnt3f &maxPnt) const
 NOT IMPLEMENTED.
Get


void setPlanes (const Plane &pnear, const Plane &pfar, const Plane &left, const Plane &right, const Plane &top, const Plane &bottom)
void setPlanes (const Pnt3f &nlt, const Pnt3f &nlb, const Pnt3f &nrt, const Pnt3f &nrb, const Pnt3f &flt, const Pnt3f &flb, const Pnt3f &frt, const Pnt3f &frb)
void setPlanes (const Matrix &matrix)
Extending


virtual void extendBy (const Pnt3f &pt)
 NOT IMPLEMENTED.
virtual void extendBy (const Volume &volume)
 extend the volume to enclose the given one.
void extendBy (const FrustumVolume &bb)
 extend the volume to enclose the given frustum.
Intersection


virtual bool intersect (const Pnt3f &point) const
virtual bool intersect (const Line &line) const
virtual bool intersect (const Line &line, Real32 &minDist, Real32 &maxDist) const
virtual bool intersect (const Volume &volume) const
bool intersect (const FrustumVolume &bb) const
virtual bool isOnSurface (const Pnt3f &point) const
 NOT IMPLEMENTED.
Transformation


virtual void transform (const Matrix &m)
Assignment


const FrustumVolumeoperator= (const FrustumVolume &b1)
Output


virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
State


void setValid (const bool value=true)
bool isValid (void) const
void setEmpty (const bool value=true)
bool isEmpty (void) const
void setStatic (const bool value=true)
bool isStatic (void) const
void setInfinite (const bool value=true)
bool isInfinite (void) const
bool isUntouchable (void) const
UInt16 getState (void) const
void setState (UInt16 state)
Get Values


Pnt3f getMin (void) const
Pnt3f getMax (void) const

Protected Attributes

UInt16 _state

Private Attributes

Plane _planeVec [6]


Detailed Description

Definition at line 54 of file OSGFrustumVolume.h.


Member Typedef Documentation

Definition at line 74 of file OSGFrustumVolume.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
P_NONE 
P_NEAR 
P_FAR 
P_LEFT 
P_RIGHT 
P_TOP 
P_BOTTOM 
P_ALL 

Definition at line 64 of file OSGFrustumVolume.h.

00064          { P_NONE   = 0,
00065            P_NEAR   = 1, 
00066            P_FAR    = 2,
00067            P_LEFT   = 4,
00068            P_RIGHT  = 8,
00069            P_TOP    = 16,
00070            P_BOTTOM = 32,
00071            P_ALL    = P_NEAR | P_FAR | P_LEFT | P_RIGHT | P_TOP | P_BOTTOM
00072          };


Constructor & Destructor Documentation

osg::FrustumVolume::FrustumVolume ( void   )  [inline]

Default constructor - leaves box empty

Definition at line 56 of file OSGFrustumVolume.inl.

00056                              : 
00057     Volume() 
00058 {
00059 }

osg::FrustumVolume::FrustumVolume ( const Plane pnear,
const Plane pfar,
const Plane left,
const Plane right,
const Plane top,
const Plane bottom 
) [inline]

Constructor given bounds

Definition at line 65 of file OSGFrustumVolume.inl.

References _planeVec.

00067                                                                       :
00068     Volume()
00069 {
00070     _planeVec[0] = pnear;
00071     _planeVec[1] = pfar;
00072     _planeVec[2] = left;
00073     _planeVec[3] = right;
00074     _planeVec[4] = top;
00075     _planeVec[5] = bottom;
00076 }

osg::FrustumVolume::FrustumVolume ( const FrustumVolume obj  )  [inline]

Copy Constructor

Definition at line 82 of file OSGFrustumVolume.inl.

References _planeVec.

00082                                                      :
00083     Volume(obj)
00084 {
00085     _planeVec[0] = obj._planeVec[0];
00086     _planeVec[1] = obj._planeVec[1];
00087     _planeVec[2] = obj._planeVec[2];
00088     _planeVec[3] = obj._planeVec[3];
00089     _planeVec[4] = obj._planeVec[4];
00090     _planeVec[5] = obj._planeVec[5];
00091 }

osg::FrustumVolume::~FrustumVolume ( void   )  [inline]

Destructor

Definition at line 97 of file OSGFrustumVolume.inl.

00098 {
00099 }


Member Function Documentation

const Plane & osg::FrustumVolume::getNear ( void   )  const [inline]

Returns the near plane

Definition at line 107 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00108 {
00109     return _planeVec[0];
00110 }

const Plane & osg::FrustumVolume::getFar ( void   )  const [inline]

Returns the far plane

Definition at line 116 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00117 {
00118     return _planeVec[1];
00119 }

const Plane & osg::FrustumVolume::getLeft ( void   )  const [inline]

Returns the left plane

Definition at line 125 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00126 {
00127     return _planeVec[2];
00128 }

const Plane & osg::FrustumVolume::getRight ( void   )  const [inline]

Returns the right plane

Definition at line 134 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00135 {
00136     return _planeVec[3];
00137 }

const Plane & osg::FrustumVolume::getTop ( void   )  const [inline]

Returns the top plane

Definition at line 143 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00144 {
00145     return _planeVec[4];
00146 }

const Plane & osg::FrustumVolume::getBottom ( void   )  const [inline]

Returns the bottom plane

Definition at line 152 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::drawVolume().

00153 {
00154     return _planeVec[5];
00155 }

const Plane * osg::FrustumVolume::getPlanes ( void   )  const [inline]

get method

Definition at line 162 of file OSGFrustumVolume.inl.

References _planeVec.

Referenced by osg::Line::intersect(), osg::intersect(), and osg::operator==().

00163 {
00164     return _planeVec;
00165 }

void FrustumVolume::getCenter ( Pnt3f center  )  const [virtual]

Returns the near plane

Implements osg::Volume.

Definition at line 75 of file OSGFrustumVolume.cpp.

References _planeVec, osg::Plane::intersect(), osg::Plane::intersectInfinite(), and osg::PointInterface< ValueTypeT, StorageInterfaceT >::subZero().

00076 {
00077     Pnt3f vertices[8];
00078     Line  lines   [4];
00079 
00080     _planeVec[5].intersect(_planeVec[3],lines[3]);
00081     _planeVec[3].intersect(_planeVec[4],lines[2]);
00082     _planeVec[4].intersect(_planeVec[2],lines[0]);
00083     _planeVec[2].intersect(_planeVec[5],lines[1]);
00084     
00085     for(Int32 i = 0; i < 4; i++)
00086     {
00087         _planeVec[0].intersectInfinite(lines[i],vertices[    i]);
00088         _planeVec[1].intersectInfinite(lines[i],vertices[4 + i]);
00089     }    
00090     
00091     center = Pnt3f(0.f, 0.f ,0.f);
00092 
00093     for(Int32 i = 0; i < 8; i++)
00094     {        
00095         center = center + vertices[i].subZero();
00096     }
00097 
00098     center /= 8.f;
00099 }

Real32 FrustumVolume::getScalarVolume ( void   )  const [virtual]

Returns the near plane

Implements osg::Volume.

Definition at line 102 of file OSGFrustumVolume.cpp.

References _planeVec, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::cross(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::dot(), osg::Plane::getDistanceFromOrigin(), osg::Plane::getNormal(), osg::Plane::intersect(), osg::Plane::intersectInfinite(), osg::osgabs(), and osg::PointInterface< ValueTypeT, StorageInterfaceT >::subZero().

00103 {
00104     const Int32 faces[6][4] =
00105     {
00106         {0,1,3,2},
00107         {4,5,7,6},
00108         {0,4,5,1},
00109         {2,6,7,3},
00110         {2,6,4,0},
00111         {1,5,7,3}
00112     };
00113 
00114     Pnt3f vertices[8];
00115     Line  lines   [4];
00116 
00117     _planeVec[5].intersect(_planeVec[3], lines[3]); 
00118     _planeVec[3].intersect(_planeVec[4], lines[2]); 
00119     _planeVec[4].intersect(_planeVec[2], lines[0]); 
00120     _planeVec[2].intersect(_planeVec[5], lines[1]); 
00121     
00122     for(Int32 i = 0; i < 4; i++)
00123     {
00124         _planeVec[0].intersectInfinite(lines[i], vertices[    i]);
00125         _planeVec[1].intersectInfinite(lines[i], vertices[4 + i]);
00126     }
00127     
00128 
00129     Pnt3f center = Pnt3f(0.f, 0.f, 0.f);
00130 
00131     for(Int32 i = 0; i < 8; i++)
00132     {
00133         center = center + vertices[i].subZero();
00134     }
00135 
00136     center /= 8.f;
00137     
00138     Real32 volume = .0f;
00139 
00140     for(Int32 i = 0; i < 6; i++)
00141     {
00142         Real32 height;
00143         Real32 area;
00144 
00145         height = 
00146             _planeVec[i].getNormal().dot(center) - 
00147             _planeVec[i].getDistanceFromOrigin();
00148         
00149         Vec3f main_diag = vertices[faces[i][0]] - vertices[faces[i][2]];
00150         Vec3f sec_diag  = vertices[faces[i][1]] - vertices[faces[i][3]];
00151 
00152         area = osgabs((main_diag.cross(sec_diag)).length() / 2.f);        
00153 
00154         volume += osgabs((height*area)) / 3.f;
00155     }
00156 
00157     return volume;
00158 }

void FrustumVolume::getBounds ( Pnt3f minPnt,
Pnt3f maxPnt 
) const [virtual]

Warning:
NOT IMPLEMENTED

Implements osg::Volume.

Definition at line 166 of file OSGFrustumVolume.cpp.

00168 {
00169 }

void FrustumVolume::setPlanes ( const Plane pnear,
const Plane pfar,
const Plane left,
const Plane right,
const Plane top,
const Plane bottom 
)

Definition at line 173 of file OSGFrustumVolume.cpp.

References _planeVec.

Referenced by osg::Camera::getFrustum().

00176 {
00177     _planeVec[0] = pnear;
00178     _planeVec[1] = pfar;
00179     _planeVec[2] = left;
00180     _planeVec[3] = right;
00181     _planeVec[4] = top;
00182     _planeVec[5] = bottom;
00183 }

void FrustumVolume::setPlanes ( const Pnt3f nlt,
const Pnt3f nlb,
const Pnt3f nrt,
const Pnt3f nrb,
const Pnt3f flt,
const Pnt3f flb,
const Pnt3f frt,
const Pnt3f frb 
)

Definition at line 186 of file OSGFrustumVolume.cpp.

References _planeVec.

00190 {
00191 
00192     Plane pnear  (nlb,nlt,nrb);
00193     Plane pfar   (frb,frt,flb);
00194     Plane pleft  (flb,flt,nlb);
00195     Plane pright (nrb,nrt,frb);
00196     Plane ptop   (frt,nrt,flt);
00197     Plane pbottom(nlb,nrb,flb);
00198 
00199 
00200     _planeVec[0] = pnear;
00201     _planeVec[1] = pfar;
00202     _planeVec[2] = pleft;
00203     _planeVec[3] = pright;
00204     _planeVec[4] = ptop;
00205     _planeVec[5] = pbottom;
00206 
00207 }

void FrustumVolume::setPlanes ( const Matrix matrix  ) 

Definition at line 210 of file OSGFrustumVolume.cpp.

References _planeVec, osg::osgsqrt(), and osg::Plane::set().

00211 {
00212     Vec4f  planeEquation[6];
00213     Real32 vectorLength;
00214     Vec3f  normal;
00215 
00216     planeEquation[0][0] = objectClipMat[0][3] - objectClipMat[0][0];
00217     planeEquation[0][1] = objectClipMat[1][3] - objectClipMat[1][0];
00218     planeEquation[0][2] = objectClipMat[2][3] - objectClipMat[2][0];
00219     planeEquation[0][3] = objectClipMat[3][3] - objectClipMat[3][0];
00220 
00221     planeEquation[1][0] = objectClipMat[0][3] + objectClipMat[0][0];
00222     planeEquation[1][1] = objectClipMat[1][3] + objectClipMat[1][0];
00223     planeEquation[1][2] = objectClipMat[2][3] + objectClipMat[2][0];
00224     planeEquation[1][3] = objectClipMat[3][3] + objectClipMat[3][0];
00225 
00226     planeEquation[2][0] = objectClipMat[0][3] + objectClipMat[0][1];
00227     planeEquation[2][1] = objectClipMat[1][3] + objectClipMat[1][1];
00228     planeEquation[2][2] = objectClipMat[2][3] + objectClipMat[2][1];
00229     planeEquation[2][3] = objectClipMat[3][3] + objectClipMat[3][1];
00230 
00231     planeEquation[3][0] = objectClipMat[0][3] - objectClipMat[0][1];
00232     planeEquation[3][1] = objectClipMat[1][3] - objectClipMat[1][1];
00233     planeEquation[3][2] = objectClipMat[2][3] - objectClipMat[2][1];
00234     planeEquation[3][3] = objectClipMat[3][3] - objectClipMat[3][1];
00235 
00236     planeEquation[4][0] = objectClipMat[0][3] + objectClipMat[0][2];
00237     planeEquation[4][1] = objectClipMat[1][3] + objectClipMat[1][2];
00238     planeEquation[4][2] = objectClipMat[2][3] + objectClipMat[2][2];
00239     planeEquation[4][3] = objectClipMat[3][3] + objectClipMat[3][2];
00240 
00241     planeEquation[5][0] = objectClipMat[0][3] - objectClipMat[0][2];
00242     planeEquation[5][1] = objectClipMat[1][3] - objectClipMat[1][2];
00243     planeEquation[5][2] = objectClipMat[2][3] - objectClipMat[2][2];
00244     planeEquation[5][3] = objectClipMat[3][3] - objectClipMat[3][2];
00245 
00246     for(Int32  i = 0; i < 6; i++) 
00247     {
00248         vectorLength = 
00249             osgsqrt(planeEquation[i][0] * planeEquation[i][0] +
00250                     planeEquation[i][1] * planeEquation[i][1] +
00251                     planeEquation[i][2] * planeEquation[i][2]);
00252  
00253         planeEquation[i][0] /=  vectorLength;
00254         planeEquation[i][1] /=  vectorLength;
00255         planeEquation[i][2] /=  vectorLength;
00256         planeEquation[i][3] /= -vectorLength;
00257     }
00258 
00259   // right
00260   _planeVec[3].set(planeEquation[0]);
00261 
00262   // left
00263   _planeVec[2].set(planeEquation[1]);
00264 
00265   // bottom
00266   _planeVec[5].set(planeEquation[2]);
00267 
00268   // top
00269   _planeVec[4].set(planeEquation[3]);
00270 
00271   // near
00272   _planeVec[0].set(planeEquation[4]);
00273 
00274   // far
00275   _planeVec[1].set(planeEquation[5]);
00276 }

void FrustumVolume::extendBy ( const Pnt3f pt  )  [virtual]

Warning:
NOT IMPLEMENTED

Implements osg::Volume.

Definition at line 287 of file OSGFrustumVolume.cpp.

00288 {
00289 }

void FrustumVolume::extendBy ( const Volume volume  )  [virtual]

Implements osg::Volume.

Definition at line 295 of file OSGFrustumVolume.cpp.

References osg::extend().

00296 {
00297     OSG::extend(*this, volume);
00298 }

void osg::FrustumVolume::extendBy ( const FrustumVolume bb  )  [inline]

Definition at line 174 of file OSGFrustumVolume.inl.

References osg::extend().

00175 {
00176     OSG::extend(*this, volume);
00177 }

bool FrustumVolume::intersect ( const Pnt3f point  )  const [virtual]

Implements osg::Volume.

Definition at line 303 of file OSGFrustumVolume.cpp.

References _planeVec, osg::Plane::getDistanceFromOrigin(), and osg::Plane::getNormal().

Referenced by osg::RenderAction::isVisible(), and osg::DrawAction::isVisible().

00304 {
00305     bool retCode = true;
00306 
00307     for(Int32 i = 0; i < 6; i++) 
00308     {
00309         if((_planeVec[i].getNormal().x() * point.x() +
00310             _planeVec[i].getNormal().y() * point.y() +
00311             _planeVec[i].getNormal().z() * point.z() -
00312             _planeVec[i].getDistanceFromOrigin()     ) < 0.f) 
00313         {
00314             retCode = false;
00315             break;
00316         }
00317     }
00318     
00319     return retCode;
00320 }

bool FrustumVolume::intersect ( const Line line  )  const [virtual]

Implements osg::Volume.

Definition at line 323 of file OSGFrustumVolume.cpp.

References osg::Line::intersect().

00324 {
00325     return line.intersect(*this);
00326 }

bool FrustumVolume::intersect ( const Line line,
Real32 minDist,
Real32 maxDist 
) const [virtual]

Implements osg::Volume.

Definition at line 329 of file OSGFrustumVolume.cpp.

References osg::Line::intersect().

00332 {
00333     return line.intersect(*this, minDist, maxDist);
00334 }

bool FrustumVolume::intersect ( const Volume volume  )  const [virtual]

Implements osg::Volume.

Definition at line 337 of file OSGFrustumVolume.cpp.

References osg::intersect().

00338 {
00339     return OSG::intersect(*this, volume);
00340 }

bool osg::FrustumVolume::intersect ( const FrustumVolume bb  )  const [inline]

Definition at line 182 of file OSGFrustumVolume.inl.

References osg::intersect().

00183 {
00184     return OSG::intersect(*this, volume);
00185 }

bool FrustumVolume::isOnSurface ( const Pnt3f point  )  const [virtual]

Warning:
NOT IMPLEMENTED

Implements osg::Volume.

Definition at line 347 of file OSGFrustumVolume.cpp.

References FWARNING.

00348 {
00349     FWARNING(("FrustumVolume::isOnSurface: NYI!\n"));
00350     return false;
00351 }

void FrustumVolume::transform ( const Matrix m  )  [virtual]

Implements osg::Volume.

Definition at line 353 of file OSGFrustumVolume.cpp.

References _planeVec, and osg::Plane::transform().

Referenced by osg::RenderAction::pushVisibility().

00354 {
00355     _planeVec[0].transform(m);
00356     _planeVec[1].transform(m);
00357     _planeVec[2].transform(m);
00358     _planeVec[3].transform(m);
00359     _planeVec[4].transform(m);
00360     _planeVec[5].transform(m); 
00361 }

const FrustumVolume & FrustumVolume::operator= ( const FrustumVolume b1  ) 

Definition at line 363 of file OSGFrustumVolume.cpp.

References _planeVec, and osg::Volume::_state.

00364 {
00365     for(Int32 i = 0; i < 5; i++)
00366     {
00367         _planeVec[i] = b1._planeVec[i];
00368     }
00369 
00370     _state = b1._state;
00371 
00372     return *this;
00373 }

void FrustumVolume::dump ( UInt32  uiIndent = 0,
const BitVector  bvFlags = 0 
) const [virtual]

Implements osg::Volume.

Definition at line 375 of file OSGFrustumVolume.cpp.

References _planeVec, osg::Plane::getDistanceFromOrigin(), osg::Plane::getNormal(), and PLOG.

00377 {
00378 #if 1
00379 fprintf(stderr,"Frustum:(%f %f %f:%f)(%f %f %f:%f)(%f %f %f:%f)"
00380                 "(%f %f %f:%f)(%f %f %f:%f)(%f %f %f:%f)\n",
00381                 _planeVec[0].getNormal()[0],
00382                 _planeVec[0].getNormal()[1],
00383                 _planeVec[0].getNormal()[2],
00384                 _planeVec[0].getDistanceFromOrigin(),
00385                 _planeVec[1].getNormal()[0],
00386                 _planeVec[1].getNormal()[1],
00387                 _planeVec[1].getNormal()[2],
00388                 _planeVec[1].getDistanceFromOrigin(),
00389                 _planeVec[2].getNormal()[0],
00390                 _planeVec[2].getNormal()[1],
00391                 _planeVec[2].getNormal()[2],
00392                 _planeVec[2].getDistanceFromOrigin(),
00393                 _planeVec[3].getNormal()[0],
00394                 _planeVec[3].getNormal()[1],
00395                 _planeVec[3].getNormal()[2],
00396                 _planeVec[3].getDistanceFromOrigin(),
00397                 _planeVec[4].getNormal()[0],
00398                 _planeVec[4].getNormal()[1],
00399                 _planeVec[4].getNormal()[2],
00400                 _planeVec[4].getDistanceFromOrigin(),
00401                 _planeVec[5].getNormal()[0],
00402                 _planeVec[5].getNormal()[1],
00403                 _planeVec[5].getNormal()[2],
00404                 _planeVec[5].getDistanceFromOrigin() );
00405                 
00406 
00407 #else 
00408     PLOG << "Frustum("
00409              << _planeVec[0].getNormal() << ":" 
00410              << _planeVec[0].getDistanceFromOrigin() << "|"
00411              << _planeVec[1].getNormal() << ":" 
00412              << _planeVec[1].getDistanceFromOrigin() << "|"
00413              << _planeVec[2].getNormal() << ":" 
00414              << _planeVec[2].getDistanceFromOrigin() << "|"
00415              << _planeVec[3].getNormal() << ":" 
00416              << _planeVec[3].getDistanceFromOrigin() << "|"
00417              << _planeVec[4].getNormal() << ":" 
00418              << _planeVec[4].getDistanceFromOrigin() << "|"
00419              << _planeVec[5].getNormal() << ":" 
00420              << _planeVec[5].getDistanceFromOrigin() << "|"
00421              << ")";
00422 #endif
00423 }

void osg::Volume::setValid ( const bool  value = true  )  [inline, inherited]

bool osg::Volume::isValid ( void   )  const [inline, inherited]

Checks if the volume is valid

Definition at line 96 of file OSGVolume.inl.

References osg::Volume::_state, and osg::Volume::OSGVALID.

Referenced by osg::extend(), osg::Group::intersect(), osg::Geometry::intersect(), osg::DVRVolume::intersect(), and osg::Node::invalidateVolume().

00097 {
00098     return (_state & OSGVALID) ? true : false;
00099 }

void osg::Volume::setEmpty ( const bool  value = true  )  [inline, inherited]

bool osg::Volume::isEmpty ( void   )  const [inline, inherited]

void osg::Volume::setStatic ( const bool  value = true  )  [inline, inherited]

set the volume to be static

Definition at line 63 of file OSGVolume.inl.

References osg::Volume::_state, and osg::Volume::OSGSTATIC.

00064 {
00065     if(value == true)
00066         _state |= OSGSTATIC;
00067     else
00068         _state &= ~OSGSTATIC;
00069 }

bool osg::Volume::isStatic ( void   )  const [inline, inherited]

Checks if the volume is static

Definition at line 74 of file OSGVolume.inl.

References osg::Volume::_state, and osg::Volume::OSGSTATIC.

Referenced by osg::extend(), osg::Node::invalidateVolume(), and osg::Volume::setValid().

00075 {
00076     return (_state & OSGSTATIC) ? true : false;
00077 }

void osg::Volume::setInfinite ( const bool  value = true  )  [inline, inherited]

set the volume to be infinite

Definition at line 129 of file OSGVolume.inl.

References osg::Volume::_state, osg::Volume::OSGEMPTY, osg::Volume::OSGINFINITE, and osg::Volume::OSGVALID.

Referenced by osg::extend(), osg::BoxVolume::setBounds(), and osg::BoxVolume::setBoundsByCenterAndSize().

00130 {
00131     if(value == true)
00132     {
00133         _state |=  OSGINFINITE;
00134         _state |=  OSGVALID;
00135         _state &= ~OSGEMPTY;
00136     }
00137     else
00138     {
00139         _state &= ~OSGINFINITE;
00140     }
00141 }

bool osg::Volume::isInfinite ( void   )  const [inline, inherited]

Checks if the volume is infinite

Definition at line 146 of file OSGVolume.inl.

References osg::Volume::_state, and osg::Volume::OSGINFINITE.

Referenced by osg::extend(), and osg::intersect().

00147 {
00148     return (_state & OSGINFINITE) ? true : false;
00149 }

bool osg::Volume::isUntouchable ( void   )  const [inline, inherited]

Checks if the volume is untouchable, i.e. it's values should not be changed. Mainly used internally to speed up early outs in extendBy().

Definition at line 157 of file OSGVolume.inl.

References osg::Volume::_state, osg::Volume::OSGINFINITE, osg::Volume::OSGSTATIC, and osg::Volume::OSGVALID.

Referenced by osg::SphereVolume::extendBy(), and osg::BoxVolume::extendBy().

00158 {
00159     return (_state & (OSGINFINITE | OSGVALID | OSGSTATIC)) != OSGVALID;
00160 }

UInt16 osg::Volume::getState ( void   )  const [inline, inherited]

get the volume's state

Definition at line 166 of file OSGVolume.inl.

References osg::Volume::_state.

Referenced by osg::DynamicVolume::instanceChanged().

00167 {
00168     return _state;
00169 }

void osg::Volume::setState ( UInt16  val  )  [inline, inherited]

set the volume's state

Definition at line 174 of file OSGVolume.inl.

References osg::Volume::_state.

00175 {
00176     _state = val;
00177 }

Pnt3f osg::Volume::getMin ( void   )  const [inline, inherited]

Return the lowest point of the volume. Just a convience wrapper for getBounds()

Reimplemented in osg::BoxVolume.

Definition at line 184 of file OSGVolume.inl.

References osg::Volume::getBounds().

00185 {
00186     Pnt3f pmin; 
00187     Pnt3f pmax;
00188 
00189     getBounds(pmin, pmax);
00190 
00191     return pmin;
00192 }

Pnt3f osg::Volume::getMax ( void   )  const [inline, inherited]

Return the highest point of the volume. Just a convience wrapper for getBounds()

Reimplemented in osg::BoxVolume.

Definition at line 199 of file OSGVolume.inl.

References osg::Volume::getBounds().

Referenced by osg::RenderAction::drawHierarchicalMultiFrameOcclusionBB(), osg::RenderAction::drawMultiFrameOcclusionBB(), and osg::RenderAction::dropFunctor().

00200 {
00201     Pnt3f pmin;
00202     Pnt3f pmax;
00203 
00204     getBounds(pmin, pmax);
00205 
00206     return pmax;
00207 }

bool Volume::operator== ( const Volume other  )  const [inherited]

Definition at line 53 of file OSGVolume.cpp.

References osg::Volume::_state.

00054 {
00055     return _state == other._state;
00056 }

bool Volume::operator!= ( const Volume other  )  const [inherited]

Definition at line 58 of file OSGVolume.cpp.

00059 {
00060     return !(*this == other);
00061 }


Member Data Documentation

UInt16 osg::Volume::_state [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Mon Mar 17 11:10:45 2008 for OpenSG by  doxygen 1.5.5