Point Cloud Library (PCL)  1.14.1-dev
scene.h
1 #pragma once
2 
3 // PCL
4 #include "camera.h"
5 #include "object.h"
6 #include "outofcore_cloud.h"
7 #include "viewport.h"
8 
9 class Object;
10 
11 class Scene
12 {
13 private:
14 
15  static Scene *instance_;
16 
17 
18 public:
19 
20  Scene ();
21  Scene (const Scene& op) = delete;
22  Scene&
23  operator= (const Scene& op) = delete;
24 
25  // Singleton
26  static Scene*
28  {
29  if (!Scene::instance_)
30  Scene::instance_ = new Scene ();
31 
32  return Scene::instance_;
33  }
34 
35  // Accessors - Cameras
36  // -----------------------------------------------------------------------------
37  void
38  addCamera (Camera *camera);
39 
40  std::vector<Camera*>
42 
43  Camera*
44  getCamera (vtkCamera *camera);
45 
46  Camera*
47  getCamera (const std::string& name);
48 
49  // Accessors - Objects
50  // -----------------------------------------------------------------------------
51  void
52  addObject (Object *object);
53 
54  Object*
55  getObjectByName (const std::string& name);
56 
57  std::vector<Object*>
59 
60  // Accessors - Viewports
61  // -----------------------------------------------------------------------------
62 
63  void
64  addViewport (Viewport *viewport);
65 
66  std::vector<Viewport*>
68 
69  void
70  lock ()
71  {
72  render_mutex_.lock ();
73  }
74 
75  void
76  unlock ()
77  {
78  render_mutex_.unlock ();
79  }
80 
81 private:
82  std::vector<Camera*> cameras_;
83  std::vector<Viewport*> viewports_;
84  std::vector<Object*> objects_;
85 
86  std::mutex render_mutex_;
87 
88 };
Definition: camera.h:21
Definition: object.h:19
Definition: scene.h:12
void lock()
Definition: scene.h:70
Camera * getCamera(const std::string &name)
Object * getObjectByName(const std::string &name)
std::vector< Object * > getObjects()
void addViewport(Viewport *viewport)
void addCamera(Camera *camera)
void addObject(Object *object)
std::vector< Viewport * > getViewports()
void unlock()
Definition: scene.h:76
Scene(const Scene &op)=delete
static Scene * instance()
Definition: scene.h:27
std::vector< Camera * > getCameras()
Camera * getCamera(vtkCamera *camera)
Scene & operator=(const Scene &op)=delete