V-ART
collector.h
Go to the documentation of this file.
1 
5 // This is a template class. There is no implementation file.
6 
7 
8 #ifndef VART_COLLECTOR_H
9 #define VART_COLLECTOR_H
10 
11 #include "vart/snoperator.h"
12 #include "vart/scenenode.h"
13 #include <list>
14 #include <iterator>
15 
16 namespace VART {
22  template<class T>
23  class Collector : public SNOperator, public std::list<const T*>
24  {
25  public:
26  // PUBLIC STATIC METHODS
27  // PUBLIC METHODS
28  Collector() {};
29  virtual ~Collector() {}
30  virtual void OperateOn(const SceneNode* nodePtr);
31  protected:
32  // PROTECTED STATIC METHODS
33  // PROTECTED METHODS
34  // PROTECTED STATIC ATTRIBUTES
35  // PROTECTED ATTRIBUTES
36  }; // end class declaration
37 } // end namespace
38 
39 template <class T>
41 {
42  const T* castPtr = dynamic_cast<const T*>(nodePtr);
43  if (castPtr)
44  push_back(castPtr);
45 }
46 
47 #endif
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
virtual ~Collector()
Definition: collector.h:29
Header file for V-ART class "SceneNode".
Objects that process scene nodes.
Definition: snoperator.h:19
Header file for V-ART class "SnOperator".
A scene node operator that collects nodes of some kind.
Definition: collector.h:23
virtual void OperateOn(const SceneNode *nodePtr)
Definition: collector.h:40