PCLVisualizerInteractorStyle defines an unique, custom VTK based interactory style for PCL Visualizer applications. More...
#include <pcl/visualization/interactor_style.h>
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:
- p, P : switch to a point-based representation
- w, W : switch to a wireframe-based representation (where available)
- s, S : switch to a surface-based representation (where available)
- j, J : take a .PNG snapshot of the current window view
- c, C : display current camera/window parameters
- f, F : fly to point mode
- e, E : exit the interactor\
- q, Q : stop and call VTK's TerminateApp
- + / - : increment/decrement overall point size
- g, G : display scale grid (on/off)
- u, U : display lookup table (on/off)
- r, R [+ ALT] : reset camera [to viewpoint = {0, 0, 0} -> center_{x, y, z}]
- CTRL + s, S : save camera parameters
- CTRL + r, R : restore camera parameters
- ALT + s, S : turn stereo mode on/off
- ALT + f, F : switch between maximized window mode and original size
- l, L : list all available geometric and color handlers for the current actor map
- ALT + 0..9 [+ CTRL] : switch between different geometric handlers (where available)
- 0..9 [+ CTRL] : switch between different color handlers (where available)
- SHIFT + left click : select a point
- x, X : toggle rubber band selection mode for left mouse button
-
Author
-
Radu B. Rusu
Definition at line 107 of file interactor_style.h.
CloudActorMapPtr
PCLVisualizerInteractorStyle()
pcl::visualization::PCLVisualizerInteractorStyle::PCLVisualizerInteractorStyle |
( |
|
) |
|
|
inline |
~PCLVisualizerInteractorStyle()
pcl::visualization::PCLVisualizerInteractorStyle::~PCLVisualizerInteractorStyle |
( |
|
) |
|
|
overridedefault |
getCameraFile()
std::string pcl::visualization::PCLVisualizerInteractorStyle::getCameraFile |
( |
|
) |
const |
|
inline |
Get camera file for camera parameter saving/restoring.
Definition at line 243 of file interactor_style.h.
getCameraParameters() [1/2]
void pcl::visualization::PCLVisualizerInteractorStyle::getCameraParameters |
( |
Camera & |
camera, |
|
|
int |
viewport = 0 |
|
) |
|
const |
Get camera parameters of a given viewport (0 means default viewport).
getCameraParameters() [2/2]
bool pcl::visualization::PCLVisualizerInteractorStyle::getCameraParameters |
( |
const std::vector< std::string > & |
camera |
) |
|
|
protected |
Get camera parameters from a string vector.
-
Parameters
-
[in] |
camera |
A string vector: Clipping Range, Focal Point, Position, ViewUp, Distance, Field of View Y, Window Size, Window Pos. Values in each string are separated by a ',' |
getCloudActorMap()
CloudActorMapPtr pcl::visualization::PCLVisualizerInteractorStyle::getCloudActorMap |
( |
|
) |
|
|
inline |
getShapeActorMap()
ShapeActorMapPtr pcl::visualization::PCLVisualizerInteractorStyle::getShapeActorMap |
( |
|
) |
|
|
inline |
Initialize()
virtual void pcl::visualization::PCLVisualizerInteractorStyle::Initialize |
( |
|
) |
|
|
virtual |
Initialization routine.
Must be called before anything else.
loadCameraParameters()
bool pcl::visualization::PCLVisualizerInteractorStyle::loadCameraParameters |
( |
const std::string & |
file |
) |
|
Load camera parameters from a camera parameter file.
-
Parameters
-
[in] |
file |
the name of the camera parameter file |
New()
OnChar()
void pcl::visualization::PCLVisualizerInteractorStyle::OnChar |
( |
|
) |
|
|
overrideprotected |
Interactor style internal method.
Gets called whenever a key is pressed.
OnKeyDown()
void pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown |
( |
|
) |
|
|
overrideprotected |
OnKeyUp()
void pcl::visualization::PCLVisualizerInteractorStyle::OnKeyUp |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnLeftButtonDown |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnLeftButtonUp |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnMiddleButtonDown |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnMiddleButtonUp |
( |
|
) |
|
|
overrideprotected |
OnMouseMove()
void pcl::visualization::PCLVisualizerInteractorStyle::OnMouseMove |
( |
|
) |
|
|
overrideprotected |
OnMouseWheelBackward()
void pcl::visualization::PCLVisualizerInteractorStyle::OnMouseWheelBackward |
( |
|
) |
|
|
overrideprotected |
OnMouseWheelForward()
void pcl::visualization::PCLVisualizerInteractorStyle::OnMouseWheelForward |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnRightButtonDown |
( |
|
) |
|
|
overrideprotected |
void pcl::visualization::PCLVisualizerInteractorStyle::OnRightButtonUp |
( |
|
) |
|
|
overrideprotected |
OnTimer()
void pcl::visualization::PCLVisualizerInteractorStyle::OnTimer |
( |
|
) |
|
|
overrideprotected |
Interactor style internal method.
Gets called periodically if a timer is set.
registerAreaPickingCallback()
Register a callback function for area picking events.
-
Parameters
-
[in] |
cb |
a std function that will be registered as a callback for a area picking event |
-
Returns
-
a connection object that allows to disconnect the callback function.
registerKeyboardCallback()
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerKeyboardCallback |
( |
std::function< void(const pcl::visualization::KeyboardEvent &)> |
cb |
) |
|
Register a callback std::function for keyboard events.
-
Parameters
-
[in] |
cb |
a std function that will be registered as a callback for a keyboard event |
-
Returns
-
a connection object that allows to disconnect the callback function.
registerMouseCallback()
boost::signals2::connection pcl::visualization::PCLVisualizerInteractorStyle::registerMouseCallback |
( |
std::function< void(const pcl::visualization::MouseEvent &)> |
cb |
) |
|
Register a callback function for mouse events.
-
Parameters
-
[in] |
cb |
a std function that will be registered as a callback for a mouse event |
-
Returns
-
a connection object that allows to disconnect the callback function.
registerPointPickingCallback()
Register a callback function for point picking events.
-
Parameters
-
[in] |
cb |
a std function that will be registered as a callback for a point picking event |
-
Returns
-
a connection object that allows to disconnect the callback function.
saveCameraParameters()
bool pcl::visualization::PCLVisualizerInteractorStyle::saveCameraParameters |
( |
const std::string & |
file |
) |
|
Save the camera parameters to disk, as a .cam file.
-
Parameters
-
[in] |
file |
the name of the .cam file |
saveScreenshot()
void pcl::visualization::PCLVisualizerInteractorStyle::saveScreenshot |
( |
const std::string & |
file |
) |
|
Save the current rendered image to disk, as a PNG screenshot.
-
Parameters
-
[in] |
file |
the name of the PNG file |
setCameraFile()
void pcl::visualization::PCLVisualizerInteractorStyle::setCameraFile |
( |
const std::string & |
file |
) |
|
|
inline |
Set camera file for camera parameter saving/restoring.
-
Parameters
-
[in] |
file |
the name of the camera parameter file |
Definition at line 236 of file interactor_style.h.
setCameraParameters() [1/2]
void pcl::visualization::PCLVisualizerInteractorStyle::setCameraParameters |
( |
const Camera & |
camera, |
|
|
int |
viewport = 0 |
|
) |
|
|
Set the camera parameters by given a full camera data structure.
-
Parameters
-
[in] |
camera |
camera structure containing all the camera parameters. |
[in] |
viewport |
the viewport to modify camera of (0 modifies all cameras) |
setCameraParameters() [2/2]
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.
-
Note
-
This assumes that the pixels are square and that the center of the image is at the center of the sensor.
-
Parameters
-
[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) |
setCloudActorMap()
void pcl::visualization::PCLVisualizerInteractorStyle::setCloudActorMap |
( |
const CloudActorMapPtr & |
actors |
) |
|
|
inline |
Pass a pointer to the cloud actor map.
-
Parameters
-
[in] |
actors |
the actor map that will be used with this style |
Definition at line 136 of file interactor_style.h.
setKeyboardModifier()
Change the default keyboard modified from ALT to a different special key.
Allowed values are:
- INTERACTOR_KB_MOD_ALT
- INTERACTOR_KB_MOD_CTRL
- INTERACTOR_KB_MOD_SHIFT
-
Parameters
-
[in] |
modifier |
the new keyboard modifier |
Definition at line 256 of file interactor_style.h.
setRendererCollection()
void pcl::visualization::PCLVisualizerInteractorStyle::setRendererCollection |
( |
vtkSmartPointer< vtkRendererCollection > & |
rens |
) |
|
|
inline |
Pass a set of renderers to the interactor style.
-
Parameters
-
[in] |
rens |
the vtkRendererCollection to use |
Definition at line 156 of file interactor_style.h.
setRenderWindow()
void pcl::visualization::PCLVisualizerInteractorStyle::setRenderWindow |
( |
const vtkSmartPointer< vtkRenderWindow > & |
win |
) |
|
|
inlineprotected |
setShapeActorMap()
void pcl::visualization::PCLVisualizerInteractorStyle::setShapeActorMap |
( |
const ShapeActorMapPtr & |
actors |
) |
|
|
inline |
Pass a pointer to the shape actor map.
-
Parameters
-
[in] |
actors |
the actor map that will be used with this style |
Definition at line 142 of file interactor_style.h.
setUseVbos()
void pcl::visualization::PCLVisualizerInteractorStyle::setUseVbos |
( |
const bool |
use_vbos |
) |
|
|
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.
-
Parameters
-
[in] |
use_vbos |
set to true to use VBOs |
Definition at line 164 of file interactor_style.h.
vtkTypeMacro()
zoomIn()
void pcl::visualization::PCLVisualizerInteractorStyle::zoomIn |
( |
|
) |
|
|
protected |
Interactor style internal method.
Zoom in.
zoomOut()
void pcl::visualization::PCLVisualizerInteractorStyle::zoomOut |
( |
|
) |
|
|
protected |
Interactor style internal method.
Zoom out.
PCLVisualizer
PointPickingCallback
area_picking_signal_
camera_
Camera pcl::visualization::PCLVisualizerInteractorStyle::camera_ |
|
protected |
camera_file_
std::string pcl::visualization::PCLVisualizerInteractorStyle::camera_file_ |
|
protected |
camera_saved_
bool pcl::visualization::PCLVisualizerInteractorStyle::camera_saved_ |
|
protected |
cloud_actors_
CloudActorMapPtr pcl::visualization::PCLVisualizerInteractorStyle::cloud_actors_ |
|
protected |
grid_actor_
vtkSmartPointer<vtkLegendScaleActor> pcl::visualization::PCLVisualizerInteractorStyle::grid_actor_ |
|
protected |
grid_enabled_
bool pcl::visualization::PCLVisualizerInteractorStyle::grid_enabled_ |
|
protected |
init_
bool pcl::visualization::PCLVisualizerInteractorStyle::init_ |
|
protected |
keyboard_signal_
lut_actor_
vtkSmartPointer<vtkScalarBarActor> pcl::visualization::PCLVisualizerInteractorStyle::lut_actor_ |
|
protected |
lut_enabled_
bool pcl::visualization::PCLVisualizerInteractorStyle::lut_enabled_ |
|
protected |
max_win_height_
int pcl::visualization::PCLVisualizerInteractorStyle::max_win_height_ |
|
protected |
max_win_width_
int pcl::visualization::PCLVisualizerInteractorStyle::max_win_width_ |
|
protected |
modifier_
mouse_callback_
mouse_signal_
point_picker_
vtkSmartPointer<vtkPointPicker> pcl::visualization::PCLVisualizerInteractorStyle::point_picker_ |
|
protected |
Stores the point picker when switching to an area picker.
Definition at line 301 of file interactor_style.h.
point_picking_signal_
rens_
vtkSmartPointer<vtkRendererCollection> pcl::visualization::PCLVisualizerInteractorStyle::rens_ |
|
protected |
shape_actors_
ShapeActorMapPtr pcl::visualization::PCLVisualizerInteractorStyle::shape_actors_ |
|
protected |
snapshot_writer_
vtkSmartPointer<vtkPNGWriter> pcl::visualization::PCLVisualizerInteractorStyle::snapshot_writer_ |
|
protected |
stereo_anaglyph_mask_default_
bool pcl::visualization::PCLVisualizerInteractorStyle::stereo_anaglyph_mask_default_ |
|
protected |
True if we're using red-blue colors for anaglyphic stereo, false if magenta-green.
Definition at line 367 of file interactor_style.h.
use_vbos_
bool pcl::visualization::PCLVisualizerInteractorStyle::use_vbos_ |
|
protected |
Boolean that holds whether or not to use the vtkVertexBufferObjectMapper.
Definition at line 284 of file interactor_style.h.
wif_
vtkSmartPointer<vtkWindowToImageFilter> pcl::visualization::PCLVisualizerInteractorStyle::wif_ |
|
protected |
Internal window to image filter.
Needed by snapshot_writer_.
Definition at line 299 of file interactor_style.h.
win_
vtkSmartPointer<vtkRenderWindow> pcl::visualization::PCLVisualizerInteractorStyle::win_ |
|
protected |
The render window.
Only used when interactor maybe not available
Definition at line 384 of file interactor_style.h.
win_height_
int pcl::visualization::PCLVisualizerInteractorStyle::win_height_ |
|
protected |
win_pos_x_
int pcl::visualization::PCLVisualizerInteractorStyle::win_pos_x_ |
|
protected |
win_pos_y_
int pcl::visualization::PCLVisualizerInteractorStyle::win_pos_y_ |
|
protected |
win_width_
int pcl::visualization::PCLVisualizerInteractorStyle::win_width_ |
|
protected |
The documentation for this class was generated from the following file: