Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

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.
virtual SVTK_SelectionEventGetSelectionEventFlipY ()
 Generate special SVTK_SelectionEvent with flipped Y coordinate.
virtual void SetInteractor (vtkRenderWindowInteractor *)
 Redefined in order to add an observer (callback) for custom event (space mouse event)
virtual void Render ()
 To invoke #vtkRenderWindowInteractor::CreateTimer.
virtual void OnTimer ()
 To implement cached rendering.
virtual void OnConfigure ()
 To reset reset view.
virtual void OnMouseMove ()
 To handle mouse move event.
virtual void OnLeftButtonDown ()
 To handle left mouse button down event (reimplemented from vtkInteractorStyle)
virtual void OnLeftButtonUp ()
 To handle left mouse button up event (reimplemented from vtkInteractorStyle)
virtual void OnMiddleButtonDown ()
 To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
virtual void OnMiddleButtonUp ()
 To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
virtual void OnRightButtonDown ()
 To handle right mouse button down event (reimplemented from vtkInteractorStyle)
virtual void OnRightButtonUp ()
 To handle right mouse button up event (reimplemented from vtkInteractorStyle)
virtual void OnMouseWheelForward ()
 To handle mouse wheel forward event (reimplemented from vtkInteractorStyle)
virtual void OnMouseWheelBackward ()
 To handle mouse wheel backward event (reimplemented from vtkInteractorStyle)
virtual void OnChar ()
 To handle keyboard event (reimplemented from vtkInteractorStyle)
void SetControllerIncrement (SVTK_ControllerIncrement *)
 To set current increment controller.
void SetIncrementSpeed (const int, const int=0)
 To modify current increment controller.
SVTK_ControllerIncrementControllerIncrement ()
 To get current increment controller.
virtual void OnKeyDown ()
 Redefine vtkInteractorStyle.OnKeyDown.
void ActionPicking ()
 Provide instructions for Picking.
void SetControllerOnKeyDown (SVTK_ControllerOnKeyDown *)
 To set current OnKeyDown controller.
SVTK_ControllerOnKeyDownControllerOnKeyDown ()
 To get current OnKeyDown controller.
SVTK_SelectorGetSelector ()
int CurrentState () const
void SetAdvancedZoomingEnabled (const bool theState)
bool IsAdvancedZoomingEnabled () const

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.

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
vtkSmartPointer
< SVTK_ControllerOnKeyDown
myControllerOnKeyDown
 controls the behaviour of KeyDown event in SALOME way
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
vtkFloatingPointType myBBCenter [3]
bool myBBFirstCheck
QRubberBand * myRectBand
 selection rectangle rubber band
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]
SVTK_InteractorStyle::~SVTK_InteractorStyle ( ) [protected]

Destructor

References endDrawRect().


Member Function Documentation

static SVTK_InteractorStyle* SVTK_InteractorStyle.New ( ) [static]

Reimplemented in SVTK_KeyFreeInteractorStyle.

SVTK_InteractorStyle.vtkTypeMacro ( SVTK_InteractorStyle  ,
vtkInteractorStyle   
)
void SVTK_InteractorStyle.SetTDxStyle ( vtkTDxInteractorStyle *  )
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().

void SVTK_InteractorStyle::SetInteractor ( vtkRenderWindowInteractor theInteractor) [virtual]
void SVTK_InteractorStyle::Render ( ) [virtual]

To invoke #vtkRenderWindowInteractor::CreateTimer

void SVTK_InteractorStyle::OnTimer ( ) [virtual]

To implement cached rendering

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

void SVTK_InteractorStyle::OnConfigure ( ) [virtual]

To reset reset view

void SVTK_InteractorStyle::OnMouseMove ( ) [virtual]

To handle mouse move event

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)

void SVTK_InteractorStyle::OnMiddleButtonDown ( ) [virtual]

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

void SVTK_InteractorStyle::OnMiddleButtonUp ( ) [virtual]

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

void SVTK_InteractorStyle::OnRightButtonDown ( ) [virtual]

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

void SVTK_InteractorStyle::OnRightButtonUp ( ) [virtual]

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

void SVTK_InteractorStyle::OnMouseWheelForward ( ) [virtual]

References myOtherPoint.

void SVTK_InteractorStyle::OnMouseWheelBackward ( ) [virtual]

References myOtherPoint.

void SVTK_InteractorStyle::OnChar ( ) [virtual]
void SVTK_InteractorStyle::SetControllerIncrement ( SVTK_ControllerIncrement theController)

To set current increment controller

References myControllerIncrement.

void SVTK_InteractorStyle::SetIncrementSpeed ( const int  theValue,
const int  theMode = 0 
)

To modify current increment controller

References test_table.c, New(), SetControllerIncrement(), and SVTK_ControllerIncrement.SetStartValue().

SVTK_ControllerIncrement * SVTK_InteractorStyle::ControllerIncrement ( )

To get current increment controller

References myControllerIncrement.

void SVTK_InteractorStyle::OnKeyDown ( ) [virtual]

Redefined vtkInteractorStyle.OnKeyDown

References myControllerOnKeyDown.

void SVTK_InteractorStyle::ActionPicking ( )
void SVTK_InteractorStyle::SetControllerOnKeyDown ( SVTK_ControllerOnKeyDown theController)

To set current increment controller

References myControllerOnKeyDown.

SVTK_ControllerOnKeyDown * SVTK_InteractorStyle::ControllerOnKeyDown ( )

To get current OnKeyDown controller

References myControllerOnKeyDown.

SVTK_Selector * SVTK_InteractorStyle::GetSelector ( )
Returns:
selector

References myInteractor.

int SVTK_InteractorStyle.CurrentState ( ) const
void SVTK_InteractorStyle.SetAdvancedZoomingEnabled ( const bool  theState)
bool SVTK_InteractorStyle.IsAdvancedZoomingEnabled ( ) const
QWidget * SVTK_InteractorStyle::GetRenderWidget ( ) [protected]
Returns:
widget for rendering

References myInteractor.

virtual void SVTK_InteractorStyle.OnMouseMove ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]
void SVTK_InteractorStyle::OnLeftButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]
virtual void SVTK_InteractorStyle.OnLeftButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::OnMiddleButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]
virtual void SVTK_InteractorStyle.OnMiddleButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]

Reimplemented in SVTK_KeyFreeInteractorStyle.

void SVTK_InteractorStyle::OnRightButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]
virtual void SVTK_InteractorStyle.OnRightButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
) [protected, virtual]
void SVTK_InteractorStyle::RotateXY ( int  dx,
int  dy 
) [protected]
void SVTK_InteractorStyle::PanXY ( int  x,
int  y,
int  oldX,
int  oldY 
) [protected]

References Render(), and TranslateView().

void SVTK_InteractorStyle::DollyXY ( int  dx,
int  dy 
) [protected]
void SVTK_InteractorStyle::SpinXY ( int  dx,
int  dy,
int  oldX,
int  oldY 
) [protected]

References RadianToDegree, and Render().

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::Place ( const int  theX,
const int  theY 
) [protected]

Called on finsh GlobalPan operation

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

void SVTK_InteractorStyle::TranslateView ( int  toX,
int  toY,
int  fromX,
int  fromY 
) [protected]

Translates view from Point to Point

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

References PanXY().

void SVTK_InteractorStyle::IncrementalZoom ( const int  incr) [protected]

References DollyXY().

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

References RotateXY().

void SVTK_InteractorStyle::ProcessEvents ( vtkObject object,
unsigned long  event,
void *  clientData,
void *  callData 
) [static, protected]
void SVTK_InteractorStyle::startZoom ( ) [protected]
void SVTK_InteractorStyle::startPan ( ) [protected]
void SVTK_InteractorStyle::startGlobalPan ( ) [protected]
void SVTK_InteractorStyle::startRotate ( ) [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::startSpin ( ) [protected]
void SVTK_InteractorStyle::startPointSelection ( ) [protected]
void SVTK_InteractorStyle::startFocalPointSelection ( ) [protected]
void SVTK_InteractorStyle::loadCursors ( ) [protected]

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

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

void SVTK_InteractorStyle::startOperation ( int  operation) [protected]
void SVTK_InteractorStyle::onStartOperation ( ) [protected]
void SVTK_InteractorStyle::onFinishOperation ( ) [protected, virtual]
void SVTK_InteractorStyle::onOperation ( QPoint  mousePos) [protected]
void SVTK_InteractorStyle::onCursorMove ( QPoint  mousePos) [protected]
void SVTK_InteractorStyle::setCursor ( const int  operation) [protected]
void SVTK_InteractorStyle::onSpaceMouseMove ( double *  data) [protected]
void SVTK_InteractorStyle::onSpaceMouseButton ( int  button) [protected, virtual]
void SVTK_InteractorStyle::DominantCombinedSwitch ( ) [protected]
void SVTK_InteractorStyle::drawRect ( ) [protected]

Draws rectangle by starting and current points

References GetRenderWidget(), SUIT_Tools.makeRect(), myOtherPoint, myPoint, myRectBand, and Plot2d.Rectangle.

void SVTK_InteractorStyle::endDrawRect ( ) [protected]

References myRectBand.


Field Documentation

double SVTK_InteractorStyle.myScale [protected]
QCursor SVTK_InteractorStyle.myDefCursor [protected]
QCursor SVTK_InteractorStyle.myPanCursor [protected]
QCursor SVTK_InteractorStyle.myZoomCursor [protected]
QCursor SVTK_InteractorStyle.mySpinCursor [protected]
QCursor SVTK_InteractorStyle.myHandCursor [protected]
QPoint SVTK_InteractorStyle.myPoint [protected]
unsigned long SVTK_InteractorStyle.myCurrFocalPointType [protected]
unsigned long SVTK_InteractorStyle.myPrevFocalPointType [protected]
vtkSmartPointer<vtkPointPicker> SVTK_InteractorStyle.myPointPicker [protected]
QRubberBand* SVTK_InteractorStyle.myRectBand [protected]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS