Added s/getEventCallback support into osg::Node, and an EVENT_VISITOR

type into NodeVisitor.
This commit is contained in:
Robert Osfield
2004-10-24 13:51:44 +00:00
parent 052b256267
commit 63e4587a88
4 changed files with 149 additions and 10 deletions

View File

@@ -140,6 +140,20 @@ class SG_EXPORT Node : public Object
inline unsigned int getNumChildrenRequiringUpdateTraversal() const { return _numChildrenRequiringUpdateTraversal; }
/** Set update node callback, called during update traversal. */
void setEventCallback(NodeCallback* nc);
/** Get update node callback, called during update traversal. */
inline NodeCallback* getEventCallback() { return _eventCallback.get(); }
/** Get const update node callback, called during update traversal. */
inline const NodeCallback* getEventCallback() const { return _eventCallback.get(); }
/** Get the number of Children of this node which require App traversal,
* since they have an AppCallback attached to them or their children.*/
inline unsigned int getNumChildrenRequiringEventTraversal() const { return _numChildrenRequiringEventTraversal; }
/** Set cull node callback, called during cull traversal. */
void setCullCallback(NodeCallback* nc) { _cullCallback = nc; }
@@ -259,6 +273,10 @@ class SG_EXPORT Node : public Object
unsigned int _numChildrenRequiringUpdateTraversal;
void setNumChildrenRequiringUpdateTraversal(unsigned int num);
ref_ptr<NodeCallback> _eventCallback;
unsigned int _numChildrenRequiringEventTraversal;
void setNumChildrenRequiringEventTraversal(unsigned int num);
ref_ptr<NodeCallback> _cullCallback;
bool _cullingActive;

View File

@@ -69,6 +69,7 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
{
NODE_VISITOR = 0,
UPDATE_VISITOR,
EVENT_VISITOR,
COLLECT_OCCLUDER_VISITOR,
CULL_VISITOR
};