Point Cloud Library (PCL)  1.9.1-dev
object.h
1 #pragma once
2 
3 // C++
4 #include <map>
5 #include <mutex>
6 #include <set>
7 #include <string>
8 
9 // VTK
10 #include <vtkActor.h>
11 #include <vtkActorCollection.h>
12 #include <vtkRenderer.h>
13 #include <vtkSmartPointer.h>
14 
15 //Forward Declaration
16 class Scene;
17 
18 class Object
19 {
20 public:
21 
22  // Operators
23  // -----------------------------------------------------------------------------
24  Object (std::string name);
25 
26  virtual
27  ~Object () { }
28 
29 
30  // Accessors
31  // -----------------------------------------------------------------------------
32  std::string
33  getName () const;
34 
35  void
36  setName (std::string name);
37 
38  virtual void
39  render (vtkRenderer* renderer);
40 
41  bool
42  hasActor (vtkActor *actor);
43 
44  void
45  addActor (vtkActor *actor);
46 
47  void
48  removeActor (vtkActor *actor);
49 
51  getActors ();
52 
53 protected:
55  std::mutex actors_mutex_;
56 
57 private:
58 
59  // Members
60  // -----------------------------------------------------------------------------
61  std::string name_;
62  std::map<vtkActor*, std::set<vtkRenderer*> > associated_renderers_;
63 
64 };
std::string getName() const
bool hasActor(vtkActor *actor)
std::mutex actors_mutex_
Definition: object.h:55
virtual void render(vtkRenderer *renderer)
vtkSmartPointer< vtkActorCollection > getActors()
Definition: scene.h:11
void addActor(vtkActor *actor)
void removeActor(vtkActor *actor)
Object(std::string name)
Definition: object.h:18
virtual ~Object()
Definition: object.h:27
void setName(std::string name)
vtkSmartPointer< vtkActorCollection > actors_
Definition: object.h:54