Introduce SALOME way of user interaction. More...
#include <SVTK_InteractorStyle.h>
Public Types | |
typedef boost::shared_ptr < SVTK_SelectionEvent > | PSelectionEvent |
Public Member Functions | |
vtkTypeMacro (SVTK_InteractorStyle, vtkInteractorStyle) | |
void | SetTDxStyle (vtkTDxInteractorStyle *) |
virtual SVTK_SelectionEvent * | GetSelectionEvent () |
Generate special SVTK_SelectionEvent. More... | |
virtual SVTK_SelectionEvent * | GetSelectionEventFlipY () |
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_ControllerIncrement * | ControllerIncrement () |
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_ControllerOnKeyDown * | ControllerOnKeyDown () |
To get current OnKeyDown controller. More... | |
SVTK_Selector * | GetSelector () |
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_InteractorStyle * | New () |
Protected Member Functions | |
SVTK_InteractorStyle () | |
~SVTK_InteractorStyle () | |
QWidget * | GetRenderWidget () |
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) |
This class defines SALOME way of user interaction for VTK viewer, as well, as introduce a new selection mechanism
typedef boost::shared_ptr<SVTK_SelectionEvent> SVTK_InteractorStyle::PSelectionEvent |
|
protected |
Constructor
References ForcedState, loadCursors(), MotionFactor, myBBFirstCheck, myControllerIncrement, myControllerOnKeyDown, myCurrFocalPointType, myCurrRotationPointType, myHighlightSelectionPointActor, myPointPicker, myPrevFocalPointType, myPrevRotationPointType, mySMDecreaseSpeedBtn, mySMDominantCombinedSwitchBtn, mySMIncreaseSpeedBtn, ProcessEvents(), RadianToDegree, SALOME_LINE_WIDTH, SALOME_POINT_SIZE, SVTK::SetFocalPointSelected, SVTK::SetRotateGravity, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
Destructor
References endDrawPolygon(), and endDrawRect().
void SVTK_InteractorStyle::ActionPicking | ( | ) |
Provide instructions for Picking
References myOtherPoint, myPoint, onFinishOperation(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_SELECT.
SVTK_ControllerIncrement * SVTK_InteractorStyle::ControllerIncrement | ( | ) |
To get current increment controller
References myControllerIncrement.
SVTK_ControllerOnKeyDown * SVTK_InteractorStyle::ControllerOnKeyDown | ( | ) |
To get current OnKeyDown controller
References myControllerOnKeyDown.
|
inline |
|
protected |
References IsAdvancedZoomingEnabled(), MotionFactor, myOtherPoint, SVTK::OperationFinished, Render(), and TranslateView().
|
protected |
|
protected |
Draws polygon
References Closed, GetRenderWidget(), QtxPolyRubberBand::initGeometry(), InProcess, isValid(), myOtherPoint, myPoint, myPoligonState, myPolygonBand, myPolygonPoints, and NotValid.
|
protected |
Draws rectangle by starting and current points
References GetRenderWidget(), QtxRectRubberBand::initGeometry(), SUIT_Tools::makeRect(), myOtherPoint, myPoint, and myRectBand.
|
protected |
References myPolygonBand, and myPolygonPoints.
|
protected |
References QtxRectRubberBand::clearGeometry(), and myRectBand.
|
protected |
Fits viewer contents to rect
References Render(), and TranslateView().
void SVTK_InteractorStyle::FreeActors | ( | ) |
Realeaze actors
References myLastHighlitedActor, and myLastPreHighlitedActor.
|
inline |
|
protected |
References myInteractor.
|
virtual |
Generate special SVTK_SelectionEvent
References GetSelector(), mySelectionEvent, and SVTK_Selector::SelectionMode().
|
virtual |
Generate special SVTK_SelectionEvent with flipped Y coordinate
References GetSelector(), mySelectionEvent, and SVTK_Selector::SelectionMode().
SVTK_Selector * SVTK_InteractorStyle::GetSelector | ( | ) |
References myInteractor.
References PanXY().
References RotateXY().
|
inline |
|
protected |
loads cursors for viewer operations - zoom, pan, etc...
References myCursorState, myDefCursor, myGlobalPanCursor, myHandCursor, myPanCursor, myRotateCursor, mySpinCursor, and myZoomCursor.
|
static |
|
virtual |
Reimplemented in SVTK_KeyFreeInteractorStyle.
References ControllerIncrement(), SVTK_ControllerIncrement::Decrease(), and SVTK_ControllerIncrement::Increase().
|
virtual |
To reset reset view
|
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.
|
protectedvirtual |
Called when viewer operation finished (!put necessary post-processing here!)
References SVTK_Selector::ClearIObjects(), Closed, endDrawPolygon(), endDrawRect(), SVTK_Selector::EndPickCallback(), fitRect(), VTK::ActorCollectionCopy::GetActors(), GetRenderWidget(), GetSelectionEventFlipY(), GetSelector(), InProcess, SVTK_SelectionEvent::myIsPolygon, SVTK_SelectionEvent::myIsRectangle, myLastHighlitedActor, myOtherPoint, myPoint, myPoligonState, SVTK_SelectionEvent::myPolygonPoints, myShiftState, SVTK_SelectionEvent::myX, SVTK_SelectionEvent::myY, SVTK_Selector::Pick(), Place(), Render(), SVTK_Selector::StartPickCallback(), VTK_INTERACTOR_STYLE_CAMERA_FIT, VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
virtual |
Redefined vtkInteractorStyle::OnKeyDown
References myControllerOnKeyDown.
|
virtual |
To handle left mouse button down event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
To handle left mouse button down event (reimplemented from vtkInteractorStyle)
Reimplemented in SVTK_KeyFreeInteractorStyle.
References ActorSelection, Disable, EdgeSelection, FaceSelection, SVTK::FocalPointChanged, ForcedState, GetRenderWidget(), GetSelectionEventFlipY(), GetSelector(), myCurrFocalPointType, myCurrRotationPointType, myDefCursor, myHighlightSelectionPointActor, myOtherPoint, myPoint, myPointPicker, myPoligonState, myPrevFocalPointType, myPrevRotationPointType, myShiftState, SVTK_SelectionEvent::myX, SVTK_SelectionEvent::myY, NodeSelection, onFinishOperation(), SVTK_Selector::Pick(), SVTK::RotationPointChanged, SVTK_Selector::SelectionMode(), SVTK::SetFocalPointSelected, SVTK::SetRotateSelected, SVTK_Selector::SetSelectionMode(), SVTK::StartFocalPointSelection, startOperation(), SVTK::StartPointSelection, VolumeSelection, VTK_INTERACTOR_STYLE_CAMERA_NONE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
virtual |
To handle left mouse button up event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
Reimplemented in SVTK_KeyFreeInteractorStyle.
|
virtual |
To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
Reimplemented in SVTK_KeyFreeInteractorStyle.
References Disable, ForcedState, myOtherPoint, myPoint, myPoligonState, myShiftState, onFinishOperation(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_PAN.
|
virtual |
To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
Reimplemented in SVTK_KeyFreeInteractorStyle.
|
virtual |
To handle mouse double click event
References Finished, InProcess, myPoligonState, and onFinishOperation().
|
virtual |
To handle mouse move event
|
protectedvirtual |
Reimplemented in SVTK_KeyFreeInteractorStyle.
|
virtual |
References myOtherPoint.
|
virtual |
References myOtherPoint.
|
protected |
Called during viewer operation when user moves mouse (!put necessary processing here!)
References Closed, DollyXY(), drawPolygon(), drawRect(), Finished, GetRenderWidget(), InProcess, myCursorState, myOtherPoint, myPoint, myPoligonState, NotValid, PanXY(), RotateXY(), setCursor(), SpinXY(), VTK_INTERACTOR_STYLE_CAMERA_FIT, VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
virtual |
To handle right mouse button down event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
To handle right mouse button down event (reimplemented from vtkInteractorStyle)
Reimplemented in SVTK_KeyFreeInteractorStyle.
References ForcedState, myOtherPoint, myPoint, myPoligonState, mySelectionEvent, myShiftState, onFinishOperation(), Start, startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ROTATE.
|
virtual |
To handle right mouse button up event (reimplemented from vtkInteractorStyle)
|
protectedvirtual |
Reimplemented in SVTK_KeyFreeInteractorStyle.
|
protectedvirtual |
|
protected |
References IncrementalPan(), IncrementalRotate(), and IncrementalZoom().
|
protected |
Called when viewer operation started (!put necessary initialization here!)
References drawPolygon(), drawRect(), GetRenderWidget(), InProcess, myPoligonState, VTK_INTERACTOR_STYLE_CAMERA_FIT, VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
virtual |
To implement cached rendering
References SVTK::BBCenterChanged, ComputeBBCenter(), myBBCenter, and myBBFirstCheck.
|
protected |
References SVTK::OperationFinished, Render(), and TranslateView().
Called on finsh GlobalPan operation
References myScale, Render(), and TranslateView().
|
staticprotected |
Main process event method (reimplemented from vtkInteractorStyle)
References SVTK::BBCenterChanged, SVTK::ChangeRotationPoint, ComputeBBCenter(), ControllerIncrement(), SVTK_ControllerIncrement::Current(), SVTK::FocalPointChanged, SVTK::MinusSpeedIncrementEvent, SVTK::PanDownEvent, SVTK::PanLeftEvent, SVTK::PanRightEvent, SVTK::PanUpEvent, SVTK::PlusSpeedIncrementEvent, SVTK::RotateDownEvent, SVTK::RotateLeftEvent, SVTK::RotateRightEvent, SVTK::RotateUpEvent, SVTK::SetFocalPointGravity, SVTK::SetFocalPointSelected, SVTK::SetRotateGravity, SVTK::SetRotateSelected, SVTK::SetSMDecreaseSpeedEvent, SVTK::SetSMDominantCombinedSwitchEvent, SVTK::SetSMIncreaseSpeedEvent, SVTK::SetSpeedIncrementEvent, SVTK::SpaceMouseButtonEvent, SVTK::SpaceMouseMoveEvent, SVTK::StartFitArea, SVTK::StartFocalPointSelection, SVTK::StartGlobalPan, SVTK::StartPan, SVTK::StartPointSelection, SVTK::StartRotate, SVTK::StartZoom, SVTK::ZoomInEvent, and SVTK::ZoomOutEvent.
|
virtual |
To invoke #vtkRenderWindowInteractor::CreateTimer
|
protected |
|
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.
|
protected |
Sets proper cursor for window when viewer operation is activated
References GetRenderWidget(), myCurrFocalPointType, myCurrRotationPointType, myCursorState, myDefCursor, myGlobalPanCursor, myHandCursor, myPanCursor, myRotateCursor, mySpinCursor, myZoomCursor, SVTK::StartFocalPointSelection, SVTK::StartPointSelection, VTK_INTERACTOR_STYLE_CAMERA_FIT, VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, VTK_INTERACTOR_STYLE_CAMERA_NONE, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
To modify current increment controller
References SVTK_ControllerIncrement::New(), SVTK_GeomControllerIncrement::New(), SetControllerIncrement(), and SVTK_ControllerIncrement::SetStartValue().
|
virtual |
Redefined in order to add an observer (callback) for custorm event (space mouse event)
References SVTK::ChangeRotationPoint, SVTK::MinusSpeedIncrementEvent, myInteractor, SVTK::PanDownEvent, SVTK::PanLeftEvent, SVTK::PanRightEvent, SVTK::PanUpEvent, SVTK::PlusSpeedIncrementEvent, SVTK::RotateDownEvent, SVTK::RotateLeftEvent, SVTK::RotateRightEvent, SVTK::RotateUpEvent, SVTK::SetFocalPointGravity, SVTK::SetFocalPointSelected, SVTK::SetRotateGravity, SVTK::SetSMDecreaseSpeedEvent, SVTK::SetSMDominantCombinedSwitchEvent, SVTK::SetSMIncreaseSpeedEvent, SVTK::SetSpeedIncrementEvent, SVTK::SpaceMouseButtonEvent, SVTK::SpaceMouseMoveEvent, SVTK::StartFitArea, SVTK::StartFocalPointSelection, SVTK::StartGlobalPan, SVTK::StartPan, SVTK::StartPointSelection, SVTK::StartRotate, SVTK::StartZoom, SVTK::ZoomInEvent, and SVTK::ZoomOutEvent.
|
inline |
|
inline |
|
protected |
References SVTK::OperationFinished, RadianToDegree, and Render().
|
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.
|
protected |
Set focal point selected by user
References myCurrFocalPointType, myHighlightSelectionPointActor, setCursor(), SVTK::StartFocalPointSelection, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
Starts Global Panning operation (e.g. through menu command)
References ForcedState, myScale, onFinishOperation(), Render(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
Starts viewer operation (!internal usage!)
References ForcedState, onStartOperation(), setCursor(), VTK_INTERACTOR_STYLE_CAMERA_FIT, VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, VTK_INTERACTOR_STYLE_CAMERA_NONE, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
protected |
Starts Pan operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_PAN.
|
protected |
Set rotation point selected by user
References myCurrRotationPointType, myHighlightSelectionPointActor, setCursor(), SVTK::StartPointSelection, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
Starts Rotate operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ROTATE.
|
protected |
Starts Spin operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_SPIN.
|
protected |
Starts Zoom operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
protected |
Translates view from Point to Point
SVTK_InteractorStyle::vtkTypeMacro | ( | SVTK_InteractorStyle | , |
vtkInteractorStyle | |||
) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |