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

#include <IntersectionVisitor.h>

Inheritance diagram for osgUtil::IntersectionVisitor:
Inheritance graph
[legend]
Collaboration diagram for osgUtil::IntersectionVisitor:
Collaboration graph
[legend]

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, INTERSECTION_VISITOR
}
 
- Public Types inherited from osg::Object
enum  DataVariance { DYNAMIC, STATIC, UNSPECIFIED }
 

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::Drawable &drawable)
 
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)
 
 NodeVisitor (const NodeVisitor &nv, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
virtual ~NodeVisitor ()
 
 META_Object (osg, NodeVisitor) virtual NodeVisitor *asNodeVisitor()
 
virtual const NodeVisitorasNodeVisitor () 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 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 (Geometry &geometry)
 
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::Object
 Object ()
 
 Object (bool threadSafeRefUnref)
 
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
virtual ObjectcloneType () const =0
 
virtual Objectclone (const CopyOp &) const =0
 
virtual bool isSameKindAs (const Object *) const
 
virtual const char * libraryName () const =0
 
virtual const char * className () const =0
 
std::string getCompoundClassName () const
 
virtual NodeasNode ()
 
virtual const NodeasNode () const
 
virtual NodeVisitorasNodeVisitor ()
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () const
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
virtual void setName (const std::string &name)
 
void setName (const char *name)
 
const std::string & getName () const
 
void setDataVariance (DataVariance dv)
 
DataVariance getDataVariance () const
 
virtual void computeDataVariance ()
 
void setUserDataContainer (osg::UserDataContainer *udc)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () const
 
template<typename T >
bool getUserValue (const std::string &name, T &value) const
 
template<typename T >
void setUserValue (const std::string &name, const T &value)
 
virtual void resizeGLObjectBuffers (unsigned int)
 
virtual void releaseGLObjects (osg::State *=0) const
 
template<typename T >
BoolValueObject
UCharValueObject
UShortValueObject
UIntValueObject
DoubleValueObject
Vec3fValueObject
Vec2dValueObject
Vec4dValueObject
PlaneValueObject
MatrixdValueObject
BoundingBoxdValueObject
BoundingSpheredValueObject
bool 
getUserValue (const std::string &name, T &value) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
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::Object
virtual ~Object ()
 
- 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< DatabaseRequestHandler_databaseRequestHandler
 
ref_ptr< ImageRequestHandler_imageRequestHandler
 
- Protected Attributes inherited from osg::Object
std::string _name
 
DataVariance _dataVariance
 
osg::UserDataContainer_userDataContainer
 
- 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

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

Definition at line 152 of file IntersectionVisitor.h.

Member Typedef Documentation

Definition at line 279 of file IntersectionVisitor.h.

Definition at line 287 of file IntersectionVisitor.h.

Member Enumeration Documentation

Enumerator
USE_HIGHEST_LEVEL_OF_DETAIL 
USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION 

Definition at line 242 of file IntersectionVisitor.h.

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::Drawable drawable)
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

Definition at line 273 of file IntersectionVisitor.h.

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

Definition at line 191 of file IntersectionVisitor.h.

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.

Definition at line 178 of file IntersectionVisitor.h.

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.

Definition at line 181 of file IntersectionVisitor.h.

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

Get the LOD selection scheme.

Definition at line 252 of file IntersectionVisitor.h.

osg::RefMatrix* osgUtil::IntersectionVisitor::getModelMatrix ( )
inline

Definition at line 222 of file IntersectionVisitor.h.

const osg::RefMatrix* osgUtil::IntersectionVisitor::getModelMatrix ( ) const
inline

Definition at line 223 of file IntersectionVisitor.h.

osg::RefMatrix* osgUtil::IntersectionVisitor::getProjectionMatrix ( )
inline

Definition at line 212 of file IntersectionVisitor.h.

const osg::RefMatrix* osgUtil::IntersectionVisitor::getProjectionMatrix ( ) const
inline

Definition at line 213 of file IntersectionVisitor.h.

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

Get the read callback.

Definition at line 198 of file IntersectionVisitor.h.

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

Get the const read callback.

Definition at line 201 of file IntersectionVisitor.h.

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

Get the reference eye point.

Definition at line 230 of file IntersectionVisitor.h.

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

Get the coordinate frame of the reference eye point.

Definition at line 236 of file IntersectionVisitor.h.

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

Set whether the intersectors should use KdTrees.

Definition at line 188 of file IntersectionVisitor.h.

osg::RefMatrix* osgUtil::IntersectionVisitor::getViewMatrix ( )
inline

Definition at line 217 of file IntersectionVisitor.h.

const osg::RefMatrix* osgUtil::IntersectionVisitor::getViewMatrix ( ) const
inline

Definition at line 218 of file IntersectionVisitor.h.

osg::RefMatrix* osgUtil::IntersectionVisitor::getWindowMatrix ( )
inline

Definition at line 207 of file IntersectionVisitor.h.

const osg::RefMatrix* osgUtil::IntersectionVisitor::getWindowMatrix ( ) const
inline

Definition at line 208 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::intersect ( osg::Drawable drawable)
inlineprotected

Definition at line 275 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::leave ( )
inlineprotected

Definition at line 274 of file IntersectionVisitor.h.

osgUtil::IntersectionVisitor::META_NodeVisitor ( osgUtil  ,
IntersectionVisitor   
)
void osgUtil::IntersectionVisitor::pop_clone ( )
inlineprotected

Definition at line 277 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::popModelMatrix ( )
inline

Definition at line 221 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::popProjectionMatrix ( )
inline

Definition at line 211 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::popViewMatrix ( )
inline

Definition at line 216 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::popWindowMatrix ( )
inline

Definition at line 206 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::push_clone ( )
inlineprotected

Definition at line 276 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::pushModelMatrix ( osg::RefMatrix matrix)
inline

Definition at line 220 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::pushProjectionMatrix ( osg::RefMatrix matrix)
inline

Definition at line 210 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::pushViewMatrix ( osg::RefMatrix matrix)
inline

Definition at line 215 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::pushWindowMatrix ( osg::RefMatrix matrix)
inline

Definition at line 204 of file IntersectionVisitor.h.

void osgUtil::IntersectionVisitor::pushWindowMatrix ( osg::Viewport viewport)
inline

Definition at line 205 of file IntersectionVisitor.h.

Here is the call graph for this function:

void osgUtil::IntersectionVisitor::setDoDummyTraversal ( bool  dummy)
inline

Definition at line 190 of file IntersectionVisitor.h.

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.

Definition at line 249 of file IntersectionVisitor.h.

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

Set the read callback.

Definition at line 195 of file IntersectionVisitor.h.

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.

Definition at line 227 of file IntersectionVisitor.h.

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

Set the coordinate frame of the reference eye point.

Definition at line 233 of file IntersectionVisitor.h.

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

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

Definition at line 185 of file IntersectionVisitor.h.

Member Data Documentation

bool osgUtil::IntersectionVisitor::_dummyTraversal
protected

Definition at line 283 of file IntersectionVisitor.h.

osg::Vec3 osgUtil::IntersectionVisitor::_eyePoint
mutableprotected

Definition at line 298 of file IntersectionVisitor.h.

bool osgUtil::IntersectionVisitor::_eyePointDirty
mutableprotected

Definition at line 297 of file IntersectionVisitor.h.

IntersectorStack osgUtil::IntersectionVisitor::_intersectorStack
protected

Definition at line 280 of file IntersectionVisitor.h.

LODSelectionMode osgUtil::IntersectionVisitor::_lodSelectionMode
protected

Definition at line 295 of file IntersectionVisitor.h.

MatrixStack osgUtil::IntersectionVisitor::_modelStack
protected

Definition at line 291 of file IntersectionVisitor.h.

MatrixStack osgUtil::IntersectionVisitor::_projectionStack
protected

Definition at line 289 of file IntersectionVisitor.h.

osg::ref_ptr<ReadCallback> osgUtil::IntersectionVisitor::_readCallback
protected

Definition at line 285 of file IntersectionVisitor.h.

osg::Vec3 osgUtil::IntersectionVisitor::_referenceEyePoint
protected

Definition at line 293 of file IntersectionVisitor.h.

Intersector::CoordinateFrame osgUtil::IntersectionVisitor::_referenceEyePointCoordinateFrame
protected

Definition at line 294 of file IntersectionVisitor.h.

bool osgUtil::IntersectionVisitor::_useKdTreesWhenAvailable
protected

Definition at line 282 of file IntersectionVisitor.h.

MatrixStack osgUtil::IntersectionVisitor::_viewStack
protected

Definition at line 290 of file IntersectionVisitor.h.

MatrixStack osgUtil::IntersectionVisitor::_windowStack
protected

Definition at line 288 of file IntersectionVisitor.h.


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