gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
GeodeFinder.h
Go to the documentation of this file.
1 #ifndef __GeodeFinder_h
2 #define __GeodeFinder_h
3 
4 
5 #ifdef HAS_OPENSCENEGRAPH
6 #include <osg/NodeVisitor>
7 #include <osg/Transform>
8 #include <osg/Node>
9 #include <osg/Geode>
10 
11 
12 //******************************************************************************
13 // namespace
14 //******************************************************************************
15 namespace gVirtualXRay {
16 
17 
18 class GeodeFinder : public osg::NodeVisitor {
19  public:
20 
21  // Constructor - sets the traversal mode to TRAVERSE_ALL_CHILDREN
22  // and Visitor type to NODE_VISITOR
23  GeodeFinder();
24 
25 
26  // Constructor - sets the traversal mode to TRAVERSE_ALL_CHILDREN
27  // and Visitor type to NODE_VISITOR
28  // See if a className() call to searchNode returns "Geode."
29  // If so, add this node to our list.
30  GeodeFinder(osg::Node &searchNode);
31 
32  // The 'apply' method for 'node' type instances.
33  // See if a className() call to searchNode returns "Geode."
34  // If so, add this node to our list.
35  void apply(osg::Node &searchNode);
36 
37  // Return a pointer to the first node in the list
38  // with a matching name
39  osg::Geode* getFirst();
40 
41  // return a the list of nodes we found
42  std::vector<osg::Geode*>& getNodeList();
43 
44 private:
45  // List of nodes with names that match the searchForName string
46  std::vector<osg::Geode*> m_found_geode_set;
47  std::vector<osg::NodePath*> m_found_geode_path_set;
48 };
49 
50 
51 } // namespace gVirtualXRay
52 
53 #endif
54 
55 
56 #endif // __GeodeFinder_h