Changeset 13041 for OpenSceneGraph/trunk/include/osg/NodeCallback
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/NodeCallback (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/NodeCallback
r5829 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 26 26 27 27 public : 28 28 29 29 30 30 NodeCallback(){} … … 33 33 _nestedCallback(nc._nestedCallback) {} 34 34 35 35 36 36 META_Object(osg,NodeCallback); 37 38 37 38 39 39 /** Callback method called by the NodeVisitor when visiting a node.*/ 40 40 virtual void operator()(Node* node, NodeVisitor* nv) 41 { 41 { 42 42 // note, callback is responsible for scenegraph traversal so 43 43 // they must call traverse(node,nv) to ensure that the … … 45 45 traverse(node,nv); 46 46 } 47 47 48 48 /** Call any nested callbacks and then traverse the scene graph. */ 49 49 void traverse(Node* node,NodeVisitor* nv); 50 50 51 51 void setNestedCallback(NodeCallback* nc) { _nestedCallback = nc; } 52 52 NodeCallback* getNestedCallback() { return _nestedCallback.get(); } 53 53 const NodeCallback* getNestedCallback() const { return _nestedCallback.get(); } 54 54 55 55 inline void addNestedCallback(NodeCallback* nc) 56 56 { … … 68 68 } 69 69 } 70 70 71 71 inline void removeNestedCallback(NodeCallback* nc) 72 72 { … … 83 83 } 84 84 } 85 85 86 86 public: 87 87 88 88 ref_ptr<NodeCallback> _nestedCallback; 89 89 90 90 protected: 91 91 92 92 virtual ~NodeCallback() {} 93 93 };
