14#ifndef OSG_NODEVISITOR
15#define OSG_NODEVISITOR 1
26namespace osgGA {
class EventVisitor; }
44class MultiViewAutoTransform;
63#define META_NodeVisitor(library, name) \
64 virtual const char* libraryName() const { return #library; }\
65 virtual const char* className() const { return #name; }
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
const unsigned int UNINITIALIZED_FRAME_NUMBER
Definition NodeVisitor:61
ValueStack * getOrCreateUserObjectOfType< NodeVisitor, ValueStack >(NodeVisitor *nv)
Definition NodeVisitor:534
std::vector< Node * > NodePath
A vector of Nodes pointers which is used to describe the path from a root node to a descendant.
Definition Node:47
ValueMap * getOrCreateUserObjectOfType< NodeVisitor, ValueMap >(NodeVisitor *nv)
Definition NodeVisitor:540
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
AutoTransform is a derived form of Transform that automatically scales or rotates to keep its childre...
Definition AutoTransform:28
Billboard is a derived form of Geode that orients its osg::Drawable children to face the eye point.
Definition Billboard:27
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
CameraView - is a Transform that is used to specify camera views from within the scene graph.
Definition CameraView:30
A Group node for clearing the color and depth buffers.
Definition ClearNode:31
Node for defining the position of ClipPlanes in the scene.
Definition ClipNode:24
CoordinateSystem encapsulate the coordinate system that is associated with objects in a scene.
Definition CoordinateSystemNode:96
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
A CullStack class which accumulates the current project, modelview matrices and the CullingSet.
Definition CullStack:28
Pure virtual base class for drawable geometry.
Definition Drawable:89
Class which encapsulates the frame number, reference time and calendar time of specific frame,...
Definition FrameStamp:35
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
General group node which maintains a list of children.
Definition Group:29
Leaf Node for defining a light in the scene.
Definition LightSource:25
LOD - Level Of Detail group node which allows switching between children depending on distance from e...
Definition LOD:36
MatrixTransform - is a subclass of Transform which has an osg::Matrix which represents a 4x4 transfor...
Definition MatrixTransform:26
Base class for all internal nodes in the scene graph.
Definition Node:72
virtual void traverse(NodeVisitor &)
Traverse downwards : calls children's accept method with NodeVisitor.
Definition Node:167
NodeMask getNodeMask() const
Get the node Mask.
Definition Node:367
unsigned int NodeMask
This is a set of bits (flags) that represent the Node.
Definition Node:363
virtual void accept(NodeVisitor &nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.
virtual void ascend(NodeVisitor &nv)
Traverse upwards : calls parents' accept method with NodeVisitor.
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
virtual void apply(OcclusionQueryNode &node)
const FrameStamp * getFrameStamp() const
Get the FrameStamp that this traversal is associated with.
Definition NodeVisitor:188
const DatabaseRequestHandler * getDatabaseRequestHandler() const
Get the const handler for database requests.
Definition NodeVisitor:383
ValueStack * getOrCreateValueStack()
Get the ValueStack.
Definition NodeVisitor:263
virtual void apply(MatrixTransform &node)
virtual const osgUtil::IntersectionVisitor * asIntersectionVisitor() const
convert 'const this' into a const osgUtil::IntersectionVisitor pointer if Object is a IntersectionVis...
Definition NodeVisitor:151
void setDatabaseRequestHandler(DatabaseRequestHandler *handler)
Set the handler for database requests.
Definition NodeVisitor:377
virtual void apply(LightSource &node)
virtual void apply(Drawable &drawable)
TraversalMode _traversalMode
Definition NodeVisitor:422
VisitorType getVisitorType() const
Get the VisitorType.
Definition NodeVisitor:176
virtual void apply(Billboard &node)
virtual void apply(Geometry &geometry)
virtual osgUtil::IntersectionVisitor * asIntersectionVisitor()
Convert 'this' into a osgUtil::IntersectionVisitor pointer if Object is a IntersectionVisitor,...
Definition NodeVisitor:147
VisitorType
Definition NodeVisitor:94
@ UPDATE_VISITOR
Definition NodeVisitor:96
@ NODE_VISITOR
Definition NodeVisitor:95
@ EVENT_VISITOR
Definition NodeVisitor:97
@ COLLECT_OCCLUDER_VISITOR
Definition NodeVisitor:98
@ CULL_VISITOR
Definition NodeVisitor:99
@ INTERSECTION_VISITOR
Definition NodeVisitor:100
ImageRequestHandler * getImageRequestHandler()
Get the handler for image requests.
Definition NodeVisitor:408
virtual void apply(AutoTransform &node)
virtual const osgGA::EventVisitor * asEventVisitor() const
convert 'const this' into a const osgGA::EventVisitor pointer if Object is a osgGA::EventVisitor,...
Definition NodeVisitor:143
ValueMap * getOrCreateValueMap()
Get the ValueMap.
Definition NodeVisitor:247
META_Object(osg, NodeVisitor) virtual NodeVisitor *asNodeVisitor()
Convert 'this' into a NodeVisitor pointer if Object is a NodeVisitor, otherwise return 0.
Definition NodeVisitor:111
void setValueMap(ValueMap *ps)
Set the ValueMap used to store Values that can be reused over a series of traversals.
Definition NodeVisitor:238
virtual const osgUtil::CullVisitor * asCullVisitor() const
convert 'const this' into a const osgUtil::CullVisitor pointer if Object is a osgUtil::CullVisitor,...
Definition NodeVisitor:135
virtual const osgUtil::UpdateVisitor * asUpdateVisitor() const
convert 'const this' into a const osgUtil::UpdateVisitor pointer if Object is a osgUtil::UpdateVisito...
Definition NodeVisitor:127
TraversalMode
Definition NodeVisitor:86
@ TRAVERSE_ACTIVE_CHILDREN
Definition NodeVisitor:90
@ TRAVERSE_NONE
Definition NodeVisitor:87
@ TRAVERSE_PARENTS
Definition NodeVisitor:88
@ TRAVERSE_ALL_CHILDREN
Definition NodeVisitor:89
const ValueStack * getValueStack() const
Get the const ValueStack.
Definition NodeVisitor:260
Node::NodeMask _traversalMask
Definition NodeVisitor:423
virtual osgUtil::UpdateVisitor * asUpdateVisitor()
Convert 'this' into a osgUtil::UpdateVisitor pointer if Object is a osgUtil::UpdateVisitor,...
Definition NodeVisitor:123
const ValueMap * getValueMap() const
Get the ValueMap.
Definition NodeVisitor:244
virtual void reset()
Method to call to reset visitor.
Definition NodeVisitor:167
void setTraversalMask(Node::NodeMask mask)
Set the TraversalMask of this NodeVisitor.
Definition NodeVisitor:200
void pushOntoNodePath(Node *node)
Method called by osg::Node::accept() method before a call to the NodeVisitor::apply(....
Definition NodeVisitor:287
const NodePath & getNodePath() const
Get the const NodePath from the top most node applied down to the current Node being visited.
Definition NodeVisitor:301
Node::NodeMask getTraversalMask() const
Get the TraversalMask.
Definition NodeVisitor:203
void setFrameStamp(FrameStamp *fs)
Set the FrameStamp that this traversal is associated with.
Definition NodeVisitor:185
virtual osgGA::EventVisitor * asEventVisitor()
Convert 'this' into a osgGA::EventVisitor pointer if Object is a osgGA::EventVisitor,...
Definition NodeVisitor:139
virtual void apply(ClearNode &node)
ref_ptr< FrameStamp > _frameStamp
Definition NodeVisitor:420
virtual const osg::CullStack * asCullStack() const
convert 'const this' into a const osg::CullStack pointer if Object is a osg::CullStack,...
Definition NodeVisitor:159
virtual void apply(Group &node)
virtual void apply(CameraView &node)
virtual void apply(Camera &node)
virtual float getDistanceToEyePoint(const Vec3 &, bool) const
Get the distance from a point to the eye point, distance value in local coordinate system.
Definition NodeVisitor:314
virtual void apply(PositionAttitudeTransform &node)
TraversalMode getTraversalMode() const
Get the traversal mode.
Definition NodeVisitor:234
void traverse(Node &node)
Method for handling traversal of a nodes.
Definition NodeVisitor:274
NodeVisitor(TraversalMode tm=TRAVERSE_NONE)
Node::NodeMask _nodeMaskOverride
Definition NodeVisitor:424
virtual void apply(Projection &node)
virtual void apply(ProxyNode &node)
void setNodeMaskOverride(Node::NodeMask mask)
Set the NodeMaskOverride mask.
Definition NodeVisitor:210
VisitorType _visitorType
Definition NodeVisitor:417
void setValueStack(ValueStack *ps)
Set the ValueStack used to stack Values during traversal.
Definition NodeVisitor:254
void setTraversalMode(TraversalMode mode)
Set the traversal mode for Node::traverse() to use when deciding which children of a node to traverse...
Definition NodeVisitor:231
NodePath _nodePath
Definition NodeVisitor:426
ref_ptr< ImageRequestHandler > _imageRequestHandler
Definition NodeVisitor:429
virtual void apply(TexGenNode &node)
virtual void apply(Switch &node)
ValueStack * getValueStack()
Get the ValueStack.
Definition NodeVisitor:257
virtual void apply(LOD &node)
NodeVisitor(const NodeVisitor &nv, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual void apply(OccluderNode &node)
virtual osg::Vec3 getViewPoint() const
Get the view point in local coordinates.
Definition NodeVisitor:309
virtual float getDistanceToViewPoint(const Vec3 &, bool) const
Get the distance from a point to the view point, distance value in local coordinate system.
Definition NodeVisitor:324
unsigned int getTraversalNumber() const
Get the traversal number.
Definition NodeVisitor:182
virtual void apply(Node &node)
NodeVisitor(VisitorType type, TraversalMode tm=TRAVERSE_NONE)
virtual void apply(Sequence &node)
virtual void apply(Geode &node)
bool validNodeMask(const osg::Node &node) const
Method to called by Node and its subclass' Node::accept() method, if the result is true it is used to...
Definition NodeVisitor:221
virtual float getDistanceFromEyePoint(const Vec3 &, bool) const
Get the distance of a point from the eye point, distance value in the eye coordinate system.
Definition NodeVisitor:319
osg::ref_ptr< ValueStack > _valueStack
Definition NodeVisitor:432
void setVisitorType(VisitorType type)
Set the VisitorType, used to distinguish different visitors during traversal of the scene,...
Definition NodeVisitor:173
const ImageRequestHandler * getImageRequestHandler() const
Get the const handler for image requests.
Definition NodeVisitor:411
virtual osg::CullStack * asCullStack()
Convert 'this' into a osg::CullStack pointer if Object is a osg::CullStack, otherwise return 0.
Definition NodeVisitor:155
ValueMap * getValueMap()
Get the ValueMap.
Definition NodeVisitor:241
ref_ptr< DatabaseRequestHandler > _databaseRequestHandler
Definition NodeVisitor:428
unsigned int _traversalNumber
Definition NodeVisitor:418
NodePath & getNodePath()
Get the non const NodePath from the top most node applied down to the current Node being visited.
Definition NodeVisitor:297
DatabaseRequestHandler * getDatabaseRequestHandler()
Get the handler for database requests.
Definition NodeVisitor:380
virtual void apply(CoordinateSystemNode &node)
Node::NodeMask getNodeMaskOverride() const
Get the NodeMaskOverride mask.
Definition NodeVisitor:213
void setImageRequestHandler(ImageRequestHandler *handler)
Set the handler for image requests.
Definition NodeVisitor:405
osg::ref_ptr< ValueMap > _valueMap
Definition NodeVisitor:431
void setTraversalNumber(unsigned int fn)
Set the traversal number.
Definition NodeVisitor:179
void popFromNodePath()
Method called by osg::Node::accept() method after a call to NodeVisitor::apply(..).
Definition NodeVisitor:293
virtual osg::Vec3 getEyePoint() const
Get the eye point in local coordinates.
Definition NodeVisitor:305
virtual void apply(PagedLOD &node)
virtual void apply(Transform &node)
virtual void apply(ClipNode &node)
virtual const NodeVisitor * asNodeVisitor() const
convert 'const this' into a const NodeVisitor pointer if Object is a NodeVisitor, otherwise return 0.
Definition NodeVisitor:119
virtual osgUtil::CullVisitor * asCullVisitor()
Convert 'this' into a osgUtil::CullVisitor pointer if Object is a osgUtil::CullVisitor,...
Definition NodeVisitor:131
Callback for managing database paging, such as generated by PagedLOD nodes.
Definition NodeVisitor:364
virtual void requestNodeFile(const std::string &fileName, osg::NodePath &nodePath, float priority, const FrameStamp *framestamp, osg::ref_ptr< osg::Referenced > &databaseRequest, const osg::Referenced *options=0)=0
virtual ~DatabaseRequestHandler()
Definition NodeVisitor:373
DatabaseRequestHandler()
Definition NodeVisitor:367
Callback for managing image paging, such as generated by PagedLOD nodes.
Definition NodeVisitor:388
virtual void requestImageFile(const std::string &fileName, osg::Object *attachmentPoint, int attachmentIndex, double timeToMergeBy, const FrameStamp *framestamp, osg::ref_ptr< osg::Referenced > &imageRequest, const osg::Referenced *options=0)=0
virtual ~ImageRequestHandler()
Definition NodeVisitor:401
ImageRequestHandler()
Definition NodeVisitor:391
virtual osg::ref_ptr< osg::Image > readRefImageFile(const std::string &fileName, const osg::Referenced *options=0)=0
virtual double getPreLoadTime() const =0
NodeAcceptOp(const NodeAcceptOp &naop)
Definition NodeVisitor:442
NodeAcceptOp & operator=(const NodeAcceptOp &)
Definition NodeVisitor:449
void operator()(Node *node)
Definition NodeVisitor:444
NodeVisitor & _nv
Definition NodeVisitor:451
NodeAcceptOp(NodeVisitor &nv)
Definition NodeVisitor:441
ValueStack * _valueStack
Definition NodeVisitor:489
const Referenced * _key
Definition NodeVisitor:490
~PushPopObject()
Definition NodeVisitor:483
PushPopObject(NodeVisitor *nv, const Referenced *key, Object *value)
Definition NodeVisitor:460
PushPopObject(ValueStack *valueStack, const Referenced *key, Object *value)
Definition NodeVisitor:472
~PushPopValue()
Definition NodeVisitor:523
ValueStack * _valueStack
Definition NodeVisitor:529
const Referenced * _key
Definition NodeVisitor:530
PushPopValue(ValueStack *valueStack, const Referenced *key, const T &value)
Definition NodeVisitor:512
PushPopValue(NodeVisitor *nv, const Referenced *key, const T &value)
Definition NodeVisitor:499
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
OccluderNode is a Group node which provides hooks for adding ConvexPlanarOccluders to the scene.
Definition OccluderNode:27
Definition OcclusionQueryNode:110
PagedLOD.
Definition PagedLOD:24
PositionAttitudeTransform - is a Transform.
Definition PositionAttitudeTransform:29
Projection nodes set up the frustum/orthographic projection used when rendering the scene.
Definition Projection:25
ProxyNode.
Definition ProxyNode:24
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Sequence is a Group node which allows automatic, time based switching between children.
Definition Sequence:26
Switch is a Group node that allows switching between children.
Definition Switch:27
Node for defining the position of TexGen in the scene.
Definition TexGenNode:24
A Transform is a group node for which all children are transformed by a 4x4 matrix.
Definition Transform:75
Basic EventVisitor implementation for animating a scene.
Definition EventVisitor:42
Basic NodeVisitor implementation for rendering a scene.
Definition CullVisitor:49
IntersectionVisitor is used to testing for intersections with the scene, traversing the scene using g...
Definition IntersectionVisitor:152
Basic UpdateVisitor implementation for animating a scene.
Definition UpdateVisitor:38
#define OSG_EXPORT
Definition Export:39