scene.h
#ifndef PCL_OUTOFCORE_SCENE_H_
#define PCL_OUTOFCORE_SCENE_H_
// PCL
#include "camera.h"
#include "object.h"
#include "outofcore_cloud.h"
#include "viewport.h"
class Object;
class Scene
{
private:
static Scene *instance_;
Scene ();
Scene (const Scene& op);
Scene&
operator= (const Scene& op);
public:
// Singleton
static Scene*
instance ()
{
if (!Scene::instance_)
Scene::instance_ = new Scene ();
return Scene::instance_;
}
// Accessors - Cameras
// -----------------------------------------------------------------------------
void
addCamera (Camera *camera);
std::vector<Camera*>
getCameras ();
Camera*
getCamera (vtkCamera *camera);
Camera*
getCamera (std::string name);
// Accessors - Objects
// -----------------------------------------------------------------------------
void
addObject (Object *object);
Object*
getObjectByName (std::string name);
std::vector<Object*>
getObjects ();
// Accessors - Viewports
// -----------------------------------------------------------------------------
void
addViewport (Viewport *viewport);
std::vector<Viewport*>
getViewports ();
void
lock ()
{
render_mutex_.lock ();
}
void
unlock ()
{
render_mutex_.unlock ();
}
private:
std::vector<Camera*> cameras_;
std::vector<Viewport*> viewports_;
std::vector<Object*> objects_;
boost::mutex render_mutex_;
};
#endif
Viewport
Definition: viewport.h:20
Scene::getCameras
std::vector< Camera * > getCameras()
Scene::instance
static Scene * instance()
Definition: scene.h:27
Camera
Definition: camera.h:19
Scene::addObject
void addObject(Object *object)
Scene::getObjectByName
Object * getObjectByName(std::string name)
Scene
Definition: scene.h:12
Scene::getCamera
Camera * getCamera(vtkCamera *camera)
Scene::unlock
void unlock()
Definition: scene.h:76
Scene::getObjects
std::vector< Object * > getObjects()
Scene::getViewports
std::vector< Viewport * > getViewports()
Scene::addCamera
void addCamera(Camera *camera)
Object
Definition: object.h:23
Scene::addViewport
void addViewport(Viewport *viewport)
Scene::lock
void lock()
Definition: scene.h:70