viewport.h
Go to the documentation of this file.
00001 #ifndef PCL_OUTOFCORE_VIEWPORT_H_
00002 #define PCL_OUTOFCORE_VIEWPORT_H_
00003 
00004 // C++
00005 #include <iostream>
00006 #include <string>
00007 
00008 // PCL
00009 #include "camera.h"
00010 
00011 // VTK
00012 #include <vtkActor.h>
00013 #include <vtkCallbackCommand.h>
00014 #include <vtkObject.h>
00015 #include <vtkTextActor.h>
00016 #include <vtkRenderer.h>
00017 #include <vtkRenderWindow.h>
00018 #include <vtkSmartPointer.h>
00019 
00020 class Viewport
00021 {
00022 public:
00023 
00024   // Operators
00025   // -----------------------------------------------------------------------------
00026   Viewport (vtkSmartPointer<vtkRenderWindow> window, double xmin = 0.0, double ymin = 0.0, double xmax = 1.0,
00027             double ymax = 1.0);
00028 
00029   // Accessors
00030   // -----------------------------------------------------------------------------
00031   inline vtkSmartPointer<vtkRenderer>
00032   getRenderer () const
00033   {
00034     return renderer_;
00035   }
00036 
00037   void
00038   setCamera (Camera* camera)
00039   {
00040     renderer_->SetActiveCamera (vtkCamera::SafeDownCast (camera->getCamera ()));
00041     camera_hud_actor_->SetInput (camera->getName ().c_str ());
00042     renderer_->ResetCamera ();
00043   }
00044 
00045 private:
00046 
00047   // Callbacks
00048   // -----------------------------------------------------------------------------
00049   static void
00050   viewportModifiedCallback (vtkObject* caller, unsigned long int vtkNotUsed(eventId), void* vtkNotUsed(clientData),
00051                             void* vtkNotUsed(callData));
00052 
00053   void
00054   viewportModified ();
00055 
00056   static void
00057   viewportActorUpdateCallback (vtkObject* caller, unsigned long int vtkNotUsed(eventId), void* vtkNotUsed(clientData),
00058                                void* vtkNotUsed(callData));
00059 
00060   void
00061   viewportActorUpdate ();
00062 
00063   static void
00064   viewportHudUpdateCallback (vtkObject* caller, unsigned long int vtkNotUsed(eventId), void* vtkNotUsed(clientData),
00065                              void* vtkNotUsed(callData));
00066 
00067   void
00068   viewportHudUpdate ();
00069 
00070   // Members
00071   // -----------------------------------------------------------------------------
00072   vtkSmartPointer<vtkRenderer> renderer_;
00073   vtkSmartPointer<vtkCallbackCommand> viewport_modified_callback_;
00074   vtkSmartPointer<vtkCallbackCommand> viewport_actor_update_callback_;
00075   vtkSmartPointer<vtkCallbackCommand> viewport_hud_callback_;
00076 
00077   vtkSmartPointer<vtkTextActor> camera_hud_actor_;
00078   vtkSmartPointer<vtkTextActor> fps_hud_actor_;
00079   vtkSmartPointer<vtkTextActor> points_hud_actor_;
00080 };
00081 
00082 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:37:27