00001 #ifndef PCL_OUTOFCORE_SCENE_H_ 00002 #define PCL_OUTOFCORE_SCENE_H_ 00003 00004 // PCL 00005 #include "camera.h" 00006 #include "object.h" 00007 #include "outofcore_cloud.h" 00008 #include "viewport.h" 00009 00010 class Object; 00011 00012 class Scene 00013 { 00014 private: 00015 00016 static Scene *instance_; 00017 00018 Scene (); 00019 Scene (const Scene& op); 00020 Scene& 00021 operator= (const Scene& op); 00022 00023 public: 00024 00025 // Singleton 00026 static Scene* 00027 instance () 00028 { 00029 if (!Scene::instance_) 00030 Scene::instance_ = new Scene (); 00031 00032 return Scene::instance_; 00033 } 00034 00035 // Accessors - Cameras 00036 // ----------------------------------------------------------------------------- 00037 void 00038 addCamera (Camera *camera); 00039 00040 std::vector<Camera*> 00041 getCameras (); 00042 00043 Camera* 00044 getCamera (vtkCamera *camera); 00045 00046 Camera* 00047 getCamera (std::string name); 00048 00049 // Accessors - Objects 00050 // ----------------------------------------------------------------------------- 00051 void 00052 addObject (Object *object); 00053 00054 Object* 00055 getObjectByName (std::string name); 00056 00057 std::vector<Object*> 00058 getObjects (); 00059 00060 // Accessors - Viewports 00061 // ----------------------------------------------------------------------------- 00062 00063 void 00064 addViewport (Viewport *viewport); 00065 00066 std::vector<Viewport*> 00067 getViewports (); 00068 00069 void 00070 lock () 00071 { 00072 render_mutex_.lock (); 00073 } 00074 00075 void 00076 unlock () 00077 { 00078 render_mutex_.unlock (); 00079 } 00080 00081 private: 00082 std::vector<Camera*> cameras_; 00083 std::vector<Viewport*> viewports_; 00084 std::vector<Object*> objects_; 00085 00086 boost::mutex render_mutex_; 00087 00088 }; 00089 00090 #endif