OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
visitor.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_SCENEUTIL_VISITOR_H
2 #define OPENMW_COMPONENTS_SCENEUTIL_VISITOR_H
3 
4 #include <osg/NodeVisitor>
5 
6 // Commonly used scene graph visitors
7 namespace SceneUtil
8 {
9 
10  // Find a Group by name, case-insensitive
11  // If not found, mFoundNode will be NULL
12  class FindByNameVisitor : public osg::NodeVisitor
13  {
14  public:
15  FindByNameVisitor(const std::string& nameToFind)
16  : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
17  , mNameToFind(nameToFind)
18  , mFoundNode(NULL)
19  {
20  }
21 
22  virtual void apply(osg::Group& group);
23 
24  std::string mNameToFind;
25  osg::Group* mFoundNode;
26  };
27 
28  // Disable freezeOnCull for all visited particlesystems
29  class DisableFreezeOnCullVisitor : public osg::NodeVisitor
30  {
31  public:
33  : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
34  {
35  }
36 
37  virtual void apply(osg::Drawable& drw);
38  };
39 
40 }
41 
42 #endif
Definition: visitor.hpp:12
FindByNameVisitor(const std::string &nameToFind)
Definition: visitor.hpp:15
Definition: visitor.hpp:29
virtual void apply(osg::Group &group)
Definition: visitor.cpp:10
osg::Group * mFoundNode
Definition: visitor.hpp:25
std::string mNameToFind
Definition: visitor.hpp:24
virtual void apply(osg::Drawable &drw)
Definition: visitor.cpp:20
DisableFreezeOnCullVisitor()
Definition: visitor.hpp:32