Point Cloud Library (PCL)
1.14.1-dev
|
PCLVisualizerInteractorStyle defines an unique, custom VTK based interactory style for PCL Visualizer applications. More...
#include <pcl/visualization/interactor_style.h>
Public Types | |
using | CloudActorMapPtr = pcl::visualization::CloudActorMapPtr |
Public Member Functions | |
PCLVisualizerInteractorStyle ()=default | |
Empty constructor. More... | |
~PCLVisualizerInteractorStyle () override=default | |
Empty destructor. More... | |
vtkTypeMacro (PCLVisualizerInteractorStyle, vtkInteractorStyleRubberBandPick) | |
virtual void | Initialize () |
Initialization routine. More... | |
void | setCloudActorMap (const CloudActorMapPtr &actors) |
Pass a pointer to the cloud actor map. More... | |
void | setShapeActorMap (const ShapeActorMapPtr &actors) |
Pass a pointer to the shape actor map. More... | |
CloudActorMapPtr | getCloudActorMap () |
Get the cloud actor map pointer. More... | |
ShapeActorMapPtr | getShapeActorMap () |
Get the cloud actor map pointer. More... | |
void | setRendererCollection (vtkSmartPointer< vtkRendererCollection > &rens) |
Pass a set of renderers to the interactor style. More... | |
void | setUseVbos (const bool use_vbos) |
Use Vertex Buffer Objects renderers. More... | |
boost::signals2::connection | registerMouseCallback (std::function< void(const pcl::visualization::MouseEvent &)> cb) |
Register a callback function for mouse events. More... | |
boost::signals2::connection | registerKeyboardCallback (std::function< void(const pcl::visualization::KeyboardEvent &)> cb) |
Register a callback std::function for keyboard events. More... | |
boost::signals2::connection | registerPointPickingCallback (std::function< void(const pcl::visualization::PointPickingEvent &)> cb) |
Register a callback function for point picking events. More... | |
boost::signals2::connection | registerAreaPickingCallback (std::function< void(const pcl::visualization::AreaPickingEvent &)> cb) |
Register a callback function for area picking events. More... | |
void | saveScreenshot (const std::string &file) |
Save the current rendered image to disk, as a PNG screenshot. More... | |
bool | saveCameraParameters (const std::string &file) |
Save the camera parameters to disk, as a .cam file. More... | |
void | getCameraParameters (Camera &camera, int viewport=0) const |
Get camera parameters of a given viewport (0 means default viewport). More... | |
bool | loadCameraParameters (const std::string &file) |
Load camera parameters from a camera parameter file. More... | |
void | setCameraParameters (const Eigen::Matrix3f &intrinsics, const Eigen::Matrix4f &extrinsics, int viewport=0) |
Set the camera parameters via an intrinsics and and extrinsics matrix. More... | |
void | setCameraParameters (const Camera &camera, int viewport=0) |
Set the camera parameters by given a full camera data structure. More... | |
void | setCameraFile (const std::string &file) |
Set camera file for camera parameter saving/restoring. More... | |
std::string | getCameraFile () const |
Get camera file for camera parameter saving/restoring. More... | |
void | setKeyboardModifier (const InteractorKeyboardModifier &modifier) |
Change the default keyboard modified from ALT to a different special key. More... | |
Static Public Member Functions | |
static PCLVisualizerInteractorStyle * | New () |
Protected Member Functions | |
void | OnChar () override |
Interactor style internal method. More... | |
void | OnKeyDown () override |
void | OnKeyUp () override |
void | OnMouseMove () override |
void | OnLeftButtonDown () override |
void | OnLeftButtonUp () override |
void | OnMiddleButtonDown () override |
void | OnMiddleButtonUp () override |
void | OnRightButtonDown () override |
void | OnRightButtonUp () override |
void | OnMouseWheelForward () override |
void | OnMouseWheelBackward () override |
void | OnTimer () override |
Interactor style internal method. More... | |
void | zoomIn () |
Interactor style internal method. More... | |
void | zoomOut () |
Interactor style internal method. More... | |
bool | getCameraParameters (const std::vector< std::string > &camera) |
Get camera parameters from a string vector. More... | |
void | setRenderWindow (const vtkSmartPointer< vtkRenderWindow > &win) |
Set render window. More... | |
Protected Attributes | |
bool | init_ {false} |
Set to true after initialization is complete. More... | |
vtkSmartPointer< vtkRendererCollection > | rens_ |
Collection of vtkRenderers stored internally. More... | |
CloudActorMapPtr | cloud_actors_ {nullptr} |
Cloud actor map stored internally. More... | |
ShapeActorMapPtr | shape_actors_ {nullptr} |
Shape map stored internally. More... | |
int | win_height_ {0} |
The current window width/height. More... | |
int | win_width_ {0} |
int | win_pos_x_ {0} |
The current window position x/y. More... | |
int | win_pos_y_ {0} |
int | max_win_height_ {0} |
The maximum resizeable window width/height. More... | |
int | max_win_width_ {0} |
bool | use_vbos_ {false} |
Boolean that holds whether or not to use the vtkVertexBufferObjectMapper. More... | |
bool | grid_enabled_ {false} |
Set to true if the grid actor is enabled. More... | |
vtkSmartPointer< vtkLegendScaleActor > | grid_actor_ |
Actor for 2D grid on screen. More... | |
bool | lut_enabled_ {false} |
Set to true if the LUT actor is enabled. More... | |
vtkSmartPointer< vtkScalarBarActor > | lut_actor_ |
Actor for 2D lookup table on screen. More... | |
vtkSmartPointer< vtkPNGWriter > | snapshot_writer_ |
A PNG writer for screenshot captures. More... | |
vtkSmartPointer< vtkWindowToImageFilter > | wif_ |
Internal window to image filter. More... | |
vtkSmartPointer< vtkPointPicker > | point_picker_ |
Stores the point picker when switching to an area picker. More... | |
boost::signals2::signal< void(const pcl::visualization::MouseEvent &)> | mouse_signal_ |
boost::signals2::signal< void(const pcl::visualization::KeyboardEvent &)> | keyboard_signal_ |
boost::signals2::signal< void(const pcl::visualization::PointPickingEvent &)> | point_picking_signal_ |
boost::signals2::signal< void(const pcl::visualization::AreaPickingEvent &)> | area_picking_signal_ |
bool | stereo_anaglyph_mask_default_ {false} |
True if we're using red-blue colors for anaglyphic stereo, false if magenta-green. More... | |
vtkSmartPointer< PointPickingCallback > | mouse_callback_ |
A VTK Mouse Callback object, used for point picking. More... | |
InteractorKeyboardModifier | modifier_ {} |
The keyboard modifier to use. More... | |
std::string | camera_file_ |
Camera file for camera parameter saving/restoring. More... | |
Camera | camera_ |
A pcl::visualization::Camera for camera parameter saving/restoring. More... | |
bool | camera_saved_ {false} |
A pcl::visualization::Camera is saved or not. More... | |
vtkSmartPointer< vtkRenderWindow > | win_ |
The render window. More... | |
Friends | |
class | PointPickingCallback |
class | PCLVisualizer |
PCLVisualizerInteractorStyle defines an unique, custom VTK based interactory style for PCL Visualizer applications.
Besides defining the rendering style, we also create a list of custom actions that are triggered on different keys being pressed:
Definition at line 107 of file interactor_style.h.
using pcl::visualization::PCLVisualizerInteractorStyle::CloudActorMapPtr = pcl::visualization::CloudActorMapPtr |
Definition at line 110 of file interactor_style.h.
|
default |
Empty constructor.
|
overridedefault |
Empty destructor.
|
inline |
Get camera file for camera parameter saving/restoring.
Definition at line 239 of file interactor_style.h.
void pcl::visualization::PCLVisualizerInteractorStyle::getCameraParameters | ( | Camera & | camera, |
int | viewport = 0 |
||
) | const |
Get camera parameters of a given viewport (0 means default viewport).
|
protected |
|
inline |
Get the cloud actor map pointer.
Definition at line 141 of file interactor_style.h.
|
inline |
Get the cloud actor map pointer.
Definition at line 145 of file interactor_style.h.
|
virtual |
Initialization routine.
Must be called before anything else.
bool pcl::visualization::PCLVisualizerInteractorStyle::loadCameraParameters | ( | const std::string & | file | ) |
Load camera parameters from a camera parameter file.
[in] | file | the name of the camera parameter file |
|
static |
|
overrideprotected |
Interactor style internal method.
Gets called whenever a key is pressed.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
Interactor style internal method.
Gets called periodically if a timer is set.
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerAreaPickingCallback | ( | std::function< void(const pcl::visualization::AreaPickingEvent &)> | cb | ) |
Register a callback function for area picking events.
[in] | cb | a std function that will be registered as a callback for a area picking event |
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerKeyboardCallback | ( | std::function< void(const pcl::visualization::KeyboardEvent &)> | cb | ) |
Register a callback std::function for keyboard events.
[in] | cb | a std function that will be registered as a callback for a keyboard event |
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerMouseCallback | ( | std::function< void(const pcl::visualization::MouseEvent &)> | cb | ) |
Register a callback function for mouse events.
[in] | cb | a std function that will be registered as a callback for a mouse event |
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerPointPickingCallback | ( | std::function< void(const pcl::visualization::PointPickingEvent &)> | cb | ) |
Register a callback function for point picking events.
[in] | cb | a std function that will be registered as a callback for a point picking event |
bool pcl::visualization::PCLVisualizerInteractorStyle::saveCameraParameters | ( | const std::string & | file | ) |
Save the camera parameters to disk, as a .cam file.
[in] | file | the name of the .cam file |
void pcl::visualization::PCLVisualizerInteractorStyle::saveScreenshot | ( | const std::string & | file | ) |
Save the current rendered image to disk, as a PNG screenshot.
[in] | file | the name of the PNG file |
|
inline |
Set camera file for camera parameter saving/restoring.
[in] | file | the name of the camera parameter file |
Definition at line 232 of file interactor_style.h.
void pcl::visualization::PCLVisualizerInteractorStyle::setCameraParameters | ( | const Camera & | camera, |
int | viewport = 0 |
||
) |
Set the camera parameters by given a full camera data structure.
[in] | camera | camera structure containing all the camera parameters. |
[in] | viewport | the viewport to modify camera of (0 modifies all cameras) |
void pcl::visualization::PCLVisualizerInteractorStyle::setCameraParameters | ( | const Eigen::Matrix3f & | intrinsics, |
const Eigen::Matrix4f & | extrinsics, | ||
int | viewport = 0 |
||
) |
Set the camera parameters via an intrinsics and and extrinsics matrix.
[in] | intrinsics | the intrinsics that will be used to compute the VTK camera parameters |
[in] | extrinsics | the extrinsics that will be used to compute the VTK camera parameters |
[in] | viewport | the viewport to modify camera of (0 modifies all cameras) |
|
inline |
Pass a pointer to the cloud actor map.
[in] | actors | the actor map that will be used with this style |
Definition at line 131 of file interactor_style.h.
|
inline |
Change the default keyboard modified from ALT to a different special key.
Allowed values are:
[in] | modifier | the new keyboard modifier |
Definition at line 252 of file interactor_style.h.
|
inline |
Pass a set of renderers to the interactor style.
[in] | rens | the vtkRendererCollection to use |
Definition at line 151 of file interactor_style.h.
|
inlineprotected |
Set render window.
Definition at line 357 of file interactor_style.h.
|
inline |
Pass a pointer to the shape actor map.
[in] | actors | the actor map that will be used with this style |
Definition at line 137 of file interactor_style.h.
|
inline |
Use Vertex Buffer Objects renderers.
This is an optimization for the obsolete OpenGL backend. Modern OpenGL2 backend (VTK ≥ 6.3) uses vertex buffer objects by default, transparently for the user.
[in] | use_vbos | set to true to use VBOs |
Definition at line 160 of file interactor_style.h.
pcl::visualization::PCLVisualizerInteractorStyle::vtkTypeMacro | ( | PCLVisualizerInteractorStyle | , |
vtkInteractorStyleRubberBandPick | |||
) |
|
protected |
Interactor style internal method.
Zoom in.
|
protected |
Interactor style internal method.
Zoom out.
|
friend |
Definition at line 383 of file interactor_style.h.
|
friend |
Definition at line 382 of file interactor_style.h.
|
protected |
Definition at line 302 of file interactor_style.h.
|
protected |
A pcl::visualization::Camera for camera parameter saving/restoring.
Definition at line 374 of file interactor_style.h.
|
protected |
Camera file for camera parameter saving/restoring.
Definition at line 372 of file interactor_style.h.
|
protected |
A pcl::visualization::Camera is saved or not.
Definition at line 376 of file interactor_style.h.
|
protected |
Cloud actor map stored internally.
Definition at line 265 of file interactor_style.h.
|
protected |
Actor for 2D grid on screen.
Definition at line 285 of file interactor_style.h.
|
protected |
Set to true if the grid actor is enabled.
Definition at line 283 of file interactor_style.h.
|
protected |
Set to true after initialization is complete.
Definition at line 259 of file interactor_style.h.
|
protected |
Definition at line 300 of file interactor_style.h.
|
protected |
Actor for 2D lookup table on screen.
Definition at line 290 of file interactor_style.h.
|
protected |
Set to true if the LUT actor is enabled.
Definition at line 288 of file interactor_style.h.
|
protected |
The maximum resizeable window width/height.
Definition at line 277 of file interactor_style.h.
|
protected |
Definition at line 277 of file interactor_style.h.
|
protected |
|
protected |
A VTK Mouse Callback object, used for point picking.
Definition at line 366 of file interactor_style.h.
|
protected |
Definition at line 299 of file interactor_style.h.
|
protected |
Stores the point picker when switching to an area picker.
Definition at line 297 of file interactor_style.h.
|
protected |
Definition at line 301 of file interactor_style.h.
|
protected |
Collection of vtkRenderers stored internally.
Definition at line 262 of file interactor_style.h.
|
protected |
Shape map stored internally.
Definition at line 268 of file interactor_style.h.
|
protected |
A PNG writer for screenshot captures.
Definition at line 293 of file interactor_style.h.
|
protected |
True if we're using red-blue colors for anaglyphic stereo, false if magenta-green.
Definition at line 363 of file interactor_style.h.
|
protected |
Boolean that holds whether or not to use the vtkVertexBufferObjectMapper.
Definition at line 280 of file interactor_style.h.
|
protected |
Internal window to image filter.
Needed by snapshot_writer_.
Definition at line 295 of file interactor_style.h.
|
protected |
The render window.
Only used when interactor maybe not available
Definition at line 380 of file interactor_style.h.
|
protected |
The current window width/height.
Definition at line 271 of file interactor_style.h.
|
protected |
The current window position x/y.
Definition at line 274 of file interactor_style.h.
|
protected |
Definition at line 274 of file interactor_style.h.
|
protected |
Definition at line 271 of file interactor_style.h.