Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ViewFitSelection ()
 
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 (double *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. More...
 

Protected Attributes

int State
 
double MotionFactor
 
double 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 More...
 
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 ( const VTKViewer_InteractorStyle )
inlineprotected

Member Function Documentation

int VTKViewer_InteractorStyle::CurrentState ( ) const
inline
void VTKViewer_InteractorStyle::DollyXY ( int  dx,
int  dy 
)
protected

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

References MotionFactor, myGUIWindow, and ResetCameraClippingRange().

void VTKViewer_InteractorStyle::drawRect ( )
protected

Draws rectangle by starting and current points

References myGUIWindow, myOtherPoint, myPoint, myRectBand, and Plot2d::Rectangle.

void VTKViewer_InteractorStyle::endDrawRect ( )
protected

References myRectBand.

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

event filter - controls mouse and keyboard events during viewer operations

References myGUIWindow, startOperation(), and VTK_INTERACTOR_STYLE_CAMERA_NONE.

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 myGUIWindow, ResetCameraClippingRange(), and TranslateView().

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

Increment pan.

Parameters
incrX- X coordinate increment.
incrY- Y coordinate increment.

References PanXY().

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

Increment rotate.

Parameters
incrX- X coordinate increment.
incrY- Y coordinate increment.

References RotateXY().

void VTKViewer_InteractorStyle::IncrementalZoom ( const int  incr)

Increment zoom.

Parameters
incr- zoom increment.

References DollyXY().

bool VTKViewer_InteractorStyle::IsFilterPresent ( const int  theId)

Checks: is filter present (with id theId)

Parameters
theId- filter id.

References myFilters.

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 ( double *  thePoint,
const int  left,
const int  top,
const int  right,
const int  bottom 
)
protected

Checks: is given point thePoint in rectangle

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(), and myFilters.

void VTKViewer_InteractorStyle::loadCursors ( )
protected

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

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

bool VTKViewer_InteractorStyle::needsRedrawing ( )
static VTKViewer_InteractorStyle* VTKViewer_InteractorStyle::New ( )
static
void VTKViewer_InteractorStyle::onCursorMove ( QPoint  mousePos)
protectedvirtual

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

void VTKViewer_InteractorStyle::onFinishOperation ( )
protectedvirtual

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

References myGUIWindow.

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 ForcedState, myOtherPoint, myPoint, myShiftState, onFinishOperation(), startOperation(), State, 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 myShiftState, onFinishOperation(), startOperation(), State, and 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 ForcedState, myOtherPoint, myPoint, myShiftState, onFinishOperation(), startOperation(), State, 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 myShiftState, onFinishOperation(), startOperation(), State, and VTK_INTERACTOR_STYLE_CAMERA_NONE.

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 ForcedState, myShiftState, onCursorMove(), onOperation(), State, and 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 ForcedState, myOtherPoint, myPoint, myShiftState, onFinishOperation(), startOperation(), State, 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 myShiftState, onFinishOperation(), startOperation(), State, and VTK_INTERACTOR_STYLE_CAMERA_NONE.

void VTKViewer_InteractorStyle::OnSelectionModeChanged ( )

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

References myEdgeId, myElemId, myNodeId, myPreSelectionActor, and mySelectedActor.

void VTKViewer_InteractorStyle::onStartOperation ( )
protectedvirtual
void VTKViewer_InteractorStyle::operator= ( const VTKViewer_InteractorStyle )
inlineprotected
void VTKViewer_InteractorStyle::PanXY ( int  x,
int  y,
int  oldX,
int  oldY 
)
protected

References myGUIWindow, and TranslateView().

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

called on finsh GlobalPan operation

References myGUIWindow, myScale, ResetCameraClippingRange(), and TranslateView().

void VTKViewer_InteractorStyle::RemoveFilter ( const int  theId)

Remove filter with id theId.

Parameters
theId- filter id.

References IsFilterPresent(), and myFilters.

void VTKViewer_InteractorStyle::RotateXY ( int  dx,
int  dy 
)
protected

Rotate camera.

Parameters
dx-
dy-

References DeltaAzimuth, DeltaElevation, MotionFactor, myGUIWindow, and ResetCameraClippingRange().

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

Set filter theFilter

References VTKViewer_Filter::GetId(), and myFilters.

void VTKViewer_InteractorStyle::setGUIWindow ( QWidget theWindow)

Set GUI window.

Parameters
theWindow- QWidget window.

References myGUIWindow.

void VTKViewer_InteractorStyle::SetInteractor ( vtkRenderWindowInteractor theInteractor)
virtual

Set render window interactor

Parameters
theInteractor- interactor.

References m_Interactor.

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..

References myPreSelectionActor, and VTKViewer_Actor::SetColor().

void VTKViewer_InteractorStyle::SetTDxStyle ( vtkTDxInteractorStyle *  tdxStyle)
inline
void VTKViewer_InteractorStyle::setTriedron ( VTKViewer_Trihedron theTrihedron)

Set trihedron.

Parameters
theTrihedron- SALOME VTKViewer_Trihedron

References m_Trihedron.

void VTKViewer_InteractorStyle::setViewWnd ( VTKViewer_ViewWindow theViewWnd)

Set view window.

Parameters
theViewWnd- SALOME VTKViewer_ViewWindow

References VTKViewer_ViewWindow::AddActor(), m_ViewWnd, and myPreSelectionActor.

void VTKViewer_InteractorStyle::SpinXY ( int  dx,
int  dy,
int  oldX,
int  oldY 
)
protected

References myGUIWindow, and RadianToDegree.

void VTKViewer_InteractorStyle::startFitArea ( )

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

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

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

Translates view from Point to Point

void VTKViewer_InteractorStyle::ViewFitSelection ( )
VTKViewer_InteractorStyle::vtkTypeMacro ( VTKViewer_InteractorStyle  ,
vtkInteractorStyle   
)

Member Data Documentation

double VTKViewer_InteractorStyle::DeltaAzimuth
protected
double VTKViewer_InteractorStyle::DeltaElevation
protected
int VTKViewer_InteractorStyle::ForcedState
protected
int VTKViewer_InteractorStyle::LastPos[2]
protected
VTKViewer_RenderWindowInteractor* VTKViewer_InteractorStyle::m_Interactor
protected
VTKViewer_Trihedron* VTKViewer_InteractorStyle::m_Trihedron
protected
VTKViewer_ViewWindow* VTKViewer_InteractorStyle::m_ViewWnd
protected
double VTKViewer_InteractorStyle::MotionFactor
protected
bool VTKViewer_InteractorStyle::myCursorState
protected
QCursor VTKViewer_InteractorStyle::myDefCursor
protected
int VTKViewer_InteractorStyle::myEdgeId
protected
int VTKViewer_InteractorStyle::myElemId
protected
std::map<int, Handle(VTKViewer_Filter) > VTKViewer_InteractorStyle::myFilters
protected
QCursor VTKViewer_InteractorStyle::myGlobalPanCursor
protected
QWidget* VTKViewer_InteractorStyle::myGUIWindow
protected
QCursor VTKViewer_InteractorStyle::myHandCursor
protected
int VTKViewer_InteractorStyle::myNodeId
protected
QPoint VTKViewer_InteractorStyle::myOtherPoint
protected
QCursor VTKViewer_InteractorStyle::myPanCursor
protected
QPoint VTKViewer_InteractorStyle::myPoint
protected
VTKViewer_Actor * VTKViewer_InteractorStyle::myPreSelectionActor
protected
VTKViewer_Actor* VTKViewer_InteractorStyle::myPreViewActor
protected
QRubberBand* VTKViewer_InteractorStyle::myRectBand
protected
QCursor VTKViewer_InteractorStyle::myRotateCursor
protected
double VTKViewer_InteractorStyle::myScale
protected
VTKViewer_Actor * VTKViewer_InteractorStyle::mySelectedActor
protected
bool VTKViewer_InteractorStyle::myShiftState
protected
QCursor VTKViewer_InteractorStyle::mySpinCursor
protected
QCursor VTKViewer_InteractorStyle::myZoomCursor
protected
double VTKViewer_InteractorStyle::RadianToDegree
protected
int VTKViewer_InteractorStyle::State
protected

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