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

VTKViewer_InteractorStyle Class Reference

#include <VTKViewer_InteractorStyle.h>

Inheritance diagram for VTKViewer_InteractorStyle:
Inheritance graph

Public Member Functions

 vtkTypeMacro (VTKViewer_InteractorStyle, vtkInteractorStyle)
virtual void SetInteractor (vtkRenderWindowInteractor *theInteractor)
void setViewWnd (VTKViewer_ViewWindow *theViewWnd)
void setGUIWindow (QWidget *theWindow)
void setTriedron (VTKViewer_Trihedron *theTrihedron)
void setPreselectionProp (const double &theRed=0, const double &theGreen=1, const double &theBlue=1, const int &theWidth=5)
void OnMouseMove (int ctrl, int shift, int x, int y)
void OnLeftButtonDown (int ctrl, int shift, int x, int y)
void OnLeftButtonUp (int ctrl, int shift, int x, int y)
void OnMiddleButtonDown (int ctrl, int shift, int x, int y)
void OnMiddleButtonUp (int ctrl, int shift, int x, int y)
void OnRightButtonDown (int ctrl, int shift, int x, int y)
void OnRightButtonUp (int ctrl, int shift, int x, int y)
void OnSelectionModeChanged ()
void ViewFitAll ()
void SetFilter (const Handle(VTKViewer_Filter)&)
 Handle (VTKViewer_Filter) GetFilter(const int)
bool IsFilterPresent (const int)
void RemoveFilter (const int)
bool IsValid (VTKViewer_Actor *theActor, const int theId, const bool theIsNode=false)
void IncrementalPan (const int incrX, const int incrY)
void IncrementalZoom (const int incr)
void IncrementalRotate (const int incrX, const int incrY)
int CurrentState () const
bool eventFilter (QObject *object, QEvent *event)
void startZoom ()
void startPan ()
void startGlobalPan ()
void startRotate ()
void startFitArea ()
void startSpin ()
void SetTDxStyle (vtkTDxInteractorStyle *tdxStyle)
bool needsRedrawing ()

Static Public Member Functions

static VTKViewer_InteractorStyleNew ()

Protected Member Functions

 VTKViewer_InteractorStyle ()
 ~VTKViewer_InteractorStyle ()
 VTKViewer_InteractorStyle (const VTKViewer_InteractorStyle &)
void operator= (const VTKViewer_InteractorStyle &)
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)
bool IsInRect (vtkActor *theActor, const int left, const int top, const int right, const int bottom)
bool IsInRect (vtkCell *theCell, const int left, const int top, const int right, const int bottom)
bool IsInRect (vtkFloatingPointType *thePoint, const int left, const int top, const int right, const int bottom)
void loadCursors ()
void startOperation (int operation)
virtual void onStartOperation ()
virtual void onFinishOperation ()
virtual void onOperation (QPoint mousePos)
virtual void onCursorMove (QPoint mousePos)
virtual void setCursor (const int operation)
void drawRect ()
void endDrawRect ()
 Delete rubber band on the end on the dragging operation.

Protected Attributes

int State
vtkFloatingPointType MotionFactor
vtkFloatingPointType RadianToDegree
double myScale
VTKViewer_ActormyPreViewActor
VTKViewer_ActormyPreSelectionActor
VTKViewer_ActormySelectedActor
int myElemId
int myEdgeId
int myNodeId
QCursor myDefCursor
QCursor myPanCursor
QCursor myZoomCursor
QCursor myRotateCursor
QCursor mySpinCursor
QCursor myHandCursor
QCursor myGlobalPanCursor
QPoint myPoint
QPoint myOtherPoint
bool myCursorState
bool myShiftState
int ForcedState
VTKViewer_RenderWindowInteractorm_Interactor
VTKViewer_ViewWindowm_ViewWnd
VTKViewer_Trihedronm_Trihedron
QWidgetmyGUIWindow
std::map< int, Handle(VTKViewer_Filter) > myFilters
QRubberBand * myRectBand
 selection rectangle rubber band
members from old version
double DeltaElevation
double DeltaAzimuth
int LastPos [2]

Detailed Description

Description:
This class must be supplied with a vtkRenderWindowInteractor wrapper or
parent. This class should not normally be instantiated by application
programmers.


Constructor & Destructor Documentation

VTKViewer_InteractorStyle::VTKViewer_InteractorStyle ( ) [protected]
VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle ( ) [protected]

Destructor.

VTKViewer_InteractorStyle.VTKViewer_InteractorStyle ( const VTKViewer_InteractorStyle ) [protected]

Member Function Documentation

static VTKViewer_InteractorStyle* VTKViewer_InteractorStyle.New ( ) [static]
VTKViewer_InteractorStyle.vtkTypeMacro ( VTKViewer_InteractorStyle  ,
vtkInteractorStyle   
)
void VTKViewer_InteractorStyle::SetInteractor ( vtkRenderWindowInteractor theInteractor) [virtual]

Set render window interactor

Parameters:
theInteractor- interactor.
void VTKViewer_InteractorStyle::setViewWnd ( VTKViewer_ViewWindow theViewWnd)

Set view window.

Parameters:
theViewWnd- SALOME VTKViewer_ViewWindow

References VTKViewer_ViewWindow.AddActor().

void VTKViewer_InteractorStyle::setGUIWindow ( QWidget theWindow)

Set GUI window.

Parameters:
theWindow- QWidget window.
void VTKViewer_InteractorStyle::setTriedron ( VTKViewer_Trihedron theTrihedron)

Set trihedron.

Parameters:
theTrihedron- SALOME VTKViewer_Trihedron
void VTKViewer_InteractorStyle::setPreselectionProp ( const double &  theRed = 0,
const double &  theGreen = 1,
const double &  theBlue = 1,
const int &  theWidth = 5 
)

Set preselection properties.

Parameters:
theRed- red color.
theGreen- green color.
theBlue- blue color.
theWidth- width..
void VTKViewer_InteractorStyle::OnMouseMove ( int  ctrl,
int  shift,
int  x,
int  y 
)

On mouse move event.

Parameters:
ctrl- CTRL (not used)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate
y- y coordinate

References VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::OnLeftButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
)

On Left button down event.

Parameters:
ctrl- CTRL (on/off - integer 0/1)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate
y- y coordinate

References VTK_INTERACTOR_STYLE_CAMERA_NONE, VTK_INTERACTOR_STYLE_CAMERA_SELECT, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.

void VTKViewer_InteractorStyle::OnLeftButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)

On left button up event.

Parameters:
ctrl- CTRL (not used)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate (not used)
y- y coordinate (not used)

References VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::OnMiddleButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
)

On left button up event.

Parameters:
ctrl- CTRL (on/off - integer 0/1)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate
y- y coordinate

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_PAN.

void VTKViewer_InteractorStyle::OnMiddleButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)

On middle button up event.

Parameters:
ctrl- CTRL (not used)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate (not used)
y- y coordinate (not used)

References VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::OnRightButtonDown ( int  ctrl,
int  shift,
int  x,
int  y 
)

On right button down event.

Parameters:
ctrl- CTRL (on/off - integer 0/1)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate
y- y coordinate

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ROTATE.

void VTKViewer_InteractorStyle::OnRightButtonUp ( int  ctrl,
int  shift,
int  x,
int  y 
)

On right button up event.

Parameters:
ctrl- CTRL (not used)
shift- SHIFT (on/off - integer 0/1)
x- x coordinate (not used)
y- y coordinate (not used)

References VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::OnSelectionModeChanged ( )

called when selection mode changed (!put necessary initialization here!)

void VTKViewer_InteractorStyle::ViewFitAll ( )
void VTKViewer_InteractorStyle::SetFilter ( const Handle(VTKViewer_Filter)&  theFilter)

Set filter theFilter

References VTKViewer_Filter.GetId().

VTKViewer_InteractorStyle.Handle ( VTKViewer_Filter  ) const
bool VTKViewer_InteractorStyle::IsFilterPresent ( const int  theId)

Checks: is filter present (with id theId)

Parameters:
theId- filter id.
void VTKViewer_InteractorStyle::RemoveFilter ( const int  theId)

Remove filter with id theId.

Parameters:
theId- filter id.
bool VTKViewer_InteractorStyle::IsValid ( VTKViewer_Actor theActor,
const int  theId,
const bool  theIsNode = false 
)

Checks: is valid cell(node) with id theId in actor theActor.

Parameters:
theActor- VTKViewer_Actor pointer.
theId- cell id.
theIsNode- boolean flag, if true - node, else - cell.

References Handle().

void VTKViewer_InteractorStyle::IncrementalPan ( const int  incrX,
const int  incrY 
)

Increment pan.

Parameters:
incrX- X coordinate increment.
incrY- Y coordinate increment.
void VTKViewer_InteractorStyle::IncrementalZoom ( const int  incr)

Increment zoom.

Parameters:
incr- zoom increment.
void VTKViewer_InteractorStyle::IncrementalRotate ( const int  incrX,
const int  incrY 
)

Increment rotate.

Parameters:
incrX- X coordinate increment.
incrY- Y coordinate increment.
int VTKViewer_InteractorStyle.CurrentState ( ) const
void VTKViewer_InteractorStyle.operator= ( const VTKViewer_InteractorStyle ) [protected]
void VTKViewer_InteractorStyle::RotateXY ( int  dx,
int  dy 
) [protected]

Rotate camera.

Parameters:
dx-
dy-

References ResetCameraClippingRange().

void VTKViewer_InteractorStyle::PanXY ( int  x,
int  y,
int  oldX,
int  oldY 
) [protected]
void VTKViewer_InteractorStyle::DollyXY ( int  dx,
int  dy 
) [protected]

Move the position of the camera along the direction of projection. (dx,dy)

References ResetCameraClippingRange().

void VTKViewer_InteractorStyle::SpinXY ( int  dx,
int  dy,
int  oldX,
int  oldY 
) [protected]
void VTKViewer_InteractorStyle::fitRect ( const int  left,
const int  top,
const int  right,
const int  bottom 
) [protected]

fits viewer contents to rectangle

Parameters:
left- left side
top- top side
right- right side
bottom- bottom side

References ResetCameraClippingRange().

void VTKViewer_InteractorStyle::Place ( const int  theX,
const int  theY 
) [protected]

called on finsh GlobalPan operation

References ResetCameraClippingRange().

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

Translates view from Point to Point

bool VTKViewer_InteractorStyle::IsInRect ( vtkActor *  theActor,
const int  left,
const int  top,
const int  right,
const int  bottom 
) [protected]

Checks: is the given Actor within display coordinates?

bool VTKViewer_InteractorStyle::IsInRect ( vtkCell *  theCell,
const int  left,
const int  top,
const int  right,
const int  bottom 
) [protected]

Checks: is the given Cell within display coordinates?

bool VTKViewer_InteractorStyle::IsInRect ( vtkFloatingPointType thePoint,
const int  left,
const int  top,
const int  right,
const int  bottom 
) [protected]

Checks: is given point thePoint in rectangle

bool VTKViewer_InteractorStyle::eventFilter ( QObject object,
QEvent event 
)

event filter - controls mouse and keyboard events during viewer operations

References VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::startZoom ( )

starts Zoom operation (e.g. through menu command)

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.

void VTKViewer_InteractorStyle::startPan ( )

starts Pan operation (e.g. through menu command)

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_PAN.

void VTKViewer_InteractorStyle::startGlobalPan ( )

starts Global Panning operation (e.g. through menu command)

References VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, and VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::startRotate ( )

starts Rotate operation (e.g. through menu command)

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ROTATE.

void VTKViewer_InteractorStyle::startFitArea ( )

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

References VTK_INTERACTOR_STYLE_CAMERA_FIT, and VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::startSpin ( )

starts Spin operation (e.g. through menu command)

References VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_SPIN.

void VTKViewer_InteractorStyle.SetTDxStyle ( vtkTDxInteractorStyle *  tdxStyle)
bool VTKViewer_InteractorStyle::needsRedrawing ( )
void VTKViewer_InteractorStyle::loadCursors ( ) [protected]

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

References imageRotateCursor, and imageZoomCursor.

void VTKViewer_InteractorStyle::startOperation ( int  operation) [protected]
void VTKViewer_InteractorStyle::onStartOperation ( ) [protected, virtual]
void VTKViewer_InteractorStyle::onFinishOperation ( ) [protected, virtual]

called when viewer operation finished (!put necessary post-processing here!)

void VTKViewer_InteractorStyle::onOperation ( QPoint  mousePos) [protected, virtual]
void VTKViewer_InteractorStyle::onCursorMove ( QPoint  mousePos) [protected, virtual]

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

void VTKViewer_InteractorStyle::setCursor ( const int  operation) [protected, virtual]
void VTKViewer_InteractorStyle::drawRect ( ) [protected]

Draws rectangle by starting and current points

References Plot2d.Rectangle.

void VTKViewer_InteractorStyle::endDrawRect ( ) [protected]

Field Documentation

QRubberBand* VTKViewer_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