scene.cpp
Go to the documentation of this file.
00001 // PCL
00002 #include <pcl/outofcore/visualization/camera.h>
00003 #include <pcl/outofcore/visualization/object.h>
00004 #include <pcl/outofcore/visualization/scene.h>
00005 #include <pcl/outofcore/visualization/viewport.h>
00006 
00007 Scene* Scene::instance_ = NULL;
00008 
00009 Scene::Scene ()
00010 {
00011 
00012 }
00013 
00014 // Accessors - Cameras
00015 // -----------------------------------------------------------------------------
00016 void
00017 Scene::addCamera (Camera *camera)
00018 {
00019   cameras_.push_back (camera);
00020 }
00021 
00022 std::vector<Camera*>
00023 Scene::getCameras ()
00024 {
00025   return cameras_;
00026 }
00027 
00028 Camera*
00029 Scene::getCamera (vtkCamera *camera)
00030 {
00031   for (int i = 0; i < cameras_.size (); i++)
00032   {
00033     if (cameras_[i]->getCamera ().GetPointer () == camera)
00034     {
00035       return cameras_[i];
00036     }
00037   }
00038 
00039   return NULL;
00040 }
00041 
00042 Camera*
00043 Scene::getCamera (std::string name)
00044 {
00045   for (int i = 0; i < cameras_.size (); i++)
00046     if (cameras_[i]->getName () == name)
00047       return cameras_[i];
00048 
00049   return NULL;
00050 }
00051 
00052 // Accessors - Objects
00053 // -----------------------------------------------------------------------------
00054 void
00055 Scene::addObject (Object *object)
00056 {
00057   objects_.push_back (object);
00058 }
00059 
00060 Object*
00061 Scene::getObjectByName (std::string name)
00062 {
00063   for (int i = 0; i < objects_.size (); i++)
00064     if (objects_[i]->getName () == name)
00065       return objects_[i];
00066 
00067   return NULL;
00068 }
00069 
00070 std::vector<Object*>
00071 Scene::getObjects ()
00072 {
00073   return objects_;
00074 }
00075 
00076 //  void removeObject(Object *object)
00077 //  {
00078 //
00079 //  }
00080 
00081 // Accessors - Viewports
00082 // -----------------------------------------------------------------------------
00083 
00084 void
00085 Scene::addViewport (Viewport *viewport)
00086 {
00087   viewports_.push_back (viewport);
00088 }
00089 
00090 std::vector<Viewport*>
00091 Scene::getViewports ()
00092 {
00093   return viewports_;
00094 }


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:32:48