Point Cloud Library (PCL)  1.7.1
scene.h
1 #ifndef PCL_OUTOFCORE_SCENE_H_
2 #define PCL_OUTOFCORE_SCENE_H_
3 
4 // PCL
5 #include "camera.h"
6 #include "object.h"
7 #include "outofcore_cloud.h"
8 #include "viewport.h"
9 
10 class Object;
11 
12 class Scene
13 {
14 private:
15 
16  static Scene *instance_;
17 
18  Scene ();
19  Scene (const Scene& op);
20  Scene&
21  operator= (const Scene& op);
22 
23 public:
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*>
41  getCameras ();
42 
43  Camera*
44  getCamera (vtkCamera *camera);
45 
46  Camera*
47  getCamera (std::string name);
48 
49  // Accessors - Objects
50  // -----------------------------------------------------------------------------
51  void
52  addObject (Object *object);
53 
54  Object*
55  getObjectByName (std::string name);
56 
57  std::vector<Object*>
58  getObjects ();
59 
60  // Accessors - Viewports
61  // -----------------------------------------------------------------------------
62 
63  void
64  addViewport (Viewport *viewport);
65 
66  std::vector<Viewport*>
67  getViewports ();
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  boost::mutex render_mutex_;
87 
88 };
89 
90 #endif