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

osg::Polytope Class Reference

A Polytope class for representing convex clipping volumes made up. More...

List of all members.

Public Types

typedef unsigned int ClippingMask
typedef std::vector< PlanePlaneList
typedef std::vector< Vec3VertexList
typedef fast_back_stack< ClippingMaskMaskStack

Public Methods

 Polytope ()
 Polytope (const Polytope &cv)
 Polytope (const PlaneList &pl)
 ~Polytope ()
void clear ()
Polytope & operator= (const Polytope &cv)
void setToUnitFrustum (bool withNear=true, bool withFar=true)
 Create a Polytope with is cube, centered at 0,0,0, with sides of 2 units.

void set (const PlaneList &pl)
void add (const osg::Plane &pl)
void flip ()
 flip/reverse the orientation of all the planes.

PlaneListgetPlaneList ()
const PlaneListgetPlaneList () const
void setReferenceVertexList (VertexList &vertices)
VertexListgetReferenceVertexList ()
const VertexListgetReferenceVertexList () const
void setupMask ()
ClippingMaskgetCurrentMask ()
ClippingMask getCurrentMask () const
void setResultMask (ClippingMask mask)
ClippingMask getResultMask () const
MaskStackgetMaskStack ()
const MaskStackgetMaskStack () const
void pushCurrentMask ()
void popCurrentMask ()
const bool contains (const osg::Vec3 &v) const
 Check whether a vertex is contained with clipping set.

const bool contains (const std::vector< Vec3 > &vertices)
 Check whether any part of vertex list is contained with clipping set.

const bool contains (const osg::BoundingSphere &bs)
 Check whether any part of a bounding sphere is contained within clipping set.

const bool contains (const osg::BoundingBox &bb)
 Check whether any part of a bounding box is contained within clipping set.

const bool containsAllOf (const std::vector< Vec3 > &vertices)
 Check whether all of vertex list is contained with clipping set.

const bool containsAllOf (const osg::BoundingSphere &bs)
 Check whether the entire bounding sphere is contained within clipping set.

const bool containsAllOf (const osg::BoundingBox &bb)
 Check whether the entire bounding box is contained within clipping set.

void transform (const osg::Matrix &matrix)
 Transform the clipping set by matrix.

void transformProvidingInverse (const osg::Matrix &matrix)
 Transform the clipping set by provide a pre inverted matrix.


Protected Attributes

MaskStack _maskStack
ClippingMask _resultMask
PlaneList _planeList
VertexList _referenceVertexList


Detailed Description

A Polytope class for representing convex clipping volumes made up.

When adding planes, their normals should point inwards (into the volume)


Member Typedef Documentation

typedef unsigned int osg::Polytope::ClippingMask
 

typedef fast_back_stack<ClippingMask> osg::Polytope::MaskStack
 

typedef std::vector<Plane> osg::Polytope::PlaneList
 

typedef std::vector<Vec3> osg::Polytope::VertexList
 


Constructor & Destructor Documentation

osg::Polytope::Polytope   [inline]
 

osg::Polytope::Polytope const Polytope &    cv [inline]
 

osg::Polytope::Polytope const PlaneList   pl [inline]
 

osg::Polytope::~Polytope   [inline]
 


Member Function Documentation

void osg::Polytope::add const osg::Plane   pl [inline]
 

void osg::Polytope::clear   [inline]
 

const bool osg::Polytope::contains const osg::BoundingBox   bb [inline]
 

Check whether any part of a bounding box is contained within clipping set.

Using a mask to determine which planes should be used for the check, and modifying the mask to turn off planes which wouldn't contribute to clipping of any internal objects. This feature is used in osgUtil::CullVisitor to prevent redundant plane checking.

const bool osg::Polytope::contains const osg::BoundingSphere   bs [inline]
 

Check whether any part of a bounding sphere is contained within clipping set.

Using a mask to determine which planes should be used for the check, and modifying the mask to turn off planes which wouldn't contribute to clipping of any internal objects. This feature is used in osgUtil::CullVisitor to prevent redundant plane checking.

const bool osg::Polytope::contains const std::vector< Vec3 > &    vertices [inline]
 

Check whether any part of vertex list is contained with clipping set.

const bool osg::Polytope::contains const osg::Vec3   v const [inline]
 

Check whether a vertex is contained with clipping set.

const bool osg::Polytope::containsAllOf const osg::BoundingBox   bb [inline]
 

Check whether the entire bounding box is contained within clipping set.

const bool osg::Polytope::containsAllOf const osg::BoundingSphere   bs [inline]
 

Check whether the entire bounding sphere is contained within clipping set.

const bool osg::Polytope::containsAllOf const std::vector< Vec3 > &    vertices [inline]
 

Check whether all of vertex list is contained with clipping set.

void osg::Polytope::flip   [inline]
 

flip/reverse the orientation of all the planes.

ClippingMask osg::Polytope::getCurrentMask   const [inline]
 

ClippingMask& osg::Polytope::getCurrentMask   [inline]
 

const MaskStack& osg::Polytope::getMaskStack   const [inline]
 

MaskStack& osg::Polytope::getMaskStack   [inline]
 

const PlaneList& osg::Polytope::getPlaneList   const [inline]
 

PlaneList& osg::Polytope::getPlaneList   [inline]
 

const VertexList& osg::Polytope::getReferenceVertexList   const [inline]
 

VertexList& osg::Polytope::getReferenceVertexList   [inline]
 

ClippingMask osg::Polytope::getResultMask   const [inline]
 

Polytope& osg::Polytope::operator= const Polytope &    cv [inline]
 

void osg::Polytope::popCurrentMask   [inline]
 

void osg::Polytope::pushCurrentMask   [inline]
 

void osg::Polytope::set const PlaneList   pl [inline]
 

void osg::Polytope::setReferenceVertexList VertexList   vertices [inline]
 

void osg::Polytope::setResultMask ClippingMask    mask [inline]
 

void osg::Polytope::setToUnitFrustum bool    withNear = true,
bool    withFar = true
[inline]
 

Create a Polytope with is cube, centered at 0,0,0, with sides of 2 units.

void osg::Polytope::setupMask   [inline]
 

void osg::Polytope::transform const osg::Matrix   matrix [inline]
 

Transform the clipping set by matrix.

Note, this operations carries out the calculation of the inverse of the matrix since to transforms planes must be multiplied my the inverse transposed. This make this operation expensive. If the inverse has been already calculated elsewhere then use transformProvidingInverse() instead. See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf

void osg::Polytope::transformProvidingInverse const osg::Matrix   matrix [inline]
 

Transform the clipping set by provide a pre inverted matrix.

see transform for details.


Member Data Documentation

MaskStack osg::Polytope::_maskStack [protected]
 

PlaneList osg::Polytope::_planeList [protected]
 

VertexList osg::Polytope::_referenceVertexList [protected]
 

ClippingMask osg::Polytope::_resultMask [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:37 2002 for the Open Scene Graph by doxygen 1.2.16.