openscenegraph
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgUtil::IntersectVisitor Class Reference

#include <IntersectVisitor>

Inheritance diagram for osgUtil::IntersectVisitor:
osg::NodeVisitor osg::Object osg::Referenced osgUtil::PickVisitor

Classes

class  IntersectState
 

Public Types

enum  LODSelectionMode { USE_HIGHEST_LEVEL_OF_DETAIL , USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION }
 
typedef std::vector< HitHitList
 
typedef std::map< const osg::LineSegment *, HitListLineSegmentHitListMap
 
- 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

 IntersectVisitor ()
 
virtual ~IntersectVisitor ()
 
 META_NodeVisitor (osgUtil, IntersectVisitor) void reset()
 
void addLineSegment (osg::LineSegment *seg)
 
HitListgetHitList (const osg::LineSegment *seg)
 
int getNumHits (const osg::LineSegment *seg)
 
LineSegmentHitListMapgetSegHitList ()
 
bool hits ()
 
void setLODSelectionMode (LODSelectionMode mode)
 
LODSelectionMode getLODSelectionMode () const
 
void setEyePoint (const osg::Vec3 &eye)
 
virtual osg::Vec3 getEyePoint () const
 
virtual float getDistanceToEyePoint (const osg::Vec3 &pos, bool withLODScale) const
 
virtual void apply (osg::Node &)
 
virtual void apply (osg::Drawable &)
 
virtual void apply (osg::Geode &node)
 
virtual void apply (osg::Billboard &node)
 
virtual void apply (osg::Group &node)
 
virtual void apply (osg::Transform &node)
 
virtual void apply (osg::Switch &node)
 
virtual void apply (osg::LOD &node)
 
- 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 osgUtil::UpdateVisitorasUpdateVisitor ()
 
virtual const osgUtil::UpdateVisitorasUpdateVisitor () const
 
virtual osgUtil::CullVisitorasCullVisitor ()
 
virtual const osgUtil::CullVisitorasCullVisitor () const
 
virtual osgGA::EventVisitorasEventVisitor ()
 
virtual const osgGA::EventVisitorasEventVisitor () const
 
virtual osgUtil::IntersectionVisitorasIntersectionVisitor ()
 
virtual const osgUtil::IntersectionVisitorasIntersectionVisitor () const
 
virtual osg::CullStackasCullStack ()
 
virtual const osg::CullStackasCullStack () 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 setValueMap (ValueMap *ps)
 
ValueMapgetValueMap ()
 
const ValueMapgetValueMap () const
 
ValueMapgetOrCreateValueMap ()
 
void setValueStack (ValueStack *ps)
 
ValueStackgetValueStack ()
 
const ValueStackgetValueStack () const
 
ValueStackgetOrCreateValueStack ()
 
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 (Projection &node)
 
virtual void apply (CoordinateSystemNode &node)
 
virtual void apply (ClipNode &node)
 
virtual void apply (TexGenNode &node)
 
virtual void apply (LightSource &node)
 
virtual void apply (Camera &node)
 
virtual void apply (CameraView &node)
 
virtual void apply (MatrixTransform &node)
 
virtual void apply (PositionAttitudeTransform &node)
 
virtual void apply (AutoTransform &node)
 
virtual void apply (Sequence &node)
 
virtual void apply (PagedLOD &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 StateSetasStateSet ()
 
virtual const StateSetasStateSet () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () const
 
virtual CameraasCamera ()
 
virtual const CameraasCamera () const
 
virtual DrawableasDrawable ()
 
virtual const DrawableasDrawable () const
 
virtual CallbackasCallback ()
 
virtual const CallbackasCallback () const
 
virtual CallbackObjectasCallbackObject ()
 
virtual const CallbackObjectasCallbackObject () const
 
virtual UserDataContainerasUserDataContainer ()
 
virtual const UserDataContainerasUserDataContainer () const
 
virtual ValueObjectasValueObject ()
 
virtual const ValueObjectasValueObject () const
 
virtual ImageasImage ()
 
virtual const ImageasImage () 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)
 
template<class T >
void setUserDataContainer (const ref_ptr< T > &udc)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
template<class T >
void setUserData (const ref_ptr< T > &ud)
 
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::vector< osg::ref_ptr< IntersectState > > IntersectStateStack
 

Protected Member Functions

bool intersect (osg::Drawable &gset)
 
void pushMatrix (osg::RefMatrix *matrix, osg::Transform::ReferenceFrame rf)
 
void popMatrix ()
 
bool enterNode (osg::Node &node)
 
void leaveNode ()
 
- 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

IntersectStateStack _intersectStateStack
 
LineSegmentHitListMap _segHitList
 
LODSelectionMode _lodSelectionMode
 
osg::Vec3 _pseudoEyePoint
 
- 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
 
osg::ref_ptr< ValueMap_valueMap
 
osg::ref_ptr< ValueStack_valueStack
 
- 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 setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

Deprecated - use IntersectionVisitor instead.

Member Typedef Documentation

◆ HitList

◆ IntersectStateStack

◆ LineSegmentHitListMap

Member Enumeration Documentation

◆ LODSelectionMode

Enumerator
USE_HIGHEST_LEVEL_OF_DETAIL 
USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION 

Constructor & Destructor Documentation

◆ IntersectVisitor()

osgUtil::IntersectVisitor::IntersectVisitor ( )

◆ ~IntersectVisitor()

virtual osgUtil::IntersectVisitor::~IntersectVisitor ( )
virtual

Member Function Documentation

◆ addLineSegment()

void osgUtil::IntersectVisitor::addLineSegment ( osg::LineSegment seg)

Add a line segment to use for intersection testing during scene traversal. Note, a maximum of 32 line segments can be added to a IntersectVistor, adding more than this will result in warning being emitted to the console and the excess segments being ignored.

◆ apply() [1/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Billboard node)
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [2/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Drawable )
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [3/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Geode node)
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [4/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Group node)
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [5/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::LOD node)
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [6/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Node )
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [7/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Switch node)
virtual

Reimplemented from osg::NodeVisitor.

◆ apply() [8/8]

virtual void osgUtil::IntersectVisitor::apply ( osg::Transform node)
virtual

Reimplemented from osg::NodeVisitor.

◆ enterNode()

bool osgUtil::IntersectVisitor::enterNode ( osg::Node node)
protected

◆ getDistanceToEyePoint()

virtual float osgUtil::IntersectVisitor::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.

◆ getEyePoint()

virtual osg::Vec3 osgUtil::IntersectVisitor::getEyePoint ( ) const
virtual

Get the eye point in local coordinates. Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.

Reimplemented from osg::NodeVisitor.

◆ getHitList()

HitList & osgUtil::IntersectVisitor::getHitList ( const osg::LineSegment seg)
inline

◆ getLODSelectionMode()

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

◆ getNumHits()

int osgUtil::IntersectVisitor::getNumHits ( const osg::LineSegment seg)
inline

◆ getSegHitList()

LineSegmentHitListMap & osgUtil::IntersectVisitor::getSegHitList ( )
inline

◆ hits()

bool osgUtil::IntersectVisitor::hits ( )

◆ intersect()

bool osgUtil::IntersectVisitor::intersect ( osg::Drawable gset)
protected

◆ leaveNode()

void osgUtil::IntersectVisitor::leaveNode ( )
protected

◆ META_NodeVisitor()

osgUtil::IntersectVisitor::META_NodeVisitor ( osgUtil  ,
IntersectVisitor   
)

◆ popMatrix()

void osgUtil::IntersectVisitor::popMatrix ( )
protected

◆ pushMatrix()

void osgUtil::IntersectVisitor::pushMatrix ( osg::RefMatrix matrix,
osg::Transform::ReferenceFrame  rf 
)
protected

◆ setEyePoint()

void osgUtil::IntersectVisitor::setEyePoint ( const osg::Vec3 eye)
inline

Set the eye point in local coordinates. This is a pseudo-EyePoint for billboarding and LOD purposes. It is copied from the Start point of the most-recently-added segment of the intersection ray set (IntersectState::_segList).

◆ setLODSelectionMode()

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

Member Data Documentation

◆ _intersectStateStack

IntersectStateStack osgUtil::IntersectVisitor::_intersectStateStack
protected

◆ _lodSelectionMode

LODSelectionMode osgUtil::IntersectVisitor::_lodSelectionMode
protected

◆ _pseudoEyePoint

osg::Vec3 osgUtil::IntersectVisitor::_pseudoEyePoint
protected

◆ _segHitList

LineSegmentHitListMap osgUtil::IntersectVisitor::_segHitList
protected

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