osg::Volume Class Reference
[Volume]

#include <OSGVolume.h>

Inheritance diagram for osg::Volume:

osg::BoxVolume osg::CylinderVolume osg::DynamicVolume osg::FrustumVolume osg::PolytopeVolume osg::SphereVolume

List of all members.

Public Member Functions

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


virtual ~Volume (void)
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


virtual void getCenter (Pnt3f &center) const =0
virtual float getScalarVolume (void) const =0
virtual void getBounds (Pnt3f &min, Pnt3f &max) const =0
Pnt3f getMin (void) const
Pnt3f getMax (void) const
Extending


virtual void extendBy (const Pnt3f &pt)=0
virtual void extendBy (const Volume &volume)=0
Intersection


virtual bool intersect (const Pnt3f &point) const =0
virtual bool intersect (const Line &line) const =0
virtual bool intersect (const Line &line, Real32 &enter, Real32 &exit) const =0
virtual bool intersect (const Volume &volume) const =0
virtual bool isOnSurface (const Pnt3f &point) const =0
Transformation


virtual void transform (const Matrix &matrix)=0
Output


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

Protected Member Functions

Constructors


 Volume (void)
 Volume (const Volume &obj)

Protected Attributes

UInt16 _state

Private Types

enum  State { OSGVALID = 1, OSGEMPTY = 2, OSGSTATIC = 4, OSGINFINITE = 8 }


Detailed Description

Definition at line 55 of file OSGVolume.h.


Member Enumeration Documentation

enum osg::Volume::State [private]

Enumerator:
OSGVALID 
OSGEMPTY 
OSGSTATIC 
OSGINFINITE 

Definition at line 163 of file OSGVolume.h.

00164     {
00165         OSGVALID    = 1,
00166         OSGEMPTY    = 2,
00167         OSGSTATIC   = 4,
00168         OSGINFINITE = 8
00169     };


Constructor & Destructor Documentation

osg::Volume::~Volume ( void   )  [inline, virtual]

Definition at line 54 of file OSGVolume.inl.

00055 {
00056 }

osg::Volume::Volume ( void   )  [inline, protected]

Definition at line 210 of file OSGVolume.inl.

00210                    : 
00211     _state(OSGVALID | OSGEMPTY) 
00212 {
00213 }

osg::Volume::Volume ( const Volume obj  )  [inline, protected]

Definition at line 216 of file OSGVolume.inl.

00216                                 : 
00217     _state(obj._state) 
00218 {
00219 }


Member Function Documentation

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

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

Checks if the volume is valid

Definition at line 96 of file OSGVolume.inl.

References _state, and 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]

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

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

set the volume to be static

Definition at line 63 of file OSGVolume.inl.

References _state, and OSGSTATIC.

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

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

Checks if the volume is static

Definition at line 74 of file OSGVolume.inl.

References _state, and OSGSTATIC.

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

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

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

set the volume to be infinite

Definition at line 129 of file OSGVolume.inl.

References _state, OSGEMPTY, OSGINFINITE, and 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]

Checks if the volume is infinite

Definition at line 146 of file OSGVolume.inl.

References _state, and OSGINFINITE.

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

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

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

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 _state, OSGINFINITE, OSGSTATIC, and 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]

get the volume's state

Definition at line 166 of file OSGVolume.inl.

References _state.

Referenced by osg::osg::FieldDataTraits< DynamicVolume >::copyToBin(), and osg::DynamicVolume::instanceChanged().

00167 {
00168     return _state;
00169 }

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

set the volume's state

Definition at line 174 of file OSGVolume.inl.

References _state.

Referenced by osg::osg::FieldDataTraits< DynamicVolume >::copyFromBin().

00175 {
00176     _state = val;
00177 }

virtual void osg::Volume::getCenter ( Pnt3f center  )  const [pure virtual]

virtual float osg::Volume::getScalarVolume ( void   )  const [pure virtual]

virtual void osg::Volume::getBounds ( Pnt3f min,
Pnt3f max 
) const [pure virtual]

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

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 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]

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 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 }

virtual void osg::Volume::extendBy ( const Pnt3f pt  )  [pure virtual]

virtual void osg::Volume::extendBy ( const Volume volume  )  [pure virtual]

virtual bool osg::Volume::intersect ( const Pnt3f point  )  const [pure virtual]

virtual bool osg::Volume::intersect ( const Line line  )  const [pure virtual]

virtual bool osg::Volume::intersect ( const Line line,
Real32 enter,
Real32 exit 
) const [pure virtual]

virtual bool osg::Volume::intersect ( const Volume volume  )  const [pure virtual]

virtual bool osg::Volume::isOnSurface ( const Pnt3f point  )  const [pure virtual]

virtual void osg::Volume::transform ( const Matrix matrix  )  [pure virtual]

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

bool Volume::operator== ( const Volume other  )  const

Definition at line 53 of file OSGVolume.cpp.

References _state.

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

bool Volume::operator!= ( const Volume other  )  const

Definition at line 58 of file OSGVolume.cpp.

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


Member Data Documentation


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

Generated on Mon Mar 17 12:03:21 2008 for OpenSG by  doxygen 1.5.5