Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SVTK_InteractorStyle Class Reference

Introduce SALOME way of user interaction. More...

#include <SVTK_InteractorStyle.h>

Inheritance diagram for SVTK_InteractorStyle:
Inheritance graph

Public Types

typedef boost::shared_ptr
< SVTK_SelectionEvent
PSelectionEvent
 

Public Member Functions

 vtkTypeMacro (SVTK_InteractorStyle, vtkInteractorStyle)
 
void SetTDxStyle (vtkTDxInteractorStyle *)
 
virtual SVTK_SelectionEventGetSelectionEvent ()
 Generate special SVTK_SelectionEvent. More...
 
virtual SVTK_SelectionEventGetSelectionEventFlipY ()
 Generate special SVTK_SelectionEvent with flipped Y coordinate. More...
 
virtual void SetInteractor (vtkRenderWindowInteractor *)
 Redefined in order to add an observer (callback) for custom event (space mouse event) More...
 
virtual void Render ()
 To invoke #vtkRenderWindowInteractor::CreateTimer. More...
 
virtual void OnTimer ()
 To implement cached rendering. More...
 
virtual void OnConfigure ()
 To reset reset view. More...
 
virtual void OnMouseMove ()
 To handle mouse move event. More...
 
virtual void OnLeftButtonDown ()
 To handle left mouse button down event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnLeftButtonUp ()
 To handle left mouse button up event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnMiddleButtonDown ()
 To handle middle mouse button down event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnMiddleButtonUp ()
 To handle middle mouse button up event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnRightButtonDown ()
 To handle right mouse button down event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnRightButtonUp ()
 To handle right mouse button up event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnMouseWheelForward ()
 To handle mouse wheel forward event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnMouseWheelBackward ()
 To handle mouse wheel backward event (reimplemented from vtkInteractorStyle) More...
 
virtual void OnMouseButtonDoubleClick ()
 To handle mouse button double click event. More...
 
virtual void OnChar ()
 To handle keyboard event (reimplemented from vtkInteractorStyle) More...
 
void SetControllerIncrement (SVTK_ControllerIncrement *)
 To set current increment controller. More...
 
void SetIncrementSpeed (const int, const int=0)
 To modify current increment controller. More...
 
SVTK_ControllerIncrementControllerIncrement ()
 To get current increment controller. More...
 
virtual void OnKeyDown ()
 Redefine vtkInteractorStyle::OnKeyDown. More...
 
void ActionPicking ()
 Provide instructions for Picking. More...
 
void SetControllerOnKeyDown (SVTK_ControllerOnKeyDown *)
 To set current OnKeyDown controller. More...
 
SVTK_ControllerOnKeyDownControllerOnKeyDown ()
 To get current OnKeyDown controller. More...
 
SVTK_SelectorGetSelector ()
 
int CurrentState () const
 
PolygonState GetPolygonState () const
 
void SetPolygonState (const PolygonState &thePolygonState)
 
void SetAdvancedZoomingEnabled (const bool theState)
 
bool IsAdvancedZoomingEnabled () const
 
void FreeActors ()
 releaze myLastHighlitedActor and myLastPreHighlitedActor More...
 

Static Public Member Functions

static SVTK_InteractorStyleNew ()
 

Protected Member Functions

 SVTK_InteractorStyle ()
 
 ~SVTK_InteractorStyle ()
 
QWidgetGetRenderWidget ()
 
virtual void OnMouseMove (int ctrl, int shift, int x, int y)
 
virtual void OnLeftButtonDown (int ctrl, int shift, int x, int y)
 
virtual void OnLeftButtonUp (int ctrl, int shift, int x, int y)
 
virtual void OnMiddleButtonDown (int ctrl, int shift, int x, int y)
 
virtual void OnMiddleButtonUp (int ctrl, int shift, int x, int y)
 
virtual void OnRightButtonDown (int ctrl, int shift, int x, int y)
 
virtual void OnRightButtonUp (int ctrl, int shift, int x, int y)
 
void RotateXY (int dx, int dy)
 
void PanXY (int x, int y, int oldX, int oldY)
 
void DollyXY (int dx, int dy)
 
void SpinXY (int dx, int dy, int oldX, int oldY)
 
void fitRect (const int left, const int top, const int right, const int bottom)
 
void Place (const int theX, const int theY)
 
void TranslateView (int toX, int toY, int fromX, int fromY)
 
void IncrementalPan (const int incrX, const int incrY)
 
void IncrementalZoom (const int incr)
 
void IncrementalRotate (const int incrX, const int incrY)
 
void startZoom ()
 
void startPan ()
 
void startGlobalPan ()
 
void startRotate ()
 
void startFitArea ()
 
void startSpin ()
 
void startPointSelection ()
 
void startFocalPointSelection ()
 
void loadCursors ()
 
void startOperation (int operation)
 
void onStartOperation ()
 
virtual void onFinishOperation ()
 
void onOperation (QPoint mousePos)
 
void onCursorMove (QPoint mousePos)
 
void setCursor (const int operation)
 
void onSpaceMouseMove (double *data)
 
virtual void onSpaceMouseButton (int button)
 
void DominantCombinedSwitch ()
 
void drawRect ()
 
void endDrawRect ()
 Delete rubber band on the end on the dragging operation. More...
 
void drawPolygon ()
 
void endDrawPolygon ()
 Delete rubber band on the end on the dragging operation. More...
 

Static Protected Member Functions

static void ProcessEvents (vtkObject *object, unsigned long event, void *clientData, void *callData)
 

Protected Attributes

float MotionFactor
 
float RadianToDegree
 
double myScale
 
QCursor myDefCursor
 
QCursor myPanCursor
 
QCursor myZoomCursor
 
QCursor myRotateCursor
 
QCursor mySpinCursor
 
QCursor myHandCursor
 
QCursor myGlobalPanCursor
 
QPoint myPoint
 
QPoint myOtherPoint
 
bool myCursorState
 
bool myShiftState
 
int ForcedState
 
vtkSmartPointer< SALOME_ActormyLastHighlitedActor
 
vtkSmartPointer< SALOME_ActormyLastPreHighlitedActor
 
vtkSmartPointer
< SVTK_ControllerIncrement
myControllerIncrement
 "Increment" controller for pan/rotate/zoom operations More...
 
vtkSmartPointer
< SVTK_ControllerOnKeyDown
myControllerOnKeyDown
 controls the behaviour of KeyDown event in SALOME way More...
 
int mySMDecreaseSpeedBtn
 
int mySMIncreaseSpeedBtn
 
int mySMDominantCombinedSwitchBtn
 
vtkSmartPointer
< SVTK_GenericRenderWindowInteractor
myInteractor
 
PSelectionEvent mySelectionEvent
 
unsigned long myCurrRotationPointType
 
unsigned long myPrevRotationPointType
 
unsigned long myCurrFocalPointType
 
unsigned long myPrevFocalPointType
 
double myRotationPointX
 
double myRotationPointY
 
double myRotationPointZ
 
vtkSmartPointer< SVTK_ActormyHighlightSelectionPointActor
 
vtkSmartPointer< vtkPointPicker > myPointPicker
 
double myBBCenter [3]
 
bool myBBFirstCheck
 
QtxRectRubberBandmyRectBand
 selection rectangle rubber band More...
 
QtxPolyRubberBandmyPolygonBand
 polygonal selection More...
 
QVector< QPoint > myPolygonPoints
 
PolygonState myPoligonState
 
bool myIsAdvancedZoomingEnabled
 

Detailed Description

This class defines SALOME way of user interaction for VTK viewer, as well, as introduce a new selection mechanism

Member Typedef Documentation

Constructor & Destructor Documentation

SVTK_InteractorStyle::~SVTK_InteractorStyle ( )
protected

Destructor

References endDrawPolygon(), and endDrawRect().

Member Function Documentation

void SVTK_InteractorStyle::ActionPicking ( )
SVTK_ControllerIncrement * SVTK_InteractorStyle::ControllerIncrement ( )

To get current increment controller

References myControllerIncrement.

SVTK_ControllerOnKeyDown * SVTK_InteractorStyle::ControllerOnKeyDown ( )

To get current OnKeyDown controller

References myControllerOnKeyDown.

int SVTK_InteractorStyle::CurrentState ( ) const
inline
void SVTK_InteractorStyle::DollyXY ( int  dx,
int  dy 
)
protected
void SVTK_InteractorStyle::DominantCombinedSwitch ( )
protected
void SVTK_InteractorStyle::drawPolygon ( )
protected
void SVTK_InteractorStyle::drawRect ( )
protected

Draws rectangle by starting and current points

References GetRenderWidget(), QtxRectRubberBand::initGeometry(), SUIT_Tools::makeRect(), myOtherPoint, myPoint, and myRectBand.

void SVTK_InteractorStyle::endDrawPolygon ( )
protected

References myPolygonBand, and myPolygonPoints.

void SVTK_InteractorStyle::endDrawRect ( )
protected
void SVTK_InteractorStyle::fitRect ( const int  left,
const int  top,
const int  right,
const int  bottom 
)
protected

Fits viewer contents to rect

References Render(), and TranslateView().

void SVTK_InteractorStyle::FreeActors ( )

Realeaze actors

References myLastHighlitedActor, and myLastPreHighlitedActor.

PolygonState SVTK_InteractorStyle::GetPolygonState ( ) const
inline
QWidget * SVTK_InteractorStyle::GetRenderWidget ( )
protected
Returns
widget for rendering

References myInteractor.

SVTK_SelectionEvent * SVTK_InteractorStyle::GetSelectionEvent ( )
virtual
SVTK_SelectionEvent * SVTK_InteractorStyle::GetSelectionEventFlipY ( )
virtual

Generate special SVTK_SelectionEvent with flipped Y coordinate

References GetSelector(), mySelectionEvent, and SVTK_Selector::SelectionMode().

SVTK_Selector * SVTK_InteractorStyle::GetSelector ( )
Returns
selector

References myInteractor.

void SVTK_InteractorStyle::IncrementalPan ( const int  incrX,
const int  incrY 
)
protected

References PanXY().

void SVTK_InteractorStyle::IncrementalRotate ( const int  incrX,
const int  incrY 
)
protected

References RotateXY().

void SVTK_InteractorStyle::IncrementalZoom ( const int  incr)
protected

References DollyXY().

bool SVTK_InteractorStyle::IsAdvancedZoomingEnabled ( ) const
inline
void SVTK_InteractorStyle::loadCursors ( )
protected

loads cursors for viewer operations - zoom, pan, etc...

References myCursorState, myDefCursor, myGlobalPanCursor, myHandCursor, myPanCursor, myRotateCursor, mySpinCursor, and myZoomCursor.

static SVTK_InteractorStyle* SVTK_InteractorStyle::New ( )
static
void SVTK_InteractorStyle::OnChar ( )
virtual
void SVTK_InteractorStyle::OnConfigure ( )
virtual

To reset reset view

void SVTK_InteractorStyle::onCursorMove ( QPoint  mousePos)
protected

Called when user moves mouse inside viewer window and there is no active viewer operation (!put necessary processing here!)

References GetSelectionEventFlipY(), GetSelector(), myCurrFocalPointType, myHighlightSelectionPointActor, myLastPreHighlitedActor, myPointPicker, SVTK_SelectionEvent::myX, SVTK_SelectionEvent::myY, SVTK_Selector::Pick(), Render(), and SVTK::StartFocalPointSelection.

void SVTK_InteractorStyle::OnKeyDown ( )
virtual

Redefined vtkInteractorStyle::OnKeyDown

References myControllerOnKeyDown.

void SVTK_InteractorStyle::OnLeftButtonDown ( )
virtual

To handle left mouse button down event (reimplemented from vtkInteractorStyle)

void SVTK_InteractorStyle::OnLeftButtonUp ( )
virtual

To handle left mouse button up event (reimplemented from vtkInteractorStyle)

virtual void SVTK_InteractorStyle::OnLeftButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::OnMiddleButtonDown ( )
virtual

To handle middle mouse button down event (reimplemented from vtkInteractorStyle)

void SVTK_InteractorStyle::OnMiddleButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual
void SVTK_InteractorStyle::OnMiddleButtonUp ( )
virtual

To handle middle mouse button up event (reimplemented from vtkInteractorStyle)

virtual void SVTK_InteractorStyle::OnMiddleButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::OnMouseButtonDoubleClick ( )
virtual

To handle mouse double click event

References Finished, InProcess, myPoligonState, and onFinishOperation().

void SVTK_InteractorStyle::OnMouseMove ( )
virtual

To handle mouse move event

virtual void SVTK_InteractorStyle::OnMouseMove ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::OnMouseWheelBackward ( )
virtual

References myOtherPoint.

void SVTK_InteractorStyle::OnMouseWheelForward ( )
virtual

References myOtherPoint.

void SVTK_InteractorStyle::OnRightButtonDown ( )
virtual

To handle right mouse button down event (reimplemented from vtkInteractorStyle)

void SVTK_InteractorStyle::OnRightButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual
void SVTK_InteractorStyle::OnRightButtonUp ( )
virtual

To handle right mouse button up event (reimplemented from vtkInteractorStyle)

virtual void SVTK_InteractorStyle::OnRightButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)
protectedvirtual

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::onSpaceMouseMove ( double *  data)
protected
void SVTK_InteractorStyle::OnTimer ( )
virtual

To implement cached rendering

References SVTK::BBCenterChanged, ComputeBBCenter(), myBBCenter, and myBBFirstCheck.

void SVTK_InteractorStyle::PanXY ( int  x,
int  y,
int  oldX,
int  oldY 
)
protected
void SVTK_InteractorStyle::Place ( const int  theX,
const int  theY 
)
protected

Called on finsh GlobalPan operation

References myScale, Render(), and TranslateView().

void SVTK_InteractorStyle::Render ( )
virtual

To invoke #vtkRenderWindowInteractor::CreateTimer

void SVTK_InteractorStyle::RotateXY ( int  dx,
int  dy 
)
protected
void SVTK_InteractorStyle::SetAdvancedZoomingEnabled ( const bool  theState)
inline
void SVTK_InteractorStyle::SetControllerIncrement ( SVTK_ControllerIncrement theController)

To set current increment controller

References myControllerIncrement.

void SVTK_InteractorStyle::SetControllerOnKeyDown ( SVTK_ControllerOnKeyDown theController)

To set current increment controller

References myControllerOnKeyDown.

void SVTK_InteractorStyle::SetIncrementSpeed ( const int  theValue,
const int  theMode = 0 
)
void SVTK_InteractorStyle::SetPolygonState ( const PolygonState thePolygonState)
inline
void SVTK_InteractorStyle::SetTDxStyle ( vtkTDxInteractorStyle *  )
inline
void SVTK_InteractorStyle::SpinXY ( int  dx,
int  dy,
int  oldX,
int  oldY 
)
protected
void SVTK_InteractorStyle::startFitArea ( )
protected

Starts Fit Area operation (e.g. through menu command)

References ForcedState, onFinishOperation(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_FIT, and VTK_INTERACTOR_STYLE_CAMERA_NONE.

void SVTK_InteractorStyle::startFocalPointSelection ( )
protected
void SVTK_InteractorStyle::startGlobalPan ( )
protected
void SVTK_InteractorStyle::startPan ( )
protected
void SVTK_InteractorStyle::startPointSelection ( )
protected
void SVTK_InteractorStyle::startRotate ( )
protected
void SVTK_InteractorStyle::startSpin ( )
protected
void SVTK_InteractorStyle::startZoom ( )
protected
void SVTK_InteractorStyle::TranslateView ( int  toX,
int  toY,
int  fromX,
int  fromY 
)
protected

Translates view from Point to Point

SVTK_InteractorStyle::vtkTypeMacro ( SVTK_InteractorStyle  ,
vtkInteractorStyle   
)

Member Data Documentation

int SVTK_InteractorStyle::ForcedState
protected
float SVTK_InteractorStyle::MotionFactor
protected
double SVTK_InteractorStyle::myBBCenter[3]
protected
bool SVTK_InteractorStyle::myBBFirstCheck
protected
vtkSmartPointer<SVTK_ControllerIncrement> SVTK_InteractorStyle::myControllerIncrement
protected
vtkSmartPointer<SVTK_ControllerOnKeyDown> SVTK_InteractorStyle::myControllerOnKeyDown
protected
unsigned long SVTK_InteractorStyle::myCurrFocalPointType
protected
unsigned long SVTK_InteractorStyle::myCurrRotationPointType
protected
bool SVTK_InteractorStyle::myCursorState
protected
QCursor SVTK_InteractorStyle::myDefCursor
protected
QCursor SVTK_InteractorStyle::myGlobalPanCursor
protected
QCursor SVTK_InteractorStyle::myHandCursor
protected
vtkSmartPointer<SVTK_Actor> SVTK_InteractorStyle::myHighlightSelectionPointActor
protected
vtkSmartPointer<SVTK_GenericRenderWindowInteractor> SVTK_InteractorStyle::myInteractor
protected
bool SVTK_InteractorStyle::myIsAdvancedZoomingEnabled
protected
vtkSmartPointer<SALOME_Actor> SVTK_InteractorStyle::myLastHighlitedActor
protected
vtkSmartPointer<SALOME_Actor> SVTK_InteractorStyle::myLastPreHighlitedActor
protected
QPoint SVTK_InteractorStyle::myOtherPoint
protected
QCursor SVTK_InteractorStyle::myPanCursor
protected
QPoint SVTK_InteractorStyle::myPoint
protected
vtkSmartPointer<vtkPointPicker> SVTK_InteractorStyle::myPointPicker
protected
PolygonState SVTK_InteractorStyle::myPoligonState
protected
QtxPolyRubberBand* SVTK_InteractorStyle::myPolygonBand
protected
QVector<QPoint> SVTK_InteractorStyle::myPolygonPoints
protected
unsigned long SVTK_InteractorStyle::myPrevFocalPointType
protected
unsigned long SVTK_InteractorStyle::myPrevRotationPointType
protected
QtxRectRubberBand* SVTK_InteractorStyle::myRectBand
protected
QCursor SVTK_InteractorStyle::myRotateCursor
protected
double SVTK_InteractorStyle::myRotationPointX
protected
double SVTK_InteractorStyle::myRotationPointY
protected
double SVTK_InteractorStyle::myRotationPointZ
protected
double SVTK_InteractorStyle::myScale
protected
PSelectionEvent SVTK_InteractorStyle::mySelectionEvent
protected
bool SVTK_InteractorStyle::myShiftState
protected
int SVTK_InteractorStyle::mySMDecreaseSpeedBtn
protected
int SVTK_InteractorStyle::mySMDominantCombinedSwitchBtn
protected
int SVTK_InteractorStyle::mySMIncreaseSpeedBtn
protected
QCursor SVTK_InteractorStyle::mySpinCursor
protected
QCursor SVTK_InteractorStyle::myZoomCursor
protected
float SVTK_InteractorStyle::RadianToDegree
protected

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