Changeset 9377
- Timestamp:
- 12/17/08 13:13:15 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 27 modified
-
include/osg/CollectOccludersVisitor (modified) (1 diff)
-
include/osg/ComputeBoundsVisitor (modified) (1 diff)
-
include/osg/KdTree (modified) (1 diff)
-
include/osg/NodeVisitor (modified) (2 diffs)
-
include/osgAnimation/Bone (modified) (1 diff)
-
include/osgAnimation/LinkVisitor (modified) (1 diff)
-
include/osgAnimation/RigGeometry (modified) (1 diff)
-
include/osgDB/SharedStateManager (modified) (1 diff)
-
include/osgGA/EventVisitor (modified) (1 diff)
-
include/osgSim/InsertImpostorsVisitor (modified) (1 diff)
-
include/osgUtil/CullVisitor (modified) (1 diff)
-
include/osgUtil/DisplayRequirementsVisitor (modified) (1 diff)
-
include/osgUtil/DrawElementTypeSimplifier (modified) (1 diff)
-
include/osgUtil/GLObjectsVisitor (modified) (1 diff)
-
include/osgUtil/IntersectVisitor (modified) (1 diff)
-
include/osgUtil/IntersectionVisitor (modified) (1 diff)
-
include/osgUtil/Simplifier (modified) (1 diff)
-
include/osgUtil/Statistics (modified) (1 diff)
-
include/osgUtil/UpdateVisitor (modified) (1 diff)
-
src/osg/Transform.cpp (modified) (1 diff)
-
src/osgDB/DatabasePager.cpp (modified) (3 diffs)
-
src/osgFX/BumpMapping.cpp (modified) (2 diffs)
-
src/osgGA/NodeTrackerManipulator.cpp (modified) (2 diffs)
-
src/osgManipulator/Selection.cpp (modified) (1 diff)
-
src/osgShadow/OccluderGeometry.cpp (modified) (1 diff)
-
src/osgSim/SphereSegment.cpp (modified) (1 diff)
-
src/osgViewer/View.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/CollectOccludersVisitor
r7648 r9377 31 31 CollectOccludersVisitor(); 32 32 virtual ~CollectOccludersVisitor(); 33 34 META_NodeVisitor("osg","CollectOccludersVisitor") 33 35 34 36 virtual CollectOccludersVisitor* cloneType() const { return new CollectOccludersVisitor(); } -
OpenSceneGraph/trunk/include/osg/ComputeBoundsVisitor
r6225 r9377 27 27 ComputeBoundsVisitor(TraversalMode traversalMode = TRAVERSE_ALL_CHILDREN); 28 28 29 META_NodeVisitor("osg","ComputeBoundsVisitor") 30 29 31 virtual void reset(); 30 32 -
OpenSceneGraph/trunk/include/osg/KdTree
r8607 r9377 176 176 KdTreeBuilder(const KdTreeBuilder& rhs); 177 177 178 META_NodeVisitor("osg","KdTreeBuilder") 179 178 180 virtual KdTreeBuilder* clone() { return new KdTreeBuilder(*this); } 179 181 -
OpenSceneGraph/trunk/include/osg/NodeVisitor
r8990 r9377 43 43 class CameraView; 44 44 45 #define META_NodeVisitor(library,name) \ 46 virtual const char* libraryName() const { return #library; }\ 47 virtual const char* className() const { return #name; } 48 45 49 /** Visitor for type safe operations on osg::Nodes. 46 50 Based on GOF's Visitor pattern. The NodeVisitor … … 83 87 84 88 virtual ~NodeVisitor(); 89 90 /** return the library name/namespapce of the visitor's. Should be defined by derived classes.*/ 91 virtual const char* libraryName() const { return "osg"; } 92 93 /** return the name of the visitor's class type. Should be defined by derived classes.*/ 94 virtual const char* className() const { return "NodeVisitor"; } 85 95 86 96 /** Method to call to reset visitor. Useful if your visitor accumulates -
OpenSceneGraph/trunk/include/osgAnimation/Bone
r9370 r9377 57 57 BoneMapVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} 58 58 59 META_NodeVisitor("osgAnimation","BoneMapVisitor") 60 59 61 void apply(osg::Node& node) { return; } 60 62 void apply(osg::Transform& node) -
OpenSceneGraph/trunk/include/osgAnimation/LinkVisitor
r9121 r9377 27 27 AnimationList _animations; 28 28 unsigned int _nbLinkedTarget; 29 29 30 LinkVisitor(Animation* animation) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) { _animations.push_back(animation); _nbLinkedTarget = 0;} 30 31 LinkVisitor(const AnimationList& animations) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) { _animations = animations; _nbLinkedTarget = 0;} 32 33 META_NodeVisitor("osgAnimation","LinkVisitor") 34 31 35 void apply(osg::Node& node) 32 36 { -
OpenSceneGraph/trunk/include/osgAnimation/RigGeometry
r9370 r9377 78 78 osg::ref_ptr<Skeleton> _root; 79 79 BuildVertexTransformerVisitor(Skeleton* root): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) { _root = root;} 80 81 META_NodeVisitor("osgAnimation","BuildVertexTransformerVisitor") 82 80 83 void apply(osg::Geode& node) 81 84 { -
OpenSceneGraph/trunk/include/osgDB/SharedStateManager
r8523 r9377 49 49 SharedStateManager(unsigned int mode = SHARE_ALL); 50 50 51 META_NodeVisitor("osgDB","SharedStateManager") 52 51 53 void setShareMode(unsigned int mode); 52 54 -
OpenSceneGraph/trunk/include/osgGA/EventVisitor
r5328 r9377 44 44 virtual ~EventVisitor(); 45 45 46 META_NodeVisitor("osgGA","EventVisitor") 46 47 47 48 void setActionAdapter(osgGA::GUIActionAdapter* actionAdapter) { _actionAdapter=actionAdapter; } -
OpenSceneGraph/trunk/include/osgSim/InsertImpostorsVisitor
r5328 r9377 30 30 InsertImpostorsVisitor(); 31 31 32 META_NodeVisitor("osgSim","InsertImpostorsVisitor") 33 32 34 void setImpostorThresholdRatio(float ratio) { _impostorThresholdRatio = ratio; } 33 35 float getImpostorThresholdRatio() const { return _impostorThresholdRatio; } -
OpenSceneGraph/trunk/include/osgUtil/CullVisitor
r8768 r9377 58 58 CullVisitor(const CullVisitor&); 59 59 60 META_NodeVisitor("osgUtil","CullVisitor") 61 60 62 /** Create a shallow copy of the CullVisitor, used by CullVisitor::create() to clone the prototype. */ 61 63 virtual CullVisitor* clone() const { return new CullVisitor(*this); } -
OpenSceneGraph/trunk/include/osgUtil/DisplayRequirementsVisitor
r5328 r9377 37 37 DisplayRequirementsVisitor(); 38 38 39 META_NodeVisitor("osgUtil","DisplayRequirementsVisitor") 39 40 40 41 /** Set the DisplaySettings. */ -
OpenSceneGraph/trunk/include/osgUtil/DrawElementTypeSimplifier
r7769 r9377 33 33 public: 34 34 35 META_NodeVisitor("osgUtil","DrawElementTypeSimplifierVisitor") 36 35 37 void apply(osg::Geode& node); 36 38 }; -
OpenSceneGraph/trunk/include/osgUtil/GLObjectsVisitor
r7171 r9377 52 52 * GL objects. 53 53 */ 54 GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES); 55 56 54 GLObjectsVisitor(Mode mode=COMPILE_DISPLAY_LISTS|COMPILE_STATE_ATTRIBUTES|CHECK_BLACK_LISTED_MODES); 55 56 META_NodeVisitor("osg","GLObjectsVisitor") 57 57 58 virtual void reset() 58 59 { -
OpenSceneGraph/trunk/include/osgUtil/IntersectVisitor
r5940 r9377 103 103 virtual ~IntersectVisitor(); 104 104 105 META_NodeVisitor("osgUtil","IntersectVisitor") 106 105 107 void reset(); 106 108 -
OpenSceneGraph/trunk/include/osgUtil/IntersectionVisitor
r8752 r9377 138 138 IntersectionVisitor(Intersector* intersector=0, ReadCallback* readCallback=0); 139 139 140 META_NodeVisitor("osgUtil","IntersectionVisitor") 141 140 142 virtual void reset(); 141 143 -
OpenSceneGraph/trunk/include/osgUtil/Simplifier
r7720 r9377 31 31 Simplifier(double sampleRatio=1.0, double maximumError=FLT_MAX, double maximumLength=0.0); 32 32 33 META_NodeVisitor("osgUtil","Simplifier") 33 34 34 35 void setSampleRatio(float sampleRatio) { _sampleRatio = sampleRatio; } -
OpenSceneGraph/trunk/include/osgUtil/Statistics
r7601 r9377 168 168 StatsVisitor(); 169 169 170 META_NodeVisitor("osgUtil","StatsVisitor") 171 170 172 void reset(); 171 173 -
OpenSceneGraph/trunk/include/osgUtil/UpdateVisitor
r5328 r9377 42 42 virtual ~UpdateVisitor(); 43 43 44 META_NodeVisitor("osgUtil","UpdateVisitor") 45 44 46 virtual void reset(); 45 47 46 /** During traversal each type of node calls its callbacks and its children traversed. */48 /** During traversal each type of node calls its callbacks and its children traversed. */ 47 49 virtual void apply(osg::Node& node) { handle_callbacks_and_traverse(node); } 48 50 -
OpenSceneGraph/trunk/src/osg/Transform.cpp
r6109 r9377 39 39 _ignoreCameras(ignoreCameras) 40 40 {} 41 42 META_NodeVisitor("osg","TransformVisitor") 41 43 42 44 virtual void apply(Transform& transform) -
OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp
r9352 r9377 129 129 130 130 } 131 132 META_NodeVisitor("osgDB","FindCompileableGLObjectsVisitor") 131 133 132 134 virtual void apply(osg::Node& node) … … 1487 1489 } 1488 1490 1491 META_NodeVisitor("osgDB","FindCompileableGLObjectsVisitor") 1492 1489 1493 virtual void apply(osg::PagedLOD& plod) 1490 1494 { … … 1843 1847 } 1844 1848 1849 META_NodeVisitor("osgDB","FindPagedLODsVisitor") 1850 1845 1851 virtual void apply(osg::PagedLOD& plod) 1846 1852 { -
OpenSceneGraph/trunk/src/osgFX/BumpMapping.cpp
r5187 r9377 31 31 public: 32 32 TsgVisitor(BumpMapping* bm): NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN), _bm(bm) {} 33 34 META_NodeVisitor("osgFX","TsgVisitor") 35 33 36 void apply(osg::Geode& geode) 34 37 { … … 51 54 public: 52 55 TexCoordGenerator(int du, int nu): NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN), du_(du), nu_(nu) {} 56 57 META_NodeVisitor("osgFX","TexCoordGenerator") 58 53 59 void apply(osg::Geode& geode) 54 60 { -
OpenSceneGraph/trunk/src/osgGA/NodeTrackerManipulator.cpp
r8999 r9377 21 21 22 22 23 class CollectParentPaths : public osg::NodeVisitor24 {25 public:26 CollectParentPaths() :27 osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_PARENTS) {}28 29 virtual void apply(osg::Node& node)30 {31 if (node.getNumParents()==0)32 {33 _nodePaths.push_back(getNodePath());34 }35 traverse(node);36 }37 38 osg::NodePath _nodePath;39 typedef std::vector< osg::NodePath > NodePathList;40 NodePathList _nodePaths;41 };42 43 23 NodeTrackerManipulator::NodeTrackerManipulator() 44 24 { … … 121 101 } 122 102 123 CollectParentPaths cpp; 124 node->accept(cpp); 125 126 if (!cpp._nodePaths.empty()) 127 { 103 osg::NodePathList nodePaths = node->getParentalNodePaths(); 104 if (!nodePaths.empty()) 105 { 106 if (nodePaths.size()>1) 107 { 108 osg::notify(osg::NOTICE)<<"osgGA::NodeTrackerManipualtor::setTrackNode(..) taking first parent path, ignoring others."<<std::endl; 109 } 110 128 111 osg::notify(osg::INFO)<<"NodeTrackerManipulator::setTrackNode(Node*"<<node<<" "<<node->getName()<<"): Path set"<<std::endl; 129 112 _trackNodePath.clear(); 130 setTrackNodePath( cpp._nodePaths[0]);113 setTrackNodePath( nodePaths.front() ); 131 114 } 132 115 else -
OpenSceneGraph/trunk/src/osgManipulator/Selection.cpp
r6143 r9377 16 16 #include <osgManipulator/Command> 17 17 18 #include <osg/Notify> 19 18 20 #include <algorithm> 19 21 20 22 using namespace osgManipulator; 21 23 22 class FindNodePathToRootVisitor : public osg::NodeVisitor23 {24 public:25 26 osg::NodePath& _nodePathToRoot;27 28 FindNodePathToRootVisitor(osg::NodePath& np)29 : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_PARENTS),30 _nodePathToRoot(np)31 {}32 33 virtual void apply(osg::Node& node)34 {35 _nodePathToRoot.push_back(&node);36 traverse(node);37 }38 };39 40 24 void osgManipulator::computeNodePathToRoot(osg::Node& node, osg::NodePath& np) 41 25 { 42 26 np.clear(); 43 osg::ref_ptr<FindNodePathToRootVisitor> visitor = new FindNodePathToRootVisitor(np); 44 node.accept(*visitor); 45 np.pop_back(); 46 std::reverse(np.begin(), np.end()); 27 28 osg::NodePathList nodePaths = node.getParentalNodePaths(); 29 30 if (!nodePaths.empty()) 31 { 32 np = nodePaths.front(); 33 if (nodePaths.size()>1) 34 { 35 osg::notify(osg::NOTICE)<<"osgManipulator::computeNodePathToRoot(,) taking first parent path, ignoring others."<<std::endl; 36 } 37 } 47 38 } 48 39 -
OpenSceneGraph/trunk/src/osgShadow/OccluderGeometry.cpp
r7038 r9377 48 48 if (matrix) pushMatrix(*matrix); 49 49 } 50 51 META_NodeVisitor("osgShadow","CollectOccludersVisitor") 50 52 51 53 void apply(osg::Node& node) -
OpenSceneGraph/trunk/src/osgSim/SphereSegment.cpp
r7648 r9377 1015 1015 } 1016 1016 1017 META_NodeVisitor("osgSim","PolytopeVisitor") 1018 1017 1019 void reset() 1018 1020 { -
OpenSceneGraph/trunk/src/osgViewer/View.cpp
r9330 r9377 35 35 NodeVisitor(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN) {} 36 36 37 37 META_NodeVisitor("osgViewer","CollectedCoordinateSystemNodesVisitor") 38 38 39 virtual void apply(osg::Node& node) 39 40 {
