43 #include <pcl/visualization/common/actor_map.h>
44 #include <pcl/visualization/common/ren_win_interact_map.h>
45 #include <pcl/visualization/keyboard_event.h>
46 #include <pcl/visualization/mouse_event.h>
47 #include <pcl/visualization/point_picking_event.h>
48 #include <pcl/visualization/area_picking_event.h>
49 #include <boost/signals2/signal.hpp>
50 #include <vtkInteractorStyleRubberBandPick.h>
51 #include <vtkRendererCollection.h>
52 #include <vtkRenderWindow.h>
54 class vtkRendererCollection;
55 class vtkLegendScaleActor;
56 class vtkScalarBarActor;
58 class vtkWindowToImageFilter;
63 namespace visualization
160 setUseVbos (const
bool use_vbos) { use_vbos_ = use_vbos; }
166 boost::signals2::connection
173 boost::signals2::connection
180 boost::signals2::connection
187 boost::signals2::connection
219 setCameraParameters (
const Eigen::Matrix3f &intrinsics,
const Eigen::Matrix4f &extrinsics,
int viewport = 0);
241 return (camera_file_);
254 modifier_ = modifier;
271 int win_height_{0}, win_width_{0};
274 int win_pos_x_{0}, win_pos_y_{0};
277 int max_win_height_{0}, max_win_width_{0};
280 bool use_vbos_{
false};
283 bool grid_enabled_{
false};
288 bool lut_enabled_{
false};
363 bool stereo_anaglyph_mask_default_{
false};
376 bool camera_saved_{
false};
389 std::string lut_actor_id_;
395 updateLookUpTableDisplay (
bool add_lut =
false);
427 void OnKeyDown ()
override;
430 void OnTimer ()
override;
/brief Class representing 3D area picking events.
Camera class holds a set of camera parameters together with the window pos/size.
/brief Class representing key hit/release events
PCL histogram visualizer interactory style class.
void setRenWinInteractMap(const RenWinInteractMap &wins)
Pass a map of render/window/interactors to the interactor style.
PCLHistogramVisualizerInteractorStyle()=default
Empty constructor.
static PCLHistogramVisualizerInteractorStyle * New()
void Initialize()
Initialization routine.
PCL Visualizer main class.
PCLVisualizerInteractorStyle defines an unique, custom VTK based interactory style for PCL Visualizer...
vtkSmartPointer< vtkWindowToImageFilter > wif_
Internal window to image filter.
void setCloudActorMap(const CloudActorMapPtr &actors)
Pass a pointer to the cloud actor map.
~PCLVisualizerInteractorStyle() override=default
Empty destructor.
void OnRightButtonDown() override
void setCameraParameters(const Eigen::Matrix3f &intrinsics, const Eigen::Matrix4f &extrinsics, int viewport=0)
Set the camera parameters via an intrinsics and and extrinsics matrix.
void OnMiddleButtonDown() override
void setRendererCollection(vtkSmartPointer< vtkRendererCollection > &rens)
Pass a set of renderers to the interactor style.
void getCameraParameters(Camera &camera, int viewport=0) const
Get camera parameters of a given viewport (0 means default viewport).
void OnMiddleButtonUp() override
vtkTypeMacro(PCLVisualizerInteractorStyle, vtkInteractorStyleRubberBandPick)
vtkSmartPointer< vtkPointPicker > point_picker_
Stores the point picker when switching to an area picker.
CloudActorMapPtr getCloudActorMap()
Get the cloud actor map pointer.
virtual void Initialize()
Initialization routine.
ShapeActorMapPtr getShapeActorMap()
Get the cloud actor map pointer.
void saveScreenshot(const std::string &file)
Save the current rendered image to disk, as a PNG screenshot.
void setShapeActorMap(const ShapeActorMapPtr &actors)
Pass a pointer to the shape actor map.
pcl::visualization::CloudActorMapPtr CloudActorMapPtr
boost::signals2::connection registerMouseCallback(std::function< void(const pcl::visualization::MouseEvent &)> cb)
Register a callback function for mouse events.
void OnKeyDown() override
bool loadCameraParameters(const std::string &file)
Load camera parameters from a camera parameter file.
void OnLeftButtonDown() override
void setRenderWindow(const vtkSmartPointer< vtkRenderWindow > &win)
Set render window.
vtkSmartPointer< vtkPNGWriter > snapshot_writer_
A PNG writer for screenshot captures.
Camera camera_
A pcl::visualization::Camera for camera parameter saving/restoring.
vtkSmartPointer< vtkRenderWindow > win_
The render window.
bool getCameraParameters(const std::vector< std::string > &camera)
Get camera parameters from a string vector.
boost::signals2::connection registerPointPickingCallback(std::function< void(const pcl::visualization::PointPickingEvent &)> cb)
Register a callback function for point picking events.
void zoomOut()
Interactor style internal method.
boost::signals2::signal< void(const pcl::visualization::AreaPickingEvent &)> area_picking_signal_
void OnMouseMove() override
std::string getCameraFile() const
Get camera file for camera parameter saving/restoring.
void OnLeftButtonUp() override
void setKeyboardModifier(const InteractorKeyboardModifier &modifier)
Change the default keyboard modified from ALT to a different special key.
boost::signals2::signal< void(const pcl::visualization::MouseEvent &)> mouse_signal_
void setCameraParameters(const Camera &camera, int viewport=0)
Set the camera parameters by given a full camera data structure.
vtkSmartPointer< vtkLegendScaleActor > grid_actor_
Actor for 2D grid on screen.
vtkSmartPointer< vtkRendererCollection > rens_
Collection of vtkRenderers stored internally.
boost::signals2::connection registerKeyboardCallback(std::function< void(const pcl::visualization::KeyboardEvent &)> cb)
Register a callback std::function for keyboard events.
void OnTimer() override
Interactor style internal method.
boost::signals2::connection registerAreaPickingCallback(std::function< void(const pcl::visualization::AreaPickingEvent &)> cb)
Register a callback function for area picking events.
boost::signals2::signal< void(const pcl::visualization::KeyboardEvent &)> keyboard_signal_
void setCameraFile(const std::string &file)
Set camera file for camera parameter saving/restoring.
void OnChar() override
Interactor style internal method.
PCLVisualizerInteractorStyle()=default
Empty constructor.
vtkSmartPointer< PointPickingCallback > mouse_callback_
A VTK Mouse Callback object, used for point picking.
boost::signals2::signal< void(const pcl::visualization::PointPickingEvent &)> point_picking_signal_
void OnMouseWheelBackward() override
bool saveCameraParameters(const std::string &file)
Save the camera parameters to disk, as a .cam file.
void zoomIn()
Interactor style internal method.
static PCLVisualizerInteractorStyle * New()
void OnMouseWheelForward() override
vtkSmartPointer< vtkScalarBarActor > lut_actor_
Actor for 2D lookup table on screen.
std::string camera_file_
Camera file for camera parameter saving/restoring.
void OnRightButtonUp() override
/brief Class representing 3D point picking events.
InteractorKeyboardModifier
A list of potential keyboard modifiers for pcl::visualization::PCLVisualizerInteractorStyle::PCLVisua...
@ INTERACTOR_KB_MOD_SHIFT
shared_ptr< CloudActorMap > CloudActorMapPtr
std::map< std::string, RenWinInteract > RenWinInteractMap
shared_ptr< ShapeActorMap > ShapeActorMapPtr
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....