openscenegraph
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgUtil::IntersectionVisitor Class Reference
Inheritance diagram for osgUtil::IntersectionVisitor:
osg::NodeVisitor osg::Referenced

Classes

struct  ReadCallback
 

Public Types

enum  LODSelectionMode { USE_HIGHEST_LEVEL_OF_DETAIL, USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION }
 
- Public Types inherited from osg::NodeVisitor
enum  TraversalMode { TRAVERSE_NONE, TRAVERSE_PARENTS, TRAVERSE_ALL_CHILDREN, TRAVERSE_ACTIVE_CHILDREN }
 
enum  VisitorType {
  NODE_VISITOR = 0, UPDATE_VISITOR, EVENT_VISITOR, COLLECT_OCCLUDER_VISITOR,
  CULL_VISITOR
}
 

Public Member Functions

 IntersectionVisitor (Intersector *intersector=0, ReadCallback *readCallback=0)
 
 META_NodeVisitor (osgUtil, IntersectionVisitor) virtual void reset()
 
void setIntersector (Intersector *intersector)
 
IntersectorgetIntersector ()
 
const IntersectorgetIntersector () const
 
void setUseKdTreeWhenAvailable (bool useKdTrees)
 
bool getUseKdTreeWhenAvailable () const
 
void setDoDummyTraversal (bool dummy)
 
bool getDoDummyTraversal () const
 
void setReadCallback (ReadCallback *rc)
 
ReadCallbackgetReadCallback ()
 
const ReadCallbackgetReadCallback () const
 
void pushWindowMatrix (osg::RefMatrix *matrix)
 
void pushWindowMatrix (osg::Viewport *viewport)
 
void popWindowMatrix ()
 
osg::RefMatrixgetWindowMatrix ()
 
const osg::RefMatrixgetWindowMatrix () const
 
void pushProjectionMatrix (osg::RefMatrix *matrix)
 
void popProjectionMatrix ()
 
osg::RefMatrixgetProjectionMatrix ()
 
const osg::RefMatrixgetProjectionMatrix () const
 
void pushViewMatrix (osg::RefMatrix *matrix)
 
void popViewMatrix ()
 
osg::RefMatrixgetViewMatrix ()
 
const osg::RefMatrixgetViewMatrix () const
 
void pushModelMatrix (osg::RefMatrix *matrix)
 
void popModelMatrix ()
 
osg::RefMatrixgetModelMatrix ()
 
const osg::RefMatrixgetModelMatrix () const
 
void setReferenceEyePoint (const osg::Vec3 &ep)
 
const osg::Vec3getReferenceEyePoint () const
 
void setReferenceEyePointCoordinateFrame (Intersector::CoordinateFrame cf)
 
Intersector::CoordinateFrame getReferenceEyePointCoordinateFrame () const
 
virtual osg::Vec3 getEyePoint () const
 
void setLODSelectionMode (LODSelectionMode mode)
 
LODSelectionMode getLODSelectionMode () const
 
virtual float getDistanceToEyePoint (const osg::Vec3 &pos, bool withLODScale) const
 
virtual void apply (osg::Node &node)
 
virtual void apply (osg::Geode &geode)
 
virtual void apply (osg::Billboard &geode)
 
virtual void apply (osg::Group &group)
 
virtual void apply (osg::LOD &lod)
 
virtual void apply (osg::PagedLOD &lod)
 
virtual void apply (osg::Transform &transform)
 
virtual void apply (osg::Projection &projection)
 
virtual void apply (osg::Camera &camera)
 
- Public Member Functions inherited from osg::NodeVisitor
 NodeVisitor (TraversalMode tm=TRAVERSE_NONE)
 
 NodeVisitor (VisitorType type, TraversalMode tm=TRAVERSE_NONE)
 
virtual ~NodeVisitor ()
 
virtual const char * libraryName () const
 
virtual const char * className () const
 
virtual void reset ()
 
void setVisitorType (VisitorType type)
 
VisitorType getVisitorType () const
 
void setTraversalNumber (unsigned int fn)
 
unsigned int getTraversalNumber () const
 
void setFrameStamp (FrameStamp *fs)
 
const FrameStampgetFrameStamp () const
 
void setTraversalMask (Node::NodeMask mask)
 
Node::NodeMask getTraversalMask () const
 
void setNodeMaskOverride (Node::NodeMask mask)
 
Node::NodeMask getNodeMaskOverride () const
 
bool validNodeMask (const osg::Node &node) const
 
void setTraversalMode (TraversalMode mode)
 
TraversalMode getTraversalMode () const
 
void setUserData (Referenced *obj)
 
ReferencedgetUserData ()
 
const ReferencedgetUserData () const
 
void traverse (Node &node)
 
void pushOntoNodePath (Node *node)
 
void popFromNodePath ()
 
NodePathgetNodePath ()
 
const NodePathgetNodePath () const
 
virtual osg::Vec3 getViewPoint () const
 
virtual float getDistanceFromEyePoint (const Vec3 &, bool) const
 
virtual float getDistanceToViewPoint (const Vec3 &, bool) const
 
virtual void apply (ProxyNode &node)
 
virtual void apply (CoordinateSystemNode &node)
 
virtual void apply (ClipNode &node)
 
virtual void apply (TexGenNode &node)
 
virtual void apply (LightSource &node)
 
virtual void apply (CameraView &node)
 
virtual void apply (MatrixTransform &node)
 
virtual void apply (PositionAttitudeTransform &node)
 
virtual void apply (Switch &node)
 
virtual void apply (Sequence &node)
 
virtual void apply (ClearNode &node)
 
virtual void apply (OccluderNode &node)
 
virtual void apply (OcclusionQueryNode &node)
 
void setDatabaseRequestHandler (DatabaseRequestHandler *handler)
 
DatabaseRequestHandlergetDatabaseRequestHandler ()
 
const DatabaseRequestHandlergetDatabaseRequestHandler () const
 
void setImageRequestHandler (ImageRequestHandler *handler)
 
ImageRequestHandlergetImageRequestHandler ()
 
const ImageRequestHandlergetImageRequestHandler () const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Protected Types

typedef std::list
< osg::ref_ptr< Intersector > > 
IntersectorStack
 
typedef std::list
< osg::ref_ptr< osg::RefMatrix > > 
MatrixStack
 

Protected Member Functions

bool enter (const osg::Node &node)
 
void leave ()
 
void intersect (osg::Drawable *drawable)
 
void push_clone ()
 
void pop_clone ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

IntersectorStack _intersectorStack
 
bool _useKdTreesWhenAvailable
 
bool _dummyTraversal
 
osg::ref_ptr< ReadCallback_readCallback
 
MatrixStack _windowStack
 
MatrixStack _projectionStack
 
MatrixStack _viewStack
 
MatrixStack _modelStack
 
osg::Vec3 _referenceEyePoint
 
Intersector::CoordinateFrame _referenceEyePointCoordinateFrame
 
LODSelectionMode _lodSelectionMode
 
bool _eyePointDirty
 
osg::Vec3 _eyePoint
 
- Protected Attributes inherited from osg::NodeVisitor
VisitorType _visitorType
 
unsigned int _traversalNumber
 
ref_ptr< FrameStamp_frameStamp
 
TraversalMode _traversalMode
 
Node::NodeMask _traversalMask
 
Node::NodeMask _nodeMaskOverride
 
NodePath _nodePath
 
ref_ptr< Referenced_userData
 
ref_ptr< DatabaseRequestHandler_databaseRequestHandler
 
ref_ptr< ImageRequestHandler_imageRequestHandler
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

InteresectionVisitor is used to testing for intersections with the scene, traversing the scene using generic osgUtil::Intersector's to test against the scene. To implement different types of intersection techniques, one implements custom versions of the osgUtil::Intersector, and then pass the constructed intersector to the IntersectionVisitor.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
USE_HIGHEST_LEVEL_OF_DETAIL 
USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION 

Constructor & Destructor Documentation

osgUtil::IntersectionVisitor::IntersectionVisitor ( Intersector intersector = 0,
ReadCallback readCallback = 0 
)

Member Function Documentation

virtual void osgUtil::IntersectionVisitor::apply ( osg::Node node)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Geode geode)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Billboard geode)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Group group)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::LOD lod)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::PagedLOD lod)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Transform transform)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Projection projection)
virtual

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectionVisitor::apply ( osg::Camera camera)
virtual

Reimplemented from osg::NodeVisitor.

bool osgUtil::IntersectionVisitor::enter ( const osg::Node node)
inlineprotected
virtual float osgUtil::IntersectionVisitor::getDistanceToEyePoint ( const osg::Vec3 pos,
bool  withLODScale 
) const
virtual

Get the distance from a point to the eye point, distance value in local coordinate system. This is calculated using the pseudo-EyePoint (above) when doing LOD calculcations.

Reimplemented from osg::NodeVisitor.

bool osgUtil::IntersectionVisitor::getDoDummyTraversal ( ) const
inline
virtual osg::Vec3 osgUtil::IntersectionVisitor::getEyePoint ( ) const
virtual

Get the eye point in the local coordinate frame a given traversal point.

Reimplemented from osg::NodeVisitor.

Intersector* osgUtil::IntersectionVisitor::getIntersector ( )
inline

Get the intersector that will be used to intersect with the scene, and to store any hits that occur.

const Intersector* osgUtil::IntersectionVisitor::getIntersector ( ) const
inline

Get the const intersector that will be used to intersect with the scene, and to store any hits that occur.

LODSelectionMode osgUtil::IntersectionVisitor::getLODSelectionMode ( ) const
inline

Get the LOD selection scheme.

osg::RefMatrix* osgUtil::IntersectionVisitor::getModelMatrix ( )
inline
const osg::RefMatrix* osgUtil::IntersectionVisitor::getModelMatrix ( ) const
inline
osg::RefMatrix* osgUtil::IntersectionVisitor::getProjectionMatrix ( )
inline
const osg::RefMatrix* osgUtil::IntersectionVisitor::getProjectionMatrix ( ) const
inline
ReadCallback* osgUtil::IntersectionVisitor::getReadCallback ( )
inline

Get the read callback.

const ReadCallback* osgUtil::IntersectionVisitor::getReadCallback ( ) const
inline

Get the const read callback.

const osg::Vec3& osgUtil::IntersectionVisitor::getReferenceEyePoint ( ) const
inline

Get the reference eye point.

Intersector::CoordinateFrame osgUtil::IntersectionVisitor::getReferenceEyePointCoordinateFrame ( ) const
inline

Get the coordinate frame of the reference eye point.

bool osgUtil::IntersectionVisitor::getUseKdTreeWhenAvailable ( ) const
inline

Set whether the intersectors should use KdTrees.

osg::RefMatrix* osgUtil::IntersectionVisitor::getViewMatrix ( )
inline
const osg::RefMatrix* osgUtil::IntersectionVisitor::getViewMatrix ( ) const
inline
osg::RefMatrix* osgUtil::IntersectionVisitor::getWindowMatrix ( )
inline
const osg::RefMatrix* osgUtil::IntersectionVisitor::getWindowMatrix ( ) const
inline
void osgUtil::IntersectionVisitor::intersect ( osg::Drawable drawable)
inlineprotected
void osgUtil::IntersectionVisitor::leave ( )
inlineprotected
osgUtil::IntersectionVisitor::META_NodeVisitor ( osgUtil  ,
IntersectionVisitor   
)
void osgUtil::IntersectionVisitor::pop_clone ( )
inlineprotected
void osgUtil::IntersectionVisitor::popModelMatrix ( )
inline
void osgUtil::IntersectionVisitor::popProjectionMatrix ( )
inline
void osgUtil::IntersectionVisitor::popViewMatrix ( )
inline
void osgUtil::IntersectionVisitor::popWindowMatrix ( )
inline
void osgUtil::IntersectionVisitor::push_clone ( )
inlineprotected
void osgUtil::IntersectionVisitor::pushModelMatrix ( osg::RefMatrix matrix)
inline
void osgUtil::IntersectionVisitor::pushProjectionMatrix ( osg::RefMatrix matrix)
inline
void osgUtil::IntersectionVisitor::pushViewMatrix ( osg::RefMatrix matrix)
inline
void osgUtil::IntersectionVisitor::pushWindowMatrix ( osg::RefMatrix matrix)
inline
void osgUtil::IntersectionVisitor::pushWindowMatrix ( osg::Viewport viewport)
inline
void osgUtil::IntersectionVisitor::setDoDummyTraversal ( bool  dummy)
inline
void osgUtil::IntersectionVisitor::setIntersector ( Intersector intersector)

Set the intersector that will be used to intersect with the scene, and to store any hits that occur.

void osgUtil::IntersectionVisitor::setLODSelectionMode ( LODSelectionMode  mode)
inline

Set the LOD selection scheme.

void osgUtil::IntersectionVisitor::setReadCallback ( ReadCallback rc)
inline

Set the read callback.

void osgUtil::IntersectionVisitor::setReferenceEyePoint ( const osg::Vec3 ep)
inline

Set the reference eye point that is used for nodes that require an eye point to position themselves, such as billboards.

void osgUtil::IntersectionVisitor::setReferenceEyePointCoordinateFrame ( Intersector::CoordinateFrame  cf)
inline

Set the coordinate frame of the reference eye point.

void osgUtil::IntersectionVisitor::setUseKdTreeWhenAvailable ( bool  useKdTrees)
inline

Set whether the intersectors should use KdTrees when they are found on the scene graph.

Member Data Documentation

bool osgUtil::IntersectionVisitor::_dummyTraversal
protected
osg::Vec3 osgUtil::IntersectionVisitor::_eyePoint
mutableprotected
bool osgUtil::IntersectionVisitor::_eyePointDirty
mutableprotected
IntersectorStack osgUtil::IntersectionVisitor::_intersectorStack
protected
LODSelectionMode osgUtil::IntersectionVisitor::_lodSelectionMode
protected
MatrixStack osgUtil::IntersectionVisitor::_modelStack
protected
MatrixStack osgUtil::IntersectionVisitor::_projectionStack
protected
osg::ref_ptr<ReadCallback> osgUtil::IntersectionVisitor::_readCallback
protected
osg::Vec3 osgUtil::IntersectionVisitor::_referenceEyePoint
protected
Intersector::CoordinateFrame osgUtil::IntersectionVisitor::_referenceEyePointCoordinateFrame
protected
bool osgUtil::IntersectionVisitor::_useKdTreesWhenAvailable
protected
MatrixStack osgUtil::IntersectionVisitor::_viewStack
protected
MatrixStack osgUtil::IntersectionVisitor::_windowStack
protected

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