ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
VTKExtensions::vtkCustomInteractorStyle Class Reference

vtkCustomInteractorStyle 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: More...

#include <vtkCustomInteractorStyle.h>

Inheritance diagram for VTKExtensions::vtkCustomInteractorStyle:
[legend]
Collaboration diagram for VTKExtensions::vtkCustomInteractorStyle:
[legend]

Public Member Functions

 vtkTypeMacro (vtkCustomInteractorStyle, pcl::visualization::PCLVisualizerInteractorStyle)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
 vtkCustomInteractorStyle ()
 Empty constructor. More...
 
virtual ~vtkCustomInteractorStyle () override
 Empty destructor. More...
 
void toggleAreaPicking ()
 
void setRenderWindow (const vtkSmartPointer< vtkRenderWindow > &win)
 Set render window. More...
 
void AddManipulator (vtkCameraManipulator *m)
 
void RemoveAllManipulators ()
 
 vtkGetObjectMacro (CameraManipulators, vtkCollection)
 
 vtkSetVector3Macro (CenterOfRotation, double)
 
 vtkGetVector3Macro (CenterOfRotation, double)
 
 vtkSetMacro (RotationFactor, double)
 
 vtkGetMacro (RotationFactor, double)
 
virtual vtkCameraManipulator * FindManipulator (int button, int shift, int control)
 

Static Public Member Functions

static vtkCustomInteractorStyle * New ()
 
static void DollyToPosition (double fact, int *position, vtkRenderer *renderer)
 
static void TranslateCamera (vtkRenderer *renderer, int toX, int toY, int fromX, int fromY)
 

Protected Member Functions

void zoomIn ()
 Interactor style internal method. Zoom in. More...
 
void zoomOut ()
 Interactor style internal method. Zoom out. More...
 
virtual void OnKeyDown () override
 
virtual void OnKeyUp () override
 
virtual void OnChar () override
 Interactor style internal method. Gets called whenever a key is pressed. More...
 
virtual void OnMouseMove () override
 
virtual void OnLeftButtonDown () override
 
virtual void OnLeftButtonUp () override
 
virtual void OnMiddleButtonDown () override
 
virtual void OnMiddleButtonUp () override
 
virtual void OnRightButtonDown () override
 
virtual void OnRightButtonUp () override
 
virtual void OnMouseWheelForward () override
 
virtual void OnMouseWheelBackward () override
 
void Dolly (double factor) override
 
void updateLookUpTableDisplay (bool add_lut=false)
 Add/remove the look up table displayed when 'u' is pressed, can also be used to update the current LUT displayed lut_actor_id_ is used (if not empty) to chose which cloud/shape actor LUT will be updated (depending on what is available) If lut_actor_id_ is empty the first actor with LUT support found will be used. More...
 
void OnButtonDown (int button, int shift, int control)
 
void OnButtonUp (int button)
 
void ResetLights ()
 
 vtkCustomInteractorStyle (const vtkCustomInteractorStyle &)=delete
 
void operator= (const vtkCustomInteractorStyle &)=delete
 

Protected Attributes

std::string lut_actor_id_
 ID used to fetch/display the look up table on the visualizer It should be set by PCLVisualizer setLookUpTableID. More...
 
vtkCameraManipulator * CurrentManipulator
 
double CenterOfRotation [3]
 
double RotationFactor
 
vtkCollection * CameraManipulators
 

Detailed Description

vtkCustomInteractorStyle 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

Constructor & Destructor Documentation

◆ vtkCustomInteractorStyle() [1/2]

VTKExtensions::vtkCustomInteractorStyle::vtkCustomInteractorStyle ( )

Empty constructor.

References CenterOfRotation.

◆ ~vtkCustomInteractorStyle()

VTKExtensions::vtkCustomInteractorStyle::~vtkCustomInteractorStyle ( )
overridevirtual

Empty destructor.

References CameraManipulators.

◆ vtkCustomInteractorStyle() [2/2]

VTKExtensions::vtkCustomInteractorStyle::vtkCustomInteractorStyle ( const vtkCustomInteractorStyle &  )
protecteddelete

Member Function Documentation

◆ AddManipulator()

void VTKExtensions::vtkCustomInteractorStyle::AddManipulator ( vtkCameraManipulator *  m)

Access to adding or removing manipulators.

References CameraManipulators.

Referenced by PclUtils::PCLVis::setCameraManipulators().

◆ Dolly()

void VTKExtensions::vtkCustomInteractorStyle::Dolly ( double  factor)
overrideprotected

References DollyToPosition().

Referenced by zoomIn(), and zoomOut().

◆ DollyToPosition()

void VTKExtensions::vtkCustomInteractorStyle::DollyToPosition ( double  fact,
int *  position,
vtkRenderer *  renderer 
)
static

Dolly the renderer's camera to a specific point

References position, and TranslateCamera().

Referenced by Dolly().

◆ FindManipulator()

vtkCameraManipulator * VTKExtensions::vtkCustomInteractorStyle::FindManipulator ( int  button,
int  shift,
int  control 
)
virtual

Returns the chosen manipulator based on the modifiers.

References CameraManipulators, and NULL.

Referenced by OnButtonDown().

◆ New()

static vtkCustomInteractorStyle* VTKExtensions::vtkCustomInteractorStyle::New ( )
static

◆ OnButtonDown()

void VTKExtensions::vtkCustomInteractorStyle::OnButtonDown ( int  button,
int  shift,
int  control 
)
protected

◆ OnButtonUp()

void VTKExtensions::vtkCustomInteractorStyle::OnButtonUp ( int  button)
protected

◆ OnChar()

void VTKExtensions::vtkCustomInteractorStyle::OnChar ( )
overrideprotectedvirtual

Interactor style internal method. Gets called whenever a key is pressed.

References zoomIn(), and zoomOut().

◆ OnKeyDown()

◆ OnKeyUp()

void VTKExtensions::vtkCustomInteractorStyle::OnKeyUp ( )
overrideprotectedvirtual

◆ OnLeftButtonDown()

void VTKExtensions::vtkCustomInteractorStyle::OnLeftButtonDown ( )
overrideprotectedvirtual

References event, OnButtonDown(), x, and y.

◆ OnLeftButtonUp()

void VTKExtensions::vtkCustomInteractorStyle::OnLeftButtonUp ( )
overrideprotectedvirtual

References event, OnButtonUp(), x, and y.

◆ OnMiddleButtonDown()

void VTKExtensions::vtkCustomInteractorStyle::OnMiddleButtonDown ( )
overrideprotectedvirtual

References event, OnButtonDown(), x, and y.

◆ OnMiddleButtonUp()

void VTKExtensions::vtkCustomInteractorStyle::OnMiddleButtonUp ( )
overrideprotectedvirtual

References event, OnButtonUp(), x, and y.

◆ OnMouseMove()

void VTKExtensions::vtkCustomInteractorStyle::OnMouseMove ( )
overrideprotectedvirtual

◆ OnMouseWheelBackward()

void VTKExtensions::vtkCustomInteractorStyle::OnMouseWheelBackward ( )
overrideprotectedvirtual

References event, x, and y.

◆ OnMouseWheelForward()

void VTKExtensions::vtkCustomInteractorStyle::OnMouseWheelForward ( )
overrideprotectedvirtual

References event, x, and y.

◆ OnRightButtonDown()

void VTKExtensions::vtkCustomInteractorStyle::OnRightButtonDown ( )
overrideprotectedvirtual

References event, OnButtonDown(), x, and y.

◆ OnRightButtonUp()

void VTKExtensions::vtkCustomInteractorStyle::OnRightButtonUp ( )
overrideprotectedvirtual

References event, OnButtonUp(), x, and y.

◆ operator=()

void VTKExtensions::vtkCustomInteractorStyle::operator= ( const vtkCustomInteractorStyle &  )
protecteddelete

◆ PrintSelf()

void VTKExtensions::vtkCustomInteractorStyle::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ RemoveAllManipulators()

void VTKExtensions::vtkCustomInteractorStyle::RemoveAllManipulators ( )

Removes all manipulators.

References CameraManipulators.

Referenced by PclUtils::PCLVis::setCameraManipulators().

◆ ResetLights()

void VTKExtensions::vtkCustomInteractorStyle::ResetLights ( )
protected

References ecvColor::light().

◆ setRenderWindow()

void VTKExtensions::vtkCustomInteractorStyle::setRenderWindow ( const vtkSmartPointer< vtkRenderWindow > &  win)
inline

Set render window.

◆ toggleAreaPicking()

void VTKExtensions::vtkCustomInteractorStyle::toggleAreaPicking ( )

References ORIENT_MODE, and SELECT_MODE.

◆ TranslateCamera()

void VTKExtensions::vtkCustomInteractorStyle::TranslateCamera ( vtkRenderer *  renderer,
int  toX,
int  toY,
int  fromX,
int  fromY 
)
static

Translate the renderer's camera

Referenced by DollyToPosition().

◆ updateLookUpTableDisplay()

void VTKExtensions::vtkCustomInteractorStyle::updateLookUpTableDisplay ( bool  add_lut = false)
protected

Add/remove the look up table displayed when 'u' is pressed, can also be used to update the current LUT displayed lut_actor_id_ is used (if not empty) to chose which cloud/shape actor LUT will be updated (depending on what is available) If lut_actor_id_ is empty the first actor with LUT support found will be used.

References lut_actor_id_.

Referenced by OnKeyDown().

◆ vtkGetMacro()

VTKExtensions::vtkCustomInteractorStyle::vtkGetMacro ( RotationFactor  ,
double   
)

◆ vtkGetObjectMacro()

VTKExtensions::vtkCustomInteractorStyle::vtkGetObjectMacro ( CameraManipulators  ,
vtkCollection   
)

Accessor for the collection of camera manipulators.

◆ vtkGetVector3Macro()

VTKExtensions::vtkCustomInteractorStyle::vtkGetVector3Macro ( CenterOfRotation  ,
double   
)

◆ vtkSetMacro()

VTKExtensions::vtkCustomInteractorStyle::vtkSetMacro ( RotationFactor  ,
double   
)

Propagates the rotation factor to the manipulators. This simply sets an internal ivar. It is propagated to a manipulator before the event is sent to it. Also changing the RotationFactor during interaction i.e. after a button press but before a button up has no effect until the next button press.

◆ vtkSetVector3Macro()

VTKExtensions::vtkCustomInteractorStyle::vtkSetVector3Macro ( CenterOfRotation  ,
double   
)

Propagates the center to the manipulators. This simply sets an internal ivar. It is propagated to a manipulator before the event is sent to it. Also changing the CenterOfRotation during interaction i.e. after a button press but before a button up has no effect until the next button press.

◆ vtkTypeMacro()

VTKExtensions::vtkCustomInteractorStyle::vtkTypeMacro ( vtkCustomInteractorStyle  ,
pcl::visualization::PCLVisualizerInteractorStyle   
)

◆ zoomIn()

void VTKExtensions::vtkCustomInteractorStyle::zoomIn ( )
protected

Interactor style internal method. Zoom in.

References Dolly().

Referenced by OnChar(), and OnKeyDown().

◆ zoomOut()

void VTKExtensions::vtkCustomInteractorStyle::zoomOut ( )
protected

Interactor style internal method. Zoom out.

References Dolly().

Referenced by OnChar(), and OnKeyDown().

Member Data Documentation

◆ CameraManipulators

vtkCollection* VTKExtensions::vtkCustomInteractorStyle::CameraManipulators
protected

◆ CenterOfRotation

double VTKExtensions::vtkCustomInteractorStyle::CenterOfRotation[3]
protected

◆ CurrentManipulator

vtkCameraManipulator* VTKExtensions::vtkCustomInteractorStyle::CurrentManipulator
protected

◆ lut_actor_id_

std::string VTKExtensions::vtkCustomInteractorStyle::lut_actor_id_
protected

ID used to fetch/display the look up table on the visualizer It should be set by PCLVisualizer setLookUpTableID.

Note
If empty, a random actor added to the interactor will be used

Referenced by updateLookUpTableDisplay().

◆ RotationFactor

double VTKExtensions::vtkCustomInteractorStyle::RotationFactor
protected

Referenced by OnButtonDown(), and PrintSelf().


The documentation for this class was generated from the following files: