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

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]
 

set the volume to be valid

Definition at line 82 of file OSGVolume.inl.

References _state, isStatic(), and OSGVALID.

Referenced by osg::Surface::adjustVolume(), osg::Slices::adjustVolume(), osg::ProxyGroup::adjustVolume(), osg::Particles::adjustVolume(), osg::Geometry::adjustVolume(), osg::DVRVolume::adjustVolume(), osg::Node::invalidateVolume(), osg::BoxVolume::setBounds(), and osg::BoxVolume::setBoundsByCenterAndSize().

00083 {
00084     if(!isStatic())
00085     {
00086         if(value == true)
00087             _state |=  OSGVALID;
00088         else
00089             _state &= ~OSGVALID;
00090     }
00091 }

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

set the volume to contain nothing

Definition at line 104 of file OSGVolume.inl.

References _state, OSGEMPTY, OSGINFINITE, and OSGVALID.

Referenced by osg::Surface::adjustVolume(), osg::Slices::adjustVolume(), osg::ProxyGroup::adjustVolume(), osg::Particles::adjustVolume(), osg::Geometry::adjustVolume(), osg::DVRVolume::adjustVolume(), osg::BoxVolume::BoxVolume(), osg::CylinderVolume::CylinderVolume(), osg::ParticleBSPTree::doBuild(), osg::SphereVolume::extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::setBounds(), osg::BoxVolume::setBoundsByCenterAndSize(), osg::SphereVolume::setValue(), osg::SphereVolume::SphereVolume(), and osg::Node::updateVolume().

00105 {
00106     if(value == true)
00107     {
00108         _state |=  OSGEMPTY;
00109         _state |=  OSGVALID;
00110         _state &= ~OSGINFINITE;
00111     }
00112     else
00113     {
00114         _state &= ~OSGEMPTY;
00115     }
00116 }

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

Checks if the volume is empty

Definition at line 121 of file OSGVolume.inl.

References _state, and OSGEMPTY.

Referenced by osg::SphereVolume::extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::getCenter(), osg::SphereVolume::getScalarVolume(), osg::CylinderVolume::getScalarVolume(), osg::BoxVolume::getScalarVolume(), osg::BoxVolume::intersect(), and osg::BoxVolume::transform().

00122 {
00123     return (_state & OSGEMPTY) ? true : false;
00124 }

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::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::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.

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::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::FieldDataTraits< DynamicVolume >::copyFromBin().

00175 {
00176     _state = val;
00177 }

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

Referenced by osg::Billboard::adjustVolume(), osg::DynamicVolume::getBounds(), getMax(), getMin(), and osg::intersect().

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().

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]
 

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

Referenced by osg::Surface::adjustVolume(), osg::Slices::adjustVolume(), osg::ProxyGroup::adjustVolume(), osg::Particles::adjustVolume(), osg::Geometry::adjustVolume(), osg::DVRVolume::adjustVolume(), osg::Billboard::adjustVolume(), osg::DynamicVolume::extendBy(), and osg::Node::updateVolume().

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

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

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

Referenced by osg::Transform::adjustVolume(), osg::InverseTransform::adjustVolume(), and osg::DynamicVolume::transform().

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

Implemented in osg::BoxVolume, osg::CylinderVolume, osg::DynamicVolume, osg::FrustumVolume, osg::PolytopeVolume, and osg::SphereVolume.

Referenced by osg::DynamicVolume::dump(), and osg::volDump().

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

UInt16 osg::Volume::_state [protected]
 

Definition at line 149 of file OSGVolume.h.

Referenced by getState(), osg::DynamicVolume::instanceChanged(), isEmpty(), isInfinite(), isStatic(), isUntouchable(), isValid(), osg::FrustumVolume::operator=(), osg::BoxVolume::operator=(), operator==(), setEmpty(), setInfinite(), setState(), setStatic(), and setValid().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:12:38 2005 for OpenSG by  doxygen 1.4.3