Point Cloud Library (PCL)  1.14.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 () = default;
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 
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 };
Definition: object.h:19
virtual ~Object()=default
void removeActor(vtkActor *actor)
virtual void render(vtkRenderer *renderer)
std::mutex actors_mutex_
Definition: object.h:55
void addActor(vtkActor *actor)
vtkSmartPointer< vtkActorCollection > getActors()
bool hasActor(vtkActor *actor)
std::string getName() const
vtkSmartPointer< vtkActorCollection > actors_
Definition: object.h:54
Object(std::string name)
void setName(std::string name)
Definition: scene.h:12