Changeset 11061 for OpenSceneGraph/trunk/include/osg/NodeTrackerCallback
- Timestamp:
- 02/15/10 21:15:32 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/NodeTrackerCallback
r10764 r11061 19 19 #include <osg/Node> 20 20 #include <osg/NodeCallback> 21 #include <osg/ observer_ptr>21 #include <osg/ObserverNodePath> 22 22 23 23 namespace osg … … 28 28 public: 29 29 30 31 typedef std::vector< observer_ptr<Node> > ObserverNodePath; 32 33 void setTrackNodePath(const osg::NodePath& nodePath) 34 { 35 _trackNodePath.clear(); 36 _trackNodePath.reserve(nodePath.size()); 37 std::copy(nodePath.begin(), nodePath.end(), std::back_inserter(_trackNodePath)); 38 } 30 void setTrackNodePath(const osg::NodePath& nodePath) { _trackNodePath.setNodePath(nodePath); } 39 31 40 32 void setTrackNodePath(const ObserverNodePath& nodePath) { _trackNodePath = nodePath; } 33 41 34 ObserverNodePath& getTrackNodePath() { return _trackNodePath; } 42 35 43 36 void setTrackNode(osg::Node* node); 44 osg::Node* getTrackNode() { return _trackNodePath.empty() ? 0 : _trackNodePath.back().get(); }45 const osg::Node* getTrackNode() const { return _trackNodePath.empty() ? 0 : _trackNodePath.back().get(); }37 osg::Node* getTrackNode(); 38 const osg::Node* getTrackNode() const; 46 39 47 40 /** Implements the callback. */ … … 50 43 /** Update the node to track the nodepath.*/ 51 44 void update(osg::Node& node); 52 53 54 bool validateNodePath() const;55 45 56 46 protected:
