OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
osg::Polytope Class Reference

#include <Polytope.h>

Collaboration diagram for osg::Polytope:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 Polytope ()
 
 Polytope (const Polytope &cv)
 
 Polytope (const PlaneList &pl)
 
 ~Polytope ()
 
void clear ()
 
Polytopeoperator= (const Polytope &cv)
 
void setToUnitFrustum (bool withNear=true, bool withFar=true)
 
void setToBoundingBox (const BoundingBox &bb)
 
void setAndTransformProvidingInverse (const Polytope &pt, const osg::Matrix &matrix)
 
void set (const PlaneList &pl)
 
void add (const osg::Plane &pl)
 
void flip ()
 
bool empty () const
 
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 ()
 
bool contains (const osg::Vec3 &v) const
 
bool contains (const std::vector< Vec3 > &vertices)
 
bool contains (const osg::BoundingSphere &bs)
 
bool contains (const osg::BoundingBox &bb)
 
bool containsAllOf (const std::vector< Vec3 > &vertices)
 
bool containsAllOf (const osg::BoundingSphere &bs)
 
bool containsAllOf (const osg::BoundingBox &bb)
 
void transform (const osg::Matrix &matrix)
 
void transformProvidingInverse (const osg::Matrix &matrix)
 

Protected Attributes

MaskStack _maskStack
 
ClippingMask _resultMask
 
PlaneList _planeList
 
VertexList _referenceVertexList
 

Detailed Description

A Polytope class for representing convex clipping volumes made up of a set of planes. When adding planes, their normals should point inwards (into the volume)

Definition at line 25 of file Polytope.h.

Member Typedef Documentation

typedef unsigned int osg::Polytope::ClippingMask

Definition at line 30 of file Polytope.h.

Definition at line 33 of file Polytope.h.

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

Definition at line 31 of file Polytope.h.

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

Definition at line 32 of file Polytope.h.

Constructor & Destructor Documentation

osg::Polytope::Polytope ( )
inline

Definition at line 35 of file Polytope.h.

osg::Polytope::Polytope ( const Polytope cv)
inline

Definition at line 37 of file Polytope.h.

osg::Polytope::Polytope ( const PlaneList pl)
inline

Definition at line 43 of file Polytope.h.

osg::Polytope::~Polytope ( )
inline

Definition at line 45 of file Polytope.h.

Member Function Documentation

void osg::Polytope::add ( const osg::Plane pl)
inline

Definition at line 135 of file Polytope.h.

void osg::Polytope::clear ( )
inline

Definition at line 47 of file Polytope.h.

bool osg::Polytope::contains ( const osg::Vec3 v) const
inline

Check whether a vertex is contained within clipping set.

Definition at line 196 of file Polytope.h.

bool osg::Polytope::contains ( const std::vector< Vec3 > &  vertices)
inline

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

Definition at line 212 of file Polytope.h.

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.

Definition at line 243 of file Polytope.h.

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.

Definition at line 270 of file Polytope.h.

bool osg::Polytope::containsAllOf ( const std::vector< Vec3 > &  vertices)
inline

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

Definition at line 293 of file Polytope.h.

bool osg::Polytope::containsAllOf ( const osg::BoundingSphere bs)
inline

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

Definition at line 316 of file Polytope.h.

bool osg::Polytope::containsAllOf ( const osg::BoundingBox bb)
inline

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

Definition at line 339 of file Polytope.h.

bool osg::Polytope::empty ( ) const
inline

Definition at line 148 of file Polytope.h.

void osg::Polytope::flip ( )
inline

flip/reverse the orientation of all the planes.

Definition at line 138 of file Polytope.h.

ClippingMask& osg::Polytope::getCurrentMask ( )
inline

Definition at line 172 of file Polytope.h.

ClippingMask osg::Polytope::getCurrentMask ( ) const
inline

Definition at line 174 of file Polytope.h.

MaskStack& osg::Polytope::getMaskStack ( )
inline

Definition at line 180 of file Polytope.h.

const MaskStack& osg::Polytope::getMaskStack ( ) const
inline

Definition at line 182 of file Polytope.h.

PlaneList& osg::Polytope::getPlaneList ( )
inline

Definition at line 150 of file Polytope.h.

Here is the caller graph for this function:

const PlaneList& osg::Polytope::getPlaneList ( ) const
inline

Definition at line 152 of file Polytope.h.

VertexList& osg::Polytope::getReferenceVertexList ( )
inline

Definition at line 157 of file Polytope.h.

const VertexList& osg::Polytope::getReferenceVertexList ( ) const
inline

Definition at line 159 of file Polytope.h.

ClippingMask osg::Polytope::getResultMask ( ) const
inline

Definition at line 178 of file Polytope.h.

Here is the caller graph for this function:

Polytope& osg::Polytope::operator= ( const Polytope cv)
inline

Definition at line 49 of file Polytope.h.

void osg::Polytope::popCurrentMask ( )
inline

Definition at line 190 of file Polytope.h.

Here is the caller graph for this function:

void osg::Polytope::pushCurrentMask ( )
inline

Definition at line 185 of file Polytope.h.

Here is the caller graph for this function:

void osg::Polytope::set ( const PlaneList pl)
inline

Definition at line 132 of file Polytope.h.

void osg::Polytope::setAndTransformProvidingInverse ( const Polytope pt,
const osg::Matrix matrix 
)
inline

Definition at line 85 of file Polytope.h.

Here is the call graph for this function:

void osg::Polytope::setReferenceVertexList ( VertexList vertices)
inline

Definition at line 155 of file Polytope.h.

void osg::Polytope::setResultMask ( ClippingMask  mask)
inline

Definition at line 176 of file Polytope.h.

Here is the caller graph for this function:

void osg::Polytope::setToBoundingBox ( const BoundingBox bb)
inline

Create a Polytope which is a equivalent to BoundingBox.

Definition at line 73 of file Polytope.h.

Here is the call graph for this function:

void osg::Polytope::setToUnitFrustum ( bool  withNear = true,
bool  withFar = true 
)
inline

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

Definition at line 60 of file Polytope.h.

void osg::Polytope::setupMask ( )
inline

Definition at line 162 of file Polytope.h.

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 a plane must be multiplied by the inverse transposed to transform it. This makes this operation expensive. If the inverse has been already calculated elsewhere then use transformProvidingInverse() instead. See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf

Definition at line 368 of file Polytope.h.

Here is the call graph for this function:

void osg::Polytope::transformProvidingInverse ( const osg::Matrix matrix)
inline

Transform the clipping set by provide a pre inverted matrix. see transform for details.

Definition at line 377 of file Polytope.h.

Member Data Documentation

MaskStack osg::Polytope::_maskStack
protected

Definition at line 398 of file Polytope.h.

PlaneList osg::Polytope::_planeList
protected

Definition at line 400 of file Polytope.h.

VertexList osg::Polytope::_referenceVertexList
protected

Definition at line 401 of file Polytope.h.

ClippingMask osg::Polytope::_resultMask
protected

Definition at line 399 of file Polytope.h.


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