1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SVTK_InteractorStyle.cxx
25 // Author : Christophe ATTANASIO
30 #include "SVTK_InteractorStyle.h"
32 #include "utilities.h"
34 #include "VTKViewer_CellRectPicker.h"
35 #include "VTKViewer_Utilities.h"
36 #include "VTKViewer_Trihedron.h"
37 #include "VTKViewer_RectPicker.h"
39 #include "SVTK_RenderWindowInteractor.h"
40 #include "SVTK_RenderWindow.h"
41 #include "SVTK_ViewWindow.h"
43 #include "SALOME_Actor.h"
44 #include "SVTK_Actor.h"
45 #include "SVTK_Selector.h"
47 #include "SALOME_ListIteratorOfListIO.hxx"
48 #include "SALOME_ListIO.hxx"
50 #include "SUIT_Session.h"
51 #include "CAM_Application.h"
53 #include <vtkObjectFactory.h>
55 #include <vtkCommand.h>
56 #include <vtkCamera.h>
57 #include <vtkRenderer.h>
58 #include <vtkPicker.h>
59 #include <vtkPointPicker.h>
60 #include <vtkCellPicker.h>
62 #include <vtkMapper.h>
63 #include <vtkDataSet.h>
64 #include <vtkSmartPointer.h>
65 #include <vtkRenderWindow.h>
67 #include <qapplication.h>
68 //VRV: porting on Qt 3.0.5
69 #if QT_VERSION >= 0x030005
72 //VRV: porting on Qt 3.0.5
79 static int MYDEBUG = 0;
81 static int MYDEBUG = 0;
87 GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId)
90 if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
91 float aPickPosition[3];
92 thePicker->GetPickPosition(aPickPosition);
93 float aMinDist = 1000000.0, aDist = 0;
94 for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){
95 if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
96 int subId; float pcoords[3], closestPoint[3], weights[3];
97 aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
98 if (aDist < aMinDist) {
110 bool CheckDimensionId(Selection_Mode theMode, SALOME_Actor *theActor, vtkIdType theObjId){
115 return ( theActor->GetObjDimension( theObjId ) == 1 );
117 return ( theActor->GetObjDimension( theObjId ) == 2 );
118 case VolumeSelection:
119 return ( theActor->GetObjDimension( theObjId ) == 3 );
125 //----------------------------------------------------------------------------
126 vtkStandardNewMacro(SVTK_InteractorStyle);
127 //----------------------------------------------------------------------------
130 ::SVTK_InteractorStyle()
134 this->MotionFactor = 10.0;
135 this->State = VTK_INTERACTOR_STYLE_CAMERA_NONE;
136 this->RadianToDegree = 180.0 / vtkMath::Pi();
137 this->ForcedState = VTK_INTERACTOR_STYLE_CAMERA_NONE;
140 myPreSelectionActor = SVTK_Actor::New();
141 myPreSelectionActor->GetProperty()->SetColor(0,1,1);
142 myPreSelectionActor->GetProperty()->SetLineWidth(5);
143 myPreSelectionActor->GetProperty()->SetPointSize(5);
145 OnSelectionModeChanged();
148 //----------------------------------------------------------------------------
150 ::~SVTK_InteractorStyle()
152 if(MYDEBUG) INFOS("SVTK_InteractorStyle::~SVTK_InteractorStyle()");
153 myViewWindow->RemoveActor(myPreSelectionActor);
156 //----------------------------------------------------------------------------
161 return myViewWindow->GetSelector();
164 //----------------------------------------------------------------------------
167 ::setPreselectionProp(const double& theRed,
168 const double& theGreen,
169 const double& theBlue,
172 if ( myPreSelectionActor->GetProperty() == 0 )
174 myPreSelectionActor->GetProperty()->SetColor(theRed, theGreen, theBlue);
175 myPreSelectionActor->GetProperty()->SetLineWidth(theWidth);
176 myPreSelectionActor->GetProperty()->SetPointSize(theWidth);
179 //----------------------------------------------------------------------------
182 ::SetInteractor(vtkRenderWindowInteractor *theInteractor)
184 myInteractor = dynamic_cast<SVTK_RenderWindowInteractor*>(theInteractor);
185 Superclass::SetInteractor(theInteractor);
188 //----------------------------------------------------------------------------
193 return State | ForcedState;
196 //----------------------------------------------------------------------------
199 ::setViewWindow(SVTK_ViewWindow* theViewWindow)
201 myViewWindow = theViewWindow;
202 myViewWindow->AddActor(myPreSelectionActor);
203 myPreSelectionActor->Delete();
206 //----------------------------------------------------------------------------
209 ::setGUIWindow(QWidget* theWindow)
211 myGUIWindow = theWindow;
214 //----------------------------------------------------------------------------
217 ::setTriedron(VTKViewer_Trihedron* theTrihedron)
219 myTrihedron = theTrihedron;
222 //----------------------------------------------------------------------------
225 ::RotateXY(int dx, int dy)
231 if (this->CurrentRenderer == NULL)
236 int *size = this->CurrentRenderer->GetRenderWindow()->GetSize();
237 this->DeltaElevation = -20.0 / size[1];
238 this->DeltaAzimuth = -20.0 / size[0];
240 rxf = (double)dx * this->DeltaAzimuth * this->MotionFactor;
241 ryf = (double)dy * this->DeltaElevation * this->MotionFactor;
243 cam = this->CurrentRenderer->GetActiveCamera();
246 cam->OrthogonalizeViewUp();
247 ::ResetCameraClippingRange(this->CurrentRenderer);
248 //this->Interactor->Render();
249 myGUIWindow->update();
252 //----------------------------------------------------------------------------
255 ::PanXY(int x, int y, int oldX, int oldY)
257 TranslateView(x, y, oldX, oldY);
258 //this->Interactor->Render();
259 myGUIWindow->update();
263 //----------------------------------------------------------------------------
266 ::DollyXY(int dx, int dy)
268 if (this->CurrentRenderer == NULL) return;
270 double dxf = this->MotionFactor * (double)(dx) / (double)(this->CurrentRenderer->GetCenter()[1]);
271 double dyf = this->MotionFactor * (double)(dy) / (double)(this->CurrentRenderer->GetCenter()[1]);
273 double zoomFactor = pow((double)1.1, dxf + dyf);
275 vtkCamera *aCam = this->CurrentRenderer->GetActiveCamera();
276 if (aCam->GetParallelProjection())
277 aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
279 aCam->Dolly(zoomFactor);
280 ::ResetCameraClippingRange(this->CurrentRenderer);
283 //this->Interactor->Render();
284 myGUIWindow->update();
287 //----------------------------------------------------------------------------
290 ::SpinXY(int x, int y, int oldX, int oldY)
294 if (this->CurrentRenderer == NULL)
299 double newAngle = atan2((double)(y - this->CurrentRenderer->GetCenter()[1]),
300 (double)(x - this->CurrentRenderer->GetCenter()[0]));
301 double oldAngle = atan2((double)(oldY -this->CurrentRenderer->GetCenter()[1]),
302 (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
304 newAngle *= this->RadianToDegree;
305 oldAngle *= this->RadianToDegree;
307 cam = this->CurrentRenderer->GetActiveCamera();
308 cam->Roll(newAngle - oldAngle);
309 cam->OrthogonalizeViewUp();
311 //this->Interactor->Render();
312 myGUIWindow->update();
316 //----------------------------------------------------------------------------
319 ::OnMouseMove(int vtkNotUsed(ctrl),
323 myShiftState = shift;
324 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
325 onOperation(QPoint(x, y));
326 else if (ForcedState == VTK_INTERACTOR_STYLE_CAMERA_NONE)
327 onCursorMove(QPoint(x, y));
331 //----------------------------------------------------------------------------
334 ::OnLeftButtonDown(int ctrl, int shift,
337 if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
338 this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
341 this->FindPokedRenderer(x, y);
342 if (this->CurrentRenderer == NULL) {
345 myShiftState = shift;
346 // finishing current viewer operation
347 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
349 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
351 myOtherPoint = myPoint = QPoint(x, y);
352 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
353 startOperation(ForcedState);
356 startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
358 startOperation(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
364 //----------------------------------------------------------------------------
367 ::OnLeftButtonUp(int vtkNotUsed(ctrl),
372 myShiftState = shift;
373 // finishing current viewer operation
374 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
376 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
381 //----------------------------------------------------------------------------
384 ::OnMiddleButtonDown(int ctrl,
388 if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))
390 this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
393 this->FindPokedRenderer(x, y);
394 if (this->CurrentRenderer == NULL)
398 myShiftState = shift;
399 // finishing current viewer operation
400 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
402 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
404 myOtherPoint = myPoint = QPoint(x, y);
405 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
406 startOperation(ForcedState);
410 startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
415 //----------------------------------------------------------------------------
418 ::OnMiddleButtonUp(int vtkNotUsed(ctrl),
423 myShiftState = shift;
424 // finishing current viewer operation
425 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
427 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
432 //----------------------------------------------------------------------------
435 ::OnRightButtonDown(int ctrl,
439 if (this->HasObserver(vtkCommand::RightButtonPressEvent))
441 this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
444 this->FindPokedRenderer(x, y);
445 if (this->CurrentRenderer == NULL)
449 myShiftState = shift;
450 // finishing current viewer operation
451 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
453 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
455 myOtherPoint = myPoint = QPoint(x, y);
456 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
457 startOperation(ForcedState);
461 startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
465 //----------------------------------------------------------------------------
468 ::OnRightButtonUp(int vtkNotUsed(ctrl),
473 myShiftState = shift;
474 // finishing current viewer operation
475 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
477 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
481 //----------------------------------------------------------------------------
483 const char* imageZoomCursor[] = {
488 "................................",
489 "................................",
490 ".#######........................",
491 "..aaaaaaa.......................",
492 "................................",
493 ".............#####..............",
494 "...........##.aaaa##............",
495 "..........#.aa.....a#...........",
496 ".........#.a.........#..........",
497 ".........#a..........#a.........",
498 "........#.a...........#.........",
499 "........#a............#a........",
500 "........#a............#a........",
501 "........#a............#a........",
502 "........#a............#a........",
503 ".........#...........#.a........",
504 ".........#a..........#a.........",
505 ".........##.........#.a.........",
506 "........#####.....##.a..........",
507 ".......###aaa#####.aa...........",
508 "......###aa...aaaaa.......#.....",
509 ".....###aa................#a....",
510 "....###aa.................#a....",
511 "...###aa...............#######..",
512 "....#aa.................aa#aaaa.",
513 ".....a....................#a....",
514 "..........................#a....",
515 "...........................a....",
516 "................................",
517 "................................",
518 "................................",
519 "................................"};
521 const char* imageRotateCursor[] = {
526 "................................",
527 "................................",
528 "................................",
529 "................................",
530 "........#.......................",
531 ".......#.a......................",
532 "......#######...................",
533 ".......#aaaaa#####..............",
534 "........#..##.a#aa##........##..",
535 ".........a#.aa..#..a#.....##.aa.",
536 ".........#.a.....#...#..##.aa...",
537 ".........#a.......#..###.aa.....",
538 "........#.a.......#a..#aa.......",
539 "........#a.........#..#a........",
540 "........#a.........#a.#a........",
541 "........#a.........#a.#a........",
542 "........#a.........#a.#a........",
543 ".........#.........#a#.a........",
544 "........##a........#a#a.........",
545 "......##.a#.......#.#.a.........",
546 "....##.aa..##.....##.a..........",
547 "..##.aa.....a#####.aa...........",
548 "...aa.........aaa#a.............",
549 "................#.a.............",
550 "...............#.a..............",
551 "..............#.a...............",
552 "...............a................",
553 "................................",
554 "................................",
555 "................................",
556 "................................",
557 "................................"};
560 //----------------------------------------------------------------------------
561 // loads cursors for viewer operations - zoom, pan, etc...
566 myDefCursor = QCursor(ArrowCursor);
567 myHandCursor = QCursor(PointingHandCursor);
568 myPanCursor = QCursor(SizeAllCursor);
569 myZoomCursor = QCursor(QPixmap(imageZoomCursor));
570 myRotateCursor = QCursor(QPixmap(imageRotateCursor));
571 mySpinCursor = QCursor(QPixmap(imageRotateCursor)); // temporarly !!!!!!
572 myGlobalPanCursor = QCursor(CrossCursor);
573 myCursorState = false;
577 //----------------------------------------------------------------------------
578 // event filter - controls mouse and keyboard events during viewer operations
581 ::eventFilter(QObject* object, QEvent* event)
583 if (!myGUIWindow) return false;
584 if ( (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::KeyPress) && object != myGUIWindow)
586 qApp->removeEventFilter(this);
587 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
589 return QObject::eventFilter(object, event);
593 //----------------------------------------------------------------------------
594 // starts Zoom operation (e.g. through menu command)
599 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
602 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
604 setCursor(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
605 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_ZOOM;
606 qApp->installEventFilter(this);
610 //----------------------------------------------------------------------------
611 // starts Pan operation (e.g. through menu command)
616 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
619 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
621 setCursor(VTK_INTERACTOR_STYLE_CAMERA_PAN);
622 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_PAN;
623 qApp->installEventFilter(this);
626 //----------------------------------------------------------------------------
627 // starts Rotate operation (e.g. through menu command)
632 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
635 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
637 setCursor(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
638 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_ROTATE;
639 qApp->installEventFilter(this);
643 //----------------------------------------------------------------------------
644 // starts Spin operation (e.g. through menu command)
649 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
652 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
654 setCursor(VTK_INTERACTOR_STYLE_CAMERA_SPIN);
655 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_SPIN;
656 qApp->installEventFilter(this);
661 //----------------------------------------------------------------------------
662 // starts Fit Area operation (e.g. through menu command)
667 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
670 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
672 setCursor(VTK_INTERACTOR_STYLE_CAMERA_FIT);
673 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_FIT;
674 qApp->installEventFilter(this);
678 //----------------------------------------------------------------------------
683 int aTriedronWasVisible = false;
685 aTriedronWasVisible = myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
686 if(aTriedronWasVisible) myTrihedron->VisibilityOff();
689 if(myTrihedron->GetVisibleActorCount(CurrentRenderer)){
690 myTrihedron->VisibilityOff();
691 ::ResetCamera(CurrentRenderer);
693 myTrihedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
694 ::ResetCamera(CurrentRenderer,true);
696 if(aTriedronWasVisible) myTrihedron->VisibilityOn();
697 else myTrihedron->VisibilityOff();
698 ::ResetCameraClippingRange(CurrentRenderer);
702 //----------------------------------------------------------------------------
703 // starts Global Panning operation (e.g. through menu command)
708 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
711 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
713 setCursor(VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN);
714 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN;
716 // store current zoom scale
717 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
718 myScale = cam->GetParallelScale();
722 if (myGUIWindow) myGUIWindow->update();
724 qApp->installEventFilter(this);
728 //----------------------------------------------------------------------------
729 // returns TRUE if needs redrawing
734 return State == VTK_INTERACTOR_STYLE_CAMERA_ZOOM ||
735 State == VTK_INTERACTOR_STYLE_CAMERA_PAN ||
736 State == VTK_INTERACTOR_STYLE_CAMERA_ROTATE ||
737 State == VTK_INTERACTOR_STYLE_CAMERA_SPIN ||
738 State == VTK_INTERACTOR_STYLE_CAMERA_NONE;
742 //----------------------------------------------------------------------------
743 // fits viewer contents to rect
746 ::fitRect(const int left,
751 if (this->CurrentRenderer == NULL) return;
754 int x = (left + right)/2;
755 int y = (top + bottom)/2;
756 int *aSize = this->CurrentRenderer->GetRenderWindow()->GetSize();
757 int oldX = aSize[0]/2;
758 int oldY = aSize[1]/2;
759 TranslateView(oldX, oldY, x, y);
762 double dxf = (double)(aSize[0]) / (double)(abs(right - left));
763 double dyf = (double)(aSize[1]) / (double)(abs(bottom - top));
764 double zoomFactor = (dxf + dyf)/2 ;
766 vtkCamera *aCam = this->CurrentRenderer->GetActiveCamera();
767 if(aCam->GetParallelProjection())
768 aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
770 aCam->Dolly(zoomFactor);
771 ::ResetCameraClippingRange(this->CurrentRenderer);
774 myGUIWindow->update();
778 //----------------------------------------------------------------------------
779 // starts viewer operation (!internal usage!)
782 ::startOperation(int operation)
786 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
787 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
788 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
789 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
790 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
791 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
792 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
793 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
794 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
796 if (State != VTK_INTERACTOR_STYLE_CAMERA_SELECT)
797 setCursor(operation);
800 case VTK_INTERACTOR_STYLE_CAMERA_NONE:
802 setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
803 State = ForcedState = VTK_INTERACTOR_STYLE_CAMERA_NONE;
809 //----------------------------------------------------------------------------
810 // sets proper cursor for window when viewer operation is activated
813 ::setCursor(const int operation)
815 if (!myGUIWindow) return;
818 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
819 myGUIWindow->setCursor(myZoomCursor);
820 myCursorState = true;
822 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
823 myGUIWindow->setCursor(myPanCursor);
824 myCursorState = true;
826 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
827 myGUIWindow->setCursor(myRotateCursor);
828 myCursorState = true;
830 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
831 myGUIWindow->setCursor(mySpinCursor);
832 myCursorState = true;
834 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
835 myGUIWindow->setCursor(myGlobalPanCursor);
836 myCursorState = true;
838 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
839 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
840 myGUIWindow->setCursor(myHandCursor);
841 myCursorState = true;
843 case VTK_INTERACTOR_STYLE_CAMERA_NONE:
845 myGUIWindow->setCursor(myDefCursor);
846 myCursorState = false;
852 //----------------------------------------------------------------------------
853 // called when viewer operation started (!put necessary initialization here!)
858 if (!myGUIWindow) return;
859 // VSV: LOD actor activisation
860 // this->Interactor->GetRenderWindow()->SetDesiredUpdateRate(this->Interactor->GetDesiredUpdateRate());
862 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
863 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
865 QPainter p(myGUIWindow);
866 p.setPen(Qt::lightGray);
867 p.setRasterOp(Qt::XorROP);
868 p.drawRect(QRect(myPoint, myOtherPoint));
871 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
872 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
873 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
874 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
875 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
881 //----------------------------------------------------------------------------
882 // called when viewer operation finished (!put necessary post-processing here!)
885 ::onFinishOperation()
890 // VSV: LOD actor activisation
891 // rwi->GetRenderWindow()->SetDesiredUpdateRate(rwi->GetStillUpdateRate());
893 Selection_Mode aSelectionMode = myViewWindow->SelectionMode();
894 bool aSelActiveCompOnly = false;
896 QString aComponentDataType;
897 if(SUIT_Session* aSession = SUIT_Session::session())
898 if(SUIT_Application* aSUITApp = aSession->activeApplication())
899 if(CAM_Application* aCAMApp = dynamic_cast<CAM_Application*>(aSUITApp))
900 if(CAM_Module* aModule = aCAMApp->activeModule())
901 aComponentDataType = aModule->name();
904 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
905 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
907 QPainter p(myGUIWindow);
908 p.setPen(Qt::lightGray);
909 p.setRasterOp(Qt::XorROP);
910 QRect rect(myPoint, myOtherPoint);
912 rect = rect.normalize();
913 if (State == VTK_INTERACTOR_STYLE_CAMERA_FIT) {
914 // making fit rect opeation
916 myInteractor->GetSize(w, h);
919 y1 = h - rect.top() - 1;
921 y2 = h - rect.bottom() - 1;
922 fitRect(x1, y1, x2, y2);
925 if (myPoint == myOtherPoint) {
926 // process point selection
928 myInteractor->GetSize(w, h);
930 y = h - myPoint.y() - 1;
932 this->FindPokedRenderer(x, y);
933 myInteractor->StartPickCallback();
935 vtkPicker* aPicker = vtkPicker::SafeDownCast(myInteractor->GetPicker());
936 aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
938 SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
940 if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
941 int aVtkId = picker->GetCellId();
942 if ( aVtkId >= 0 && aSActor && aSActor->hasIO() && IsValid( aSActor, aVtkId ) ) {
943 int anObjId = aSActor->GetElemObjId(aVtkId);
945 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
946 if(aSelectionMode != EdgeOfCellSelection) {
947 if(CheckDimensionId(aSelectionMode,aSActor,anObjId)){
948 if(MYDEBUG) INFOS(" CellId : "<<anObjId);
949 if (GetSelector()->IsSelected(anIO)) {
950 // This IO is already in the selection
951 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
954 this->HighlightProp( NULL );
955 GetSelector()->ClearIObjects();
957 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
958 GetSelector()->AddIObject(aSActor);
963 this->HighlightProp( NULL );
964 GetSelector()->ClearIObjects();
966 int anEdgeId = GetEdgeId(picker,aSActor,anObjId);
968 if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
969 GetSelector()->AddOrRemoveIndex(anIO,anObjId,false);
970 GetSelector()->AddOrRemoveIndex(anIO,-anEdgeId-1,true);
971 GetSelector()->AddIObject(aSActor);
976 this->HighlightProp( NULL );
977 GetSelector()->ClearIObjects();
979 } else if ( vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker) ) {
980 int aVtkId = picker->GetPointId();
981 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ) {
982 if ( aSActor && aSActor->hasIO() ) {
983 int anObjId = aSActor->GetNodeObjId(aVtkId);
985 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
986 if(GetSelector()->IsSelected(anIO)) {
987 // This IO is already in the selection
988 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
991 this->HighlightProp( NULL );
992 GetSelector()->ClearIObjects();
994 if(MYDEBUG) INFOS(" PointId : "<<anObjId);
995 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
996 GetSelector()->AddIObject(aSActor);
1001 this->HighlightProp( NULL );
1002 GetSelector()->ClearIObjects();
1005 if ( aSActor && aSActor->hasIO() ) {
1007 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1008 if(GetSelector()->IsSelected(anIO)) {
1009 // This IO is already in the selection
1011 GetSelector()->RemoveIObject(aSActor);
1016 this->HighlightProp( NULL );
1017 GetSelector()->ClearIObjects();
1019 GetSelector()->AddIObject(aSActor);
1022 // No selection clear all
1023 this->PropPicked = 0;
1024 this->HighlightProp( NULL );
1025 GetSelector()->ClearIObjects();
1028 myInteractor->EndPickCallback();
1030 //processing rectangle selection
1031 if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
1032 myInteractor->StartPickCallback();
1034 if (!myShiftState) {
1035 this->PropPicked = 0;
1036 this->HighlightProp( NULL );
1037 GetSelector()->ClearIObjects();
1041 // vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1042 QRect rect(myPoint, myOtherPoint);
1043 rect = rect.normalize();
1045 myInteractor->GetSize(w, h);
1048 y1 = h - rect.top() - 1;
1050 y2 = h - rect.bottom() - 1;
1052 switch (aSelectionMode) {
1053 case NodeSelection: {
1054 if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(myInteractor->GetPicker()) ) {
1055 vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
1056 aListActors->InitTraversal();
1057 while (vtkActor* aActor = aListActors->GetNextActor()) {
1058 if (!aActor->GetVisibility())
1060 if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1061 if (aSActor->hasIO()) {
1062 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1065 if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
1067 if (vtkDataSet* aDataSet = aSActor->GetInput()) {
1068 TColStd_MapOfInteger anIndices;
1069 for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
1071 aDataSet->GetPoint(i,aPoint);
1072 if (IsInRect(aPoint,x1,y1,x2,y2)){
1074 ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
1075 if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
1076 if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
1077 if(anActorCollection->IsItemPresent(aSActor)){
1078 float aPickedPoint[3];
1079 aPointPicker->GetMapperPosition(aPickedPoint);
1080 vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
1081 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ){
1082 int anObjId = aSActor->GetNodeObjId(aVtkId);
1083 anIndices.Add(anObjId);
1090 if (!anIndices.IsEmpty()) {
1091 GetSelector()->AddOrRemoveIndex(anIO,anIndices,false);
1092 GetSelector()->AddIObject(aSActor);
1095 GetSelector()->RemoveIObject(aSActor);
1105 case EdgeOfCellSelection:
1108 case VolumeSelection:
1110 vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
1111 picker->SetTolerance(0.001);
1112 picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
1114 vtkActorCollection* aListActors = picker->GetActors();
1115 aListActors->InitTraversal();
1116 while(vtkActor* aActor = aListActors->GetNextActor()) {
1117 if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1118 if (aSActor->hasIO()) {
1119 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1120 if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
1122 VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
1123 if ( !cellList.empty() ) {
1124 if(MYDEBUG) INFOS ( " NAME Actor : " << aSActor->getName() );
1125 TColStd_MapOfInteger anIndexes;
1126 VTKViewer_CellDataSet::iterator it;
1127 for ( it = cellList.begin(); it != cellList.end(); ++it ) {
1128 int aCellId = (*it).cellId;
1130 if ( !IsValid( aSActor, aCellId ) )
1133 int anObjId = aSActor->GetElemObjId(aCellId);
1135 if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
1136 anIndexes.Add(anObjId);
1140 GetSelector()->AddOrRemoveIndex(anIO,anIndexes,true);
1141 GetSelector()->AddIObject(aSActor);
1148 case ActorSelection: // objects selection
1150 vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
1151 picker->SetTolerance(0.001);
1152 picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
1154 vtkActorCollection* aListActors = picker->GetActors();
1155 aListActors->InitTraversal();
1156 while(vtkActor* aActor = aListActors->GetNextActor()) {
1157 if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1158 if (aSActor->hasIO()) {
1159 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1160 GetSelector()->AddIObject(aSActor);
1167 myInteractor->EndPickCallback();
1169 myViewWindow->onSelectionChanged();
1173 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
1174 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
1175 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
1176 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
1178 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
1181 myInteractor->GetSize(w, h);
1183 y = h - myPoint.y() - 1;
1188 if (myGUIWindow) myGUIWindow->update();
1193 // called during viewer operation when user moves mouse (!put necessary processing here!)
1195 SVTK_InteractorStyle
1196 ::onOperation(QPoint mousePos)
1198 if (!myGUIWindow) return;
1200 GetInteractor()->GetSize(w, h);
1202 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
1204 // processing panning
1205 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1206 this->PanXY(mousePos.x(), myPoint.y(), myPoint.x(), mousePos.y());
1210 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
1212 // processing zooming
1213 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1214 this->DollyXY(mousePos.x() - myPoint.x(), mousePos.y() - myPoint.y());
1218 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
1220 // processing rotation
1221 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1222 this->RotateXY(mousePos.x() - myPoint.x(), myPoint.y() - mousePos.y());
1226 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
1228 // processing spinning
1229 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1230 this->SpinXY(mousePos.x(), mousePos.y(), myPoint.x(), myPoint.y());
1234 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
1238 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
1241 setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
1243 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
1245 QPainter p(myGUIWindow);
1246 p.setPen(Qt::lightGray);
1247 p.setRasterOp(Qt::XorROP);
1248 p.drawRect(QRect(myPoint, myOtherPoint));
1249 myOtherPoint = mousePos;
1250 p.drawRect(QRect(myPoint, myOtherPoint));
1254 this->LastPos[0] = mousePos.x();
1255 this->LastPos[1] = h - mousePos.y() - 1;
1258 // called when selection mode changed (!put necessary initialization here!)
1260 SVTK_InteractorStyle
1261 ::OnSelectionModeChanged()
1264 myPreSelectionActor->SetVisibility(false);
1265 myElemId = myEdgeId = myNodeId = -1;
1266 mySelectedActor = NULL;
1269 // called when user moves mouse inside viewer window and there is no active viewer operation
1270 // (!put necessary processing here!)
1272 SVTK_InteractorStyle
1273 ::onCursorMove(QPoint mousePos)
1275 // processing highlighting
1276 Selection_Mode aSelectionMode = myViewWindow->SelectionMode();
1279 myInteractor->GetSize(w, h);
1280 x = mousePos.x(); y = h - mousePos.y() - 1;
1282 this->FindPokedRenderer(x,y);
1283 myInteractor->StartPickCallback();
1284 myPreSelectionActor->SetVisibility(false);
1286 vtkPicker* aPicker = vtkPicker::SafeDownCast(myInteractor->GetPicker());
1287 aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
1289 SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
1291 if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
1292 int aVtkId = picker->GetCellId();
1293 if ( aVtkId >= 0 ) {
1294 int anObjId = aSActor->GetElemObjId(aVtkId);
1295 if ( aSActor && aSActor->hasIO() && IsValid( aSActor, aVtkId ) ) {
1296 bool anIsSameObjId = (mySelectedActor == aSActor && myElemId == anObjId);
1297 bool aResult = anIsSameObjId;
1298 if(!anIsSameObjId) {
1299 if(aSelectionMode != EdgeOfCellSelection) {
1300 aResult = CheckDimensionId(aSelectionMode,aSActor,anObjId);
1302 mySelectedActor = aSActor;
1304 if(MYDEBUG) INFOS(" CellId : "<<anObjId);
1305 myInteractor->setCellData(anObjId,aSActor,myPreSelectionActor);
1309 if(aSelectionMode == EdgeOfCellSelection){
1310 int anEdgeId = GetEdgeId(picker,aSActor,anObjId);
1311 bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
1312 aResult = anIsSameEdgeId;
1313 if(!anIsSameEdgeId) {
1314 aResult = (anEdgeId >= 0);
1316 mySelectedActor = aSActor;
1317 myEdgeId = anEdgeId;
1319 if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
1320 myInteractor->setEdgeData(anObjId,aSActor,-anEdgeId-1,myPreSelectionActor);
1325 myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
1326 myPreSelectionActor->SetVisibility(true);
1331 else if (vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker)) {
1332 int aVtkId = picker->GetPointId();
1333 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ) {
1334 if ( aSActor && aSActor->hasIO() ) {
1335 int anObjId = aSActor->GetNodeObjId(aVtkId);
1336 bool anIsSameObjId = (mySelectedActor == aSActor && myNodeId == anObjId);
1337 if(!anIsSameObjId) {
1338 mySelectedActor = aSActor;
1340 if(MYDEBUG) INFOS(" PointId : "<<anObjId);
1341 myInteractor->setPointData(anObjId,aSActor,myPreSelectionActor);
1343 myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
1344 myPreSelectionActor->SetVisibility(true);
1348 else if ( vtkPicker::SafeDownCast(aPicker) ) {
1350 if ( myPreViewActor != aSActor ) {
1351 if ( myPreViewActor != NULL ) {
1352 myPreViewActor->SetPreSelected( false );
1354 myPreViewActor = aSActor;
1356 if ( aSActor->hasIO() ) {
1357 Handle( SALOME_InteractiveObject) IO = aSActor->getIO();
1358 if ( !GetSelector()->IsSelected(IO) ) {
1359 // Find All actors with same IO
1360 vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
1361 theActors->InitTraversal();
1362 while( vtkActor *ac = theActors->GetNextActor() ) {
1363 if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
1364 if ( anActor->hasIO() ) {
1365 Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
1366 if(IO->isSame(IOS)) {
1367 anActor->SetPreSelected( true );
1376 myPreViewActor = NULL;
1377 vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
1378 theActors->InitTraversal();
1379 while( vtkActor *ac = theActors->GetNextActor() ) {
1380 if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
1381 anActor->SetPreSelected( false );
1386 myInteractor->EndPickCallback();
1387 //myInteractor->Render();
1388 myGUIWindow->update();
1390 this->LastPos[0] = x;
1391 this->LastPos[1] = y;
1394 // called on finsh GlobalPan operation
1396 SVTK_InteractorStyle
1397 ::Place(const int theX, const int theY)
1399 if (this->CurrentRenderer == NULL) {
1404 int *aSize = this->CurrentRenderer->GetRenderWindow()->GetSize();
1405 int centerX = aSize[0]/2;
1406 int centerY = aSize[1]/2;
1408 TranslateView(centerX, centerY, theX, theY);
1410 // restore zoom scale
1411 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1412 cam->SetParallelScale(myScale);
1413 ::ResetCameraClippingRange(this->CurrentRenderer);
1415 if (myGUIWindow) myGUIWindow->update();
1421 // Translates view from Point to Point
1423 SVTK_InteractorStyle
1424 ::TranslateView(int toX, int toY, int fromX, int fromY)
1426 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1427 double viewFocus[4], focalDepth, viewPoint[3];
1428 float newPickPoint[4], oldPickPoint[4], motionVector[3];
1429 cam->GetFocalPoint(viewFocus);
1431 this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
1432 viewFocus[2], viewFocus);
1433 focalDepth = viewFocus[2];
1435 this->ComputeDisplayToWorld(double(toX), double(toY),
1436 focalDepth, newPickPoint);
1437 this->ComputeDisplayToWorld(double(fromX),double(fromY),
1438 focalDepth, oldPickPoint);
1440 // camera motion is reversed
1441 motionVector[0] = oldPickPoint[0] - newPickPoint[0];
1442 motionVector[1] = oldPickPoint[1] - newPickPoint[1];
1443 motionVector[2] = oldPickPoint[2] - newPickPoint[2];
1445 cam->GetFocalPoint(viewFocus);
1446 cam->GetPosition(viewPoint);
1447 cam->SetFocalPoint(motionVector[0] + viewFocus[0],
1448 motionVector[1] + viewFocus[1],
1449 motionVector[2] + viewFocus[2]);
1450 cam->SetPosition(motionVector[0] + viewPoint[0],
1451 motionVector[1] + viewPoint[1],
1452 motionVector[2] + viewPoint[2]);
1456 /// Checks: is the given Actor within display coordinates?
1458 SVTK_InteractorStyle
1459 ::IsInRect(vtkActor* theActor,
1460 const int left, const int top,
1461 const int right, const int bottom)
1463 float* aBounds = theActor->GetBounds();
1464 float aMin[3], aMax[3];
1465 ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
1466 ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
1467 if (aMin[0] > aMax[0]) {
1468 float aBuf = aMin[0];
1472 if (aMin[1] > aMax[1]) {
1473 float aBuf = aMin[1];
1478 return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
1482 /// Checks: is the given Cell within display coordinates?
1484 SVTK_InteractorStyle
1485 ::IsInRect(vtkCell* theCell,
1486 const int left, const int top,
1487 const int right, const int bottom)
1489 float* aBounds = theCell->GetBounds();
1490 float aMin[3], aMax[3];
1491 ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
1492 ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
1493 if (aMin[0] > aMax[0]) {
1494 float aBuf = aMin[0];
1498 if (aMin[1] > aMax[1]) {
1499 float aBuf = aMin[1];
1504 return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
1509 SVTK_InteractorStyle
1510 ::IsInRect(float* thePoint,
1511 const int left, const int top,
1512 const int right, const int bottom)
1515 ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
1517 return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
1521 SVTK_InteractorStyle
1522 ::SetFilter( const Handle(VTKViewer_Filter)& theFilter )
1524 myFilters[ theFilter->GetId() ] = theFilter;
1528 SVTK_InteractorStyle
1529 ::IsFilterPresent( const int theId )
1531 return myFilters.find( theId ) != myFilters.end();
1535 SVTK_InteractorStyle
1536 ::RemoveFilter( const int theId )
1538 if ( IsFilterPresent( theId ) )
1539 myFilters.erase( theId );
1544 SVTK_InteractorStyle
1545 ::IsValid( SALOME_Actor* theActor,
1547 const bool theIsNode )
1549 std::map<int, Handle(VTKViewer_Filter)>::const_iterator anIter;
1550 for ( anIter = myFilters.begin(); anIter != myFilters.end(); ++anIter )
1552 const Handle(VTKViewer_Filter)& aFilter = anIter->second;
1553 if ( theIsNode == aFilter->IsNodeFilter() &&
1554 !aFilter->IsValid( theActor, theId ) )
1560 Handle(VTKViewer_Filter)
1561 SVTK_InteractorStyle
1562 ::GetFilter( const int theId )
1564 return IsFilterPresent( theId ) ? myFilters[ theId ] : Handle(VTKViewer_Filter)();
1568 SVTK_InteractorStyle
1569 ::IncrementalPan( const int incrX, const int incrY )
1571 this->PanXY( incrX, incrY, 0, 0 );
1575 SVTK_InteractorStyle
1576 ::IncrementalZoom( const int incr )
1578 this->DollyXY( incr, incr );
1582 SVTK_InteractorStyle
1583 ::IncrementalRotate( const int incrX, const int incrY )
1585 this->RotateXY( incrX, -incrY );