#include <VTKViewer_InteractorStyle.h>
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_InteractorStyle * | New () |
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_Actor * | myPreViewActor |
VTKViewer_Actor * | myPreSelectionActor |
VTKViewer_Actor * | mySelectedActor |
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_RenderWindowInteractor * | m_Interactor |
VTKViewer_ViewWindow * | m_ViewWnd |
VTKViewer_Trihedron * | m_Trihedron |
QWidget * | myGUIWindow |
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] |
Description:
This class must be supplied with a vtkRenderWindowInteractor wrapper or
parent. This class should not normally be instantiated by application
programmers.
|
protected |
Constructor.
References ForcedState, loadCursors(), m_Trihedron, MotionFactor, myPreSelectionActor, myRectBand, VTKViewer_Actor::New(), OnSelectionModeChanged(), RadianToDegree, VTKViewer_Actor::SetColor(), State, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
Destructor.
References endDrawRect(), m_ViewWnd, myPreSelectionActor, and VTKViewer_ViewWindow::RemoveActor().
|
inlineprotected |
|
inline |
|
protected |
Move the position of the camera along the direction of projection. (dx,dy)
References MotionFactor, myGUIWindow, and ResetCameraClippingRange().
|
protected |
Draws rectangle by starting and current points
References myGUIWindow, myOtherPoint, myPoint, myRectBand, and Plot2d::Rectangle.
|
protected |
References myRectBand.
event filter - controls mouse and keyboard events during viewer operations
References myGUIWindow, startOperation(), and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
fits viewer contents to rectangle
left | - left side |
top | - top side |
right | - right side |
bottom | - bottom side |
References myGUIWindow, ResetCameraClippingRange(), and TranslateView().
VTKViewer_InteractorStyle::Handle | ( | VTKViewer_Filter | ) | const |
Increment pan.
incrX | - X coordinate increment. |
incrY | - Y coordinate increment. |
References PanXY().
Increment rotate.
incrX | - X coordinate increment. |
incrY | - Y coordinate increment. |
References RotateXY().
void VTKViewer_InteractorStyle::IncrementalZoom | ( | const int | incr | ) |
bool VTKViewer_InteractorStyle::IsFilterPresent | ( | const int | theId | ) |
|
protected |
Checks: is the given Actor within display coordinates?
|
protected |
Checks: is the given Cell within display coordinates?
|
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.
theActor | - VTKViewer_Actor pointer. |
theId | - cell id. |
theIsNode | - boolean flag, if true - node, else - cell. |
|
protected |
Loads cursors for viewer operations - zoom, pan, etc...
References myCursorState, myDefCursor, myGlobalPanCursor, myHandCursor, myPanCursor, myRotateCursor, mySpinCursor, and myZoomCursor.
bool VTKViewer_InteractorStyle::needsRedrawing | ( | ) |
\c | true if needs redrawing |
References State, VTK_INTERACTOR_STYLE_CAMERA_NONE, VTK_INTERACTOR_STYLE_CAMERA_PAN, VTK_INTERACTOR_STYLE_CAMERA_ROTATE, VTK_INTERACTOR_STYLE_CAMERA_SPIN, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
static |
|
protectedvirtual |
called when user moves mouse inside viewer window and there is no active viewer operation
(!put necessary processing here!)
|
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.
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.
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.
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.
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.
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.
|
protectedvirtual |
called during viewer operation when user moves mouse (!put necessary processing here!)
References DollyXY(), drawRect(), LastPos, myCursorState, myGUIWindow, myOtherPoint, myPoint, PanXY(), RotateXY(), setCursor(), SpinXY(), State, 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.
void VTKViewer_InteractorStyle::OnRightButtonDown | ( | int | ctrl, |
int | shift, | ||
int | x, | ||
int | y | ||
) |
On right button down event.
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.
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.
|
protectedvirtual |
called when viewer operation started (!put necessary initialization here!)
References drawRect(), myGUIWindow, State, 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.
|
inlineprotected |
|
protected |
References myGUIWindow, and TranslateView().
called on finsh GlobalPan operation
References myGUIWindow, myScale, ResetCameraClippingRange(), and TranslateView().
void VTKViewer_InteractorStyle::RemoveFilter | ( | const int | theId | ) |
Remove filter with id theId.
theId | - filter id. |
References IsFilterPresent(), and myFilters.
|
protected |
Rotate camera.
dx | - |
dy | - |
References DeltaAzimuth, DeltaElevation, MotionFactor, myGUIWindow, and ResetCameraClippingRange().
|
protectedvirtual |
sets proper cursor for window when viewer operation is activated
References myCursorState, myDefCursor, myGlobalPanCursor, myGUIWindow, myHandCursor, myPanCursor, myRotateCursor, mySpinCursor, myZoomCursor, 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.
void VTKViewer_InteractorStyle::SetFilter | ( | const Handle(VTKViewer_Filter)& | theFilter | ) |
Set filter theFilter
References VTKViewer_Filter::GetId(), and myFilters.
void VTKViewer_InteractorStyle::setGUIWindow | ( | QWidget * | theWindow | ) |
|
virtual |
void VTKViewer_InteractorStyle::setPreselectionProp | ( | const double & | theRed = 0 , |
const double & | theGreen = 1 , |
||
const double & | theBlue = 1 , |
||
const int & | theWidth = 5 |
||
) |
Set preselection properties.
theRed | - red color. |
theGreen | - green color. |
theBlue | - blue color. |
theWidth | - width.. |
References myPreSelectionActor, and VTKViewer_Actor::SetColor().
|
inline |
void VTKViewer_InteractorStyle::setTriedron | ( | VTKViewer_Trihedron * | theTrihedron | ) |
void VTKViewer_InteractorStyle::setViewWnd | ( | VTKViewer_ViewWindow * | theViewWnd | ) |
Set view window.
theViewWnd | - SALOME VTKViewer_ViewWindow |
References VTKViewer_ViewWindow::AddActor(), m_ViewWnd, and myPreSelectionActor.
|
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 | ( | ) |
starts Global Panning operation (e.g. through menu command)
References ForcedState, myGUIWindow, myScale, onFinishOperation(), setCursor(), startOperation(), State, ViewFitAll(), VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN, and VTK_INTERACTOR_STYLE_CAMERA_NONE.
|
protected |
starts viewer operation (!internal usage!)
References ForcedState, onStartOperation(), setCursor(), State, 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.
void VTKViewer_InteractorStyle::startPan | ( | ) |
starts Pan operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), State, VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_PAN.
void VTKViewer_InteractorStyle::startRotate | ( | ) |
starts Rotate operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), State, VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ROTATE.
void VTKViewer_InteractorStyle::startSpin | ( | ) |
starts Spin operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), State, VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_SPIN.
void VTKViewer_InteractorStyle::startZoom | ( | ) |
starts Zoom operation (e.g. through menu command)
References ForcedState, onFinishOperation(), setCursor(), startOperation(), State, VTK_INTERACTOR_STYLE_CAMERA_NONE, and VTK_INTERACTOR_STYLE_CAMERA_ZOOM.
|
protected |
Translates view from Point to Point
void VTKViewer_InteractorStyle::ViewFitAll | ( | ) |
View fit all.
References VTKViewer_Trihedron::eOn, VTKViewer_Trihedron::eOnlyLineOn, VTKViewer_Trihedron::GetVisibility(), VTKViewer_Trihedron::GetVisibleActorCount(), m_Trihedron, ResetCamera(), ResetCameraClippingRange(), VTKViewer_Trihedron::SetVisibility(), VTKViewer_Trihedron::VisibilityOff(), and VTKViewer_Trihedron::VisibilityOn().
void VTKViewer_InteractorStyle::ViewFitSelection | ( | ) |
View fit selection.
References ComputeBounds(), VTK::ActorCollectionCopy::GetActors(), and isBoundValid().
VTKViewer_InteractorStyle::vtkTypeMacro | ( | VTKViewer_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 |