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 //----------------------------------------------------------------------------
191 ::setViewWindow(SVTK_ViewWindow* theViewWindow)
193 myViewWindow = theViewWindow;
194 myViewWindow->AddActor(myPreSelectionActor);
195 myPreSelectionActor->Delete();
198 //----------------------------------------------------------------------------
201 ::setGUIWindow(QWidget* theWindow)
203 myGUIWindow = theWindow;
206 //----------------------------------------------------------------------------
209 ::setTriedron(VTKViewer_Trihedron* theTrihedron)
211 myTrihedron = theTrihedron;
214 //----------------------------------------------------------------------------
217 ::RotateXY(int dx, int dy)
223 if (this->CurrentRenderer == NULL)
228 int *size = this->CurrentRenderer->GetRenderWindow()->GetSize();
229 this->DeltaElevation = -20.0 / size[1];
230 this->DeltaAzimuth = -20.0 / size[0];
232 rxf = (double)dx * this->DeltaAzimuth * this->MotionFactor;
233 ryf = (double)dy * this->DeltaElevation * this->MotionFactor;
235 cam = this->CurrentRenderer->GetActiveCamera();
238 cam->OrthogonalizeViewUp();
239 ::ResetCameraClippingRange(this->CurrentRenderer);
240 //this->Interactor->Render();
241 myGUIWindow->update();
244 //----------------------------------------------------------------------------
247 ::PanXY(int x, int y, int oldX, int oldY)
249 TranslateView(x, y, oldX, oldY);
250 //this->Interactor->Render();
251 myGUIWindow->update();
255 //----------------------------------------------------------------------------
258 ::DollyXY(int dx, int dy)
260 if (this->CurrentRenderer == NULL) return;
262 double dxf = this->MotionFactor * (double)(dx) / (double)(this->CurrentRenderer->GetCenter()[1]);
263 double dyf = this->MotionFactor * (double)(dy) / (double)(this->CurrentRenderer->GetCenter()[1]);
265 double zoomFactor = pow((double)1.1, dxf + dyf);
267 vtkCamera *aCam = this->CurrentRenderer->GetActiveCamera();
268 if (aCam->GetParallelProjection())
269 aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
271 aCam->Dolly(zoomFactor);
272 ::ResetCameraClippingRange(this->CurrentRenderer);
275 //this->Interactor->Render();
276 myGUIWindow->update();
279 //----------------------------------------------------------------------------
282 ::SpinXY(int x, int y, int oldX, int oldY)
286 if (this->CurrentRenderer == NULL)
291 double newAngle = atan2((double)(y - this->CurrentRenderer->GetCenter()[1]),
292 (double)(x - this->CurrentRenderer->GetCenter()[0]));
293 double oldAngle = atan2((double)(oldY -this->CurrentRenderer->GetCenter()[1]),
294 (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
296 newAngle *= this->RadianToDegree;
297 oldAngle *= this->RadianToDegree;
299 cam = this->CurrentRenderer->GetActiveCamera();
300 cam->Roll(newAngle - oldAngle);
301 cam->OrthogonalizeViewUp();
303 //this->Interactor->Render();
304 myGUIWindow->update();
308 //----------------------------------------------------------------------------
311 ::OnMouseMove(int vtkNotUsed(ctrl),
315 myShiftState = shift;
316 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
317 onOperation(QPoint(x, y));
318 else if (ForcedState == VTK_INTERACTOR_STYLE_CAMERA_NONE)
319 onCursorMove(QPoint(x, y));
323 //----------------------------------------------------------------------------
326 ::OnLeftButtonDown(int ctrl, int shift,
329 if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
330 this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
333 this->FindPokedRenderer(x, y);
334 if (this->CurrentRenderer == NULL) {
337 myShiftState = shift;
338 // finishing current viewer operation
339 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
341 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
343 myOtherPoint = myPoint = QPoint(x, y);
344 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
345 startOperation(ForcedState);
348 startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
350 startOperation(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
356 //----------------------------------------------------------------------------
359 ::OnLeftButtonUp(int vtkNotUsed(ctrl),
364 myShiftState = shift;
365 // finishing current viewer operation
366 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
368 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
373 //----------------------------------------------------------------------------
376 ::OnMiddleButtonDown(int ctrl,
380 if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))
382 this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
385 this->FindPokedRenderer(x, y);
386 if (this->CurrentRenderer == NULL)
390 myShiftState = shift;
391 // finishing current viewer operation
392 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
394 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
396 myOtherPoint = myPoint = QPoint(x, y);
397 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
398 startOperation(ForcedState);
402 startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
407 //----------------------------------------------------------------------------
410 ::OnMiddleButtonUp(int vtkNotUsed(ctrl),
415 myShiftState = shift;
416 // finishing current viewer operation
417 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
419 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
424 //----------------------------------------------------------------------------
427 ::OnRightButtonDown(int ctrl,
431 if (this->HasObserver(vtkCommand::RightButtonPressEvent))
433 this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
436 this->FindPokedRenderer(x, y);
437 if (this->CurrentRenderer == NULL)
441 myShiftState = shift;
442 // finishing current viewer operation
443 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
445 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
447 myOtherPoint = myPoint = QPoint(x, y);
448 if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
449 startOperation(ForcedState);
453 startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
457 //----------------------------------------------------------------------------
460 ::OnRightButtonUp(int vtkNotUsed(ctrl),
465 myShiftState = shift;
466 // finishing current viewer operation
467 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
469 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
473 //----------------------------------------------------------------------------
475 const char* imageZoomCursor[] = {
480 "................................",
481 "................................",
482 ".#######........................",
483 "..aaaaaaa.......................",
484 "................................",
485 ".............#####..............",
486 "...........##.aaaa##............",
487 "..........#.aa.....a#...........",
488 ".........#.a.........#..........",
489 ".........#a..........#a.........",
490 "........#.a...........#.........",
491 "........#a............#a........",
492 "........#a............#a........",
493 "........#a............#a........",
494 "........#a............#a........",
495 ".........#...........#.a........",
496 ".........#a..........#a.........",
497 ".........##.........#.a.........",
498 "........#####.....##.a..........",
499 ".......###aaa#####.aa...........",
500 "......###aa...aaaaa.......#.....",
501 ".....###aa................#a....",
502 "....###aa.................#a....",
503 "...###aa...............#######..",
504 "....#aa.................aa#aaaa.",
505 ".....a....................#a....",
506 "..........................#a....",
507 "...........................a....",
508 "................................",
509 "................................",
510 "................................",
511 "................................"};
513 const char* imageRotateCursor[] = {
518 "................................",
519 "................................",
520 "................................",
521 "................................",
522 "........#.......................",
523 ".......#.a......................",
524 "......#######...................",
525 ".......#aaaaa#####..............",
526 "........#..##.a#aa##........##..",
527 ".........a#.aa..#..a#.....##.aa.",
528 ".........#.a.....#...#..##.aa...",
529 ".........#a.......#..###.aa.....",
530 "........#.a.......#a..#aa.......",
531 "........#a.........#..#a........",
532 "........#a.........#a.#a........",
533 "........#a.........#a.#a........",
534 "........#a.........#a.#a........",
535 ".........#.........#a#.a........",
536 "........##a........#a#a.........",
537 "......##.a#.......#.#.a.........",
538 "....##.aa..##.....##.a..........",
539 "..##.aa.....a#####.aa...........",
540 "...aa.........aaa#a.............",
541 "................#.a.............",
542 "...............#.a..............",
543 "..............#.a...............",
544 "...............a................",
545 "................................",
546 "................................",
547 "................................",
548 "................................",
549 "................................"};
552 //----------------------------------------------------------------------------
553 // loads cursors for viewer operations - zoom, pan, etc...
558 myDefCursor = QCursor(ArrowCursor);
559 myHandCursor = QCursor(PointingHandCursor);
560 myPanCursor = QCursor(SizeAllCursor);
561 myZoomCursor = QCursor(QPixmap(imageZoomCursor));
562 myRotateCursor = QCursor(QPixmap(imageRotateCursor));
563 mySpinCursor = QCursor(QPixmap(imageRotateCursor)); // temporarly !!!!!!
564 myGlobalPanCursor = QCursor(CrossCursor);
565 myCursorState = false;
569 //----------------------------------------------------------------------------
570 // event filter - controls mouse and keyboard events during viewer operations
573 ::eventFilter(QObject* object, QEvent* event)
575 if (!myGUIWindow) return false;
576 if ( (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::KeyPress) && object != myGUIWindow)
578 qApp->removeEventFilter(this);
579 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
581 return QObject::eventFilter(object, event);
585 //----------------------------------------------------------------------------
586 // starts Zoom operation (e.g. through menu command)
591 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
594 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
596 setCursor(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
597 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_ZOOM;
598 qApp->installEventFilter(this);
602 //----------------------------------------------------------------------------
603 // starts Pan operation (e.g. through menu command)
608 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
611 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
613 setCursor(VTK_INTERACTOR_STYLE_CAMERA_PAN);
614 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_PAN;
615 qApp->installEventFilter(this);
618 //----------------------------------------------------------------------------
619 // starts Rotate operation (e.g. through menu command)
624 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
627 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
629 setCursor(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
630 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_ROTATE;
631 qApp->installEventFilter(this);
635 //----------------------------------------------------------------------------
636 // starts Spin operation (e.g. through menu command)
641 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
644 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
646 setCursor(VTK_INTERACTOR_STYLE_CAMERA_SPIN);
647 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_SPIN;
648 qApp->installEventFilter(this);
653 //----------------------------------------------------------------------------
654 // starts Fit Area operation (e.g. through menu command)
659 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
662 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
664 setCursor(VTK_INTERACTOR_STYLE_CAMERA_FIT);
665 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_FIT;
666 qApp->installEventFilter(this);
670 //----------------------------------------------------------------------------
675 int aTriedronWasVisible = false;
677 aTriedronWasVisible = myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
678 if(aTriedronWasVisible) myTrihedron->VisibilityOff();
681 if(myTrihedron->GetVisibleActorCount(CurrentRenderer)){
682 myTrihedron->VisibilityOff();
683 ::ResetCamera(CurrentRenderer);
685 myTrihedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
686 ::ResetCamera(CurrentRenderer,true);
688 if(aTriedronWasVisible) myTrihedron->VisibilityOn();
689 else myTrihedron->VisibilityOff();
690 ::ResetCameraClippingRange(CurrentRenderer);
694 //----------------------------------------------------------------------------
695 // starts Global Panning operation (e.g. through menu command)
700 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
703 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
705 setCursor(VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN);
706 ForcedState = VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN;
708 // store current zoom scale
709 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
710 myScale = cam->GetParallelScale();
714 if (myGUIWindow) myGUIWindow->update();
716 qApp->installEventFilter(this);
720 //----------------------------------------------------------------------------
721 // returns TRUE if needs redrawing
726 return State == VTK_INTERACTOR_STYLE_CAMERA_ZOOM ||
727 State == VTK_INTERACTOR_STYLE_CAMERA_PAN ||
728 State == VTK_INTERACTOR_STYLE_CAMERA_ROTATE ||
729 State == VTK_INTERACTOR_STYLE_CAMERA_SPIN ||
730 State == VTK_INTERACTOR_STYLE_CAMERA_NONE;
734 //----------------------------------------------------------------------------
735 // fits viewer contents to rect
738 ::fitRect(const int left,
743 if (this->CurrentRenderer == NULL) return;
746 int x = (left + right)/2;
747 int y = (top + bottom)/2;
748 int *aSize = this->CurrentRenderer->GetRenderWindow()->GetSize();
749 int oldX = aSize[0]/2;
750 int oldY = aSize[1]/2;
751 TranslateView(oldX, oldY, x, y);
754 double dxf = (double)(aSize[0]) / (double)(abs(right - left));
755 double dyf = (double)(aSize[1]) / (double)(abs(bottom - top));
756 double zoomFactor = (dxf + dyf)/2 ;
758 vtkCamera *aCam = this->CurrentRenderer->GetActiveCamera();
759 if(aCam->GetParallelProjection())
760 aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
762 aCam->Dolly(zoomFactor);
763 ::ResetCameraClippingRange(this->CurrentRenderer);
766 myGUIWindow->update();
770 //----------------------------------------------------------------------------
771 // starts viewer operation (!internal usage!)
774 ::startOperation(int operation)
778 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
779 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
780 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
781 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
782 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
783 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
784 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
785 if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
786 startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
788 if (State != VTK_INTERACTOR_STYLE_CAMERA_SELECT)
789 setCursor(operation);
792 case VTK_INTERACTOR_STYLE_CAMERA_NONE:
794 setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
795 State = ForcedState = VTK_INTERACTOR_STYLE_CAMERA_NONE;
801 //----------------------------------------------------------------------------
802 // sets proper cursor for window when viewer operation is activated
805 ::setCursor(const int operation)
807 if (!myGUIWindow) return;
810 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
811 myGUIWindow->setCursor(myZoomCursor);
812 myCursorState = true;
814 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
815 myGUIWindow->setCursor(myPanCursor);
816 myCursorState = true;
818 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
819 myGUIWindow->setCursor(myRotateCursor);
820 myCursorState = true;
822 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
823 myGUIWindow->setCursor(mySpinCursor);
824 myCursorState = true;
826 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
827 myGUIWindow->setCursor(myGlobalPanCursor);
828 myCursorState = true;
830 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
831 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
832 myGUIWindow->setCursor(myHandCursor);
833 myCursorState = true;
835 case VTK_INTERACTOR_STYLE_CAMERA_NONE:
837 myGUIWindow->setCursor(myDefCursor);
838 myCursorState = false;
844 //----------------------------------------------------------------------------
845 // called when viewer operation started (!put necessary initialization here!)
850 if (!myGUIWindow) return;
851 // VSV: LOD actor activisation
852 // this->Interactor->GetRenderWindow()->SetDesiredUpdateRate(this->Interactor->GetDesiredUpdateRate());
854 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
855 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
857 QPainter p(myGUIWindow);
858 p.setPen(Qt::lightGray);
859 p.setRasterOp(Qt::XorROP);
860 p.drawRect(QRect(myPoint, myOtherPoint));
863 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
864 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
865 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
866 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
867 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
873 //----------------------------------------------------------------------------
874 // called when viewer operation finished (!put necessary post-processing here!)
877 ::onFinishOperation()
882 // VSV: LOD actor activisation
883 // rwi->GetRenderWindow()->SetDesiredUpdateRate(rwi->GetStillUpdateRate());
885 Selection_Mode aSelectionMode = myViewWindow->SelectionMode();
886 bool aSelActiveCompOnly = false;
888 QString aComponentDataType;
889 if(SUIT_Session* aSession = SUIT_Session::session())
890 if(SUIT_Application* aSUITApp = aSession->activeApplication())
891 if(CAM_Application* aCAMApp = dynamic_cast<CAM_Application*>(aSUITApp))
892 if(CAM_Module* aModule = aCAMApp->activeModule())
893 aComponentDataType = aModule->name();
896 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
897 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
899 QPainter p(myGUIWindow);
900 p.setPen(Qt::lightGray);
901 p.setRasterOp(Qt::XorROP);
902 QRect rect(myPoint, myOtherPoint);
904 rect = rect.normalize();
905 if (State == VTK_INTERACTOR_STYLE_CAMERA_FIT) {
906 // making fit rect opeation
908 myInteractor->GetSize(w, h);
911 y1 = h - rect.top() - 1;
913 y2 = h - rect.bottom() - 1;
914 fitRect(x1, y1, x2, y2);
917 if (myPoint == myOtherPoint) {
918 // process point selection
920 myInteractor->GetSize(w, h);
922 y = h - myPoint.y() - 1;
924 this->FindPokedRenderer(x, y);
925 myInteractor->StartPickCallback();
927 vtkPicker* aPicker = vtkPicker::SafeDownCast(myInteractor->GetPicker());
928 aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
930 SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
932 if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
933 int aVtkId = picker->GetCellId();
934 if ( aVtkId >= 0 && aSActor && aSActor->hasIO() && IsValid( aSActor, aVtkId ) ) {
935 int anObjId = aSActor->GetElemObjId(aVtkId);
937 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
938 if(aSelectionMode != EdgeOfCellSelection) {
939 if(CheckDimensionId(aSelectionMode,aSActor,anObjId)){
940 if(MYDEBUG) INFOS(" CellId : "<<anObjId);
941 if (GetSelector()->IsSelected(anIO)) {
942 // This IO is already in the selection
943 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
946 this->HighlightProp( NULL );
947 GetSelector()->ClearIObjects();
949 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
950 GetSelector()->AddIObject(aSActor);
955 this->HighlightProp( NULL );
956 GetSelector()->ClearIObjects();
958 int anEdgeId = GetEdgeId(picker,aSActor,anObjId);
960 if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
961 GetSelector()->AddOrRemoveIndex(anIO,anObjId,false);
962 GetSelector()->AddOrRemoveIndex(anIO,-anEdgeId-1,true);
963 GetSelector()->AddIObject(aSActor);
968 this->HighlightProp( NULL );
969 GetSelector()->ClearIObjects();
971 } else if ( vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker) ) {
972 int aVtkId = picker->GetPointId();
973 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ) {
974 if ( aSActor && aSActor->hasIO() ) {
975 int anObjId = aSActor->GetNodeObjId(aVtkId);
977 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
978 if(GetSelector()->IsSelected(anIO)) {
979 // This IO is already in the selection
980 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
983 this->HighlightProp( NULL );
984 GetSelector()->ClearIObjects();
986 if(MYDEBUG) INFOS(" PointId : "<<anObjId);
987 GetSelector()->AddOrRemoveIndex(anIO,anObjId,myShiftState);
988 GetSelector()->AddIObject(aSActor);
993 this->HighlightProp( NULL );
994 GetSelector()->ClearIObjects();
997 if ( aSActor && aSActor->hasIO() ) {
999 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1000 if(GetSelector()->IsSelected(anIO)) {
1001 // This IO is already in the selection
1003 GetSelector()->RemoveIObject(aSActor);
1008 this->HighlightProp( NULL );
1009 GetSelector()->ClearIObjects();
1011 GetSelector()->AddIObject(aSActor);
1014 // No selection clear all
1015 this->PropPicked = 0;
1016 this->HighlightProp( NULL );
1017 GetSelector()->ClearIObjects();
1020 myInteractor->EndPickCallback();
1022 //processing rectangle selection
1023 if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
1024 myInteractor->StartPickCallback();
1026 if (!myShiftState) {
1027 this->PropPicked = 0;
1028 this->HighlightProp( NULL );
1029 GetSelector()->ClearIObjects();
1033 // vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1034 QRect rect(myPoint, myOtherPoint);
1035 rect = rect.normalize();
1037 myInteractor->GetSize(w, h);
1040 y1 = h - rect.top() - 1;
1042 y2 = h - rect.bottom() - 1;
1044 switch (aSelectionMode) {
1045 case NodeSelection: {
1046 if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(myInteractor->GetPicker()) ) {
1047 vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
1048 aListActors->InitTraversal();
1049 while (vtkActor* aActor = aListActors->GetNextActor()) {
1050 if (!aActor->GetVisibility())
1052 if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1053 if (aSActor->hasIO()) {
1054 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1057 if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
1059 if (vtkDataSet* aDataSet = aSActor->GetInput()) {
1060 TColStd_MapOfInteger anIndices;
1061 for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
1063 aDataSet->GetPoint(i,aPoint);
1064 if (IsInRect(aPoint,x1,y1,x2,y2)){
1066 ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
1067 if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
1068 if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
1069 if(anActorCollection->IsItemPresent(aSActor)){
1070 float aPickedPoint[3];
1071 aPointPicker->GetMapperPosition(aPickedPoint);
1072 vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
1073 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ){
1074 int anObjId = aSActor->GetNodeObjId(aVtkId);
1075 anIndices.Add(anObjId);
1082 if (!anIndices.IsEmpty()) {
1083 GetSelector()->AddOrRemoveIndex(anIO,anIndices,false);
1084 GetSelector()->AddIObject(aSActor);
1087 GetSelector()->RemoveIObject(aSActor);
1097 case EdgeOfCellSelection:
1100 case VolumeSelection:
1102 vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
1103 picker->SetTolerance(0.001);
1104 picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
1106 vtkActorCollection* aListActors = picker->GetActors();
1107 aListActors->InitTraversal();
1108 while(vtkActor* aActor = aListActors->GetNextActor()) {
1109 if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1110 if (aSActor->hasIO()) {
1111 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1112 if (aSelActiveCompOnly && aComponentDataType != anIO->getComponentDataType())
1114 VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
1115 if ( !cellList.empty() ) {
1116 if(MYDEBUG) INFOS ( " NAME Actor : " << aSActor->getName() );
1117 TColStd_MapOfInteger anIndexes;
1118 VTKViewer_CellDataSet::iterator it;
1119 for ( it = cellList.begin(); it != cellList.end(); ++it ) {
1120 int aCellId = (*it).cellId;
1122 if ( !IsValid( aSActor, aCellId ) )
1125 int anObjId = aSActor->GetElemObjId(aCellId);
1127 if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
1128 anIndexes.Add(anObjId);
1132 GetSelector()->AddOrRemoveIndex(anIO,anIndexes,true);
1133 GetSelector()->AddIObject(aSActor);
1140 case ActorSelection: // objects selection
1142 vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
1143 picker->SetTolerance(0.001);
1144 picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
1146 vtkActorCollection* aListActors = picker->GetActors();
1147 aListActors->InitTraversal();
1148 while(vtkActor* aActor = aListActors->GetNextActor()) {
1149 if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
1150 if (aSActor->hasIO()) {
1151 Handle(SALOME_InteractiveObject) anIO = aSActor->getIO();
1152 GetSelector()->AddIObject(aSActor);
1159 myInteractor->EndPickCallback();
1161 myViewWindow->onSelectionChanged();
1165 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
1166 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
1167 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
1168 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
1170 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
1173 myInteractor->GetSize(w, h);
1175 y = h - myPoint.y() - 1;
1180 if (myGUIWindow) myGUIWindow->update();
1185 // called during viewer operation when user moves mouse (!put necessary processing here!)
1187 SVTK_InteractorStyle
1188 ::onOperation(QPoint mousePos)
1190 if (!myGUIWindow) return;
1192 GetInteractor()->GetSize(w, h);
1194 case VTK_INTERACTOR_STYLE_CAMERA_PAN:
1196 // processing panning
1197 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1198 this->PanXY(mousePos.x(), myPoint.y(), myPoint.x(), mousePos.y());
1202 case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
1204 // processing zooming
1205 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1206 this->DollyXY(mousePos.x() - myPoint.x(), mousePos.y() - myPoint.y());
1210 case VTK_INTERACTOR_STYLE_CAMERA_ROTATE:
1212 // processing rotation
1213 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1214 this->RotateXY(mousePos.x() - myPoint.x(), myPoint.y() - mousePos.y());
1218 case VTK_INTERACTOR_STYLE_CAMERA_SPIN:
1220 // processing spinning
1221 //this->FindPokedCamera(mousePos.x(), mousePos.y());
1222 this->SpinXY(mousePos.x(), mousePos.y(), myPoint.x(), myPoint.y());
1226 case VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN:
1230 case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
1233 setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
1235 case VTK_INTERACTOR_STYLE_CAMERA_FIT:
1237 QPainter p(myGUIWindow);
1238 p.setPen(Qt::lightGray);
1239 p.setRasterOp(Qt::XorROP);
1240 p.drawRect(QRect(myPoint, myOtherPoint));
1241 myOtherPoint = mousePos;
1242 p.drawRect(QRect(myPoint, myOtherPoint));
1246 this->LastPos[0] = mousePos.x();
1247 this->LastPos[1] = h - mousePos.y() - 1;
1250 // called when selection mode changed (!put necessary initialization here!)
1252 SVTK_InteractorStyle
1253 ::OnSelectionModeChanged()
1256 myPreSelectionActor->SetVisibility(false);
1257 myElemId = myEdgeId = myNodeId = -1;
1258 mySelectedActor = NULL;
1261 // called when user moves mouse inside viewer window and there is no active viewer operation
1262 // (!put necessary processing here!)
1264 SVTK_InteractorStyle
1265 ::onCursorMove(QPoint mousePos)
1267 // processing highlighting
1268 Selection_Mode aSelectionMode = myViewWindow->SelectionMode();
1271 myInteractor->GetSize(w, h);
1272 x = mousePos.x(); y = h - mousePos.y() - 1;
1274 this->FindPokedRenderer(x,y);
1275 myInteractor->StartPickCallback();
1276 myPreSelectionActor->SetVisibility(false);
1278 vtkPicker* aPicker = vtkPicker::SafeDownCast(myInteractor->GetPicker());
1279 aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
1281 SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
1283 if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
1284 int aVtkId = picker->GetCellId();
1285 if ( aVtkId >= 0 ) {
1286 int anObjId = aSActor->GetElemObjId(aVtkId);
1287 if ( aSActor && aSActor->hasIO() && IsValid( aSActor, aVtkId ) ) {
1288 bool anIsSameObjId = (mySelectedActor == aSActor && myElemId == anObjId);
1289 bool aResult = anIsSameObjId;
1290 if(!anIsSameObjId) {
1291 if(aSelectionMode != EdgeOfCellSelection) {
1292 aResult = CheckDimensionId(aSelectionMode,aSActor,anObjId);
1294 mySelectedActor = aSActor;
1296 if(MYDEBUG) INFOS(" CellId : "<<anObjId);
1297 myInteractor->setCellData(anObjId,aSActor,myPreSelectionActor);
1301 if(aSelectionMode == EdgeOfCellSelection){
1302 int anEdgeId = GetEdgeId(picker,aSActor,anObjId);
1303 bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
1304 aResult = anIsSameEdgeId;
1305 if(!anIsSameEdgeId) {
1306 aResult = (anEdgeId >= 0);
1308 mySelectedActor = aSActor;
1309 myEdgeId = anEdgeId;
1311 if(MYDEBUG) INFOS(" CellId : "<<anObjId<<"; EdgeId : "<<anEdgeId);
1312 myInteractor->setEdgeData(anObjId,aSActor,-anEdgeId-1,myPreSelectionActor);
1317 myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
1318 myPreSelectionActor->SetVisibility(true);
1323 else if (vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker)) {
1324 int aVtkId = picker->GetPointId();
1325 if ( aVtkId >= 0 && IsValid( aSActor, aVtkId, true ) ) {
1326 if ( aSActor && aSActor->hasIO() ) {
1327 int anObjId = aSActor->GetNodeObjId(aVtkId);
1328 bool anIsSameObjId = (mySelectedActor == aSActor && myNodeId == anObjId);
1329 if(!anIsSameObjId) {
1330 mySelectedActor = aSActor;
1332 if(MYDEBUG) INFOS(" PointId : "<<anObjId);
1333 myInteractor->setPointData(anObjId,aSActor,myPreSelectionActor);
1335 myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
1336 myPreSelectionActor->SetVisibility(true);
1340 else if ( vtkPicker::SafeDownCast(aPicker) ) {
1342 if ( myPreViewActor != aSActor ) {
1343 if ( myPreViewActor != NULL ) {
1344 myPreViewActor->SetPreSelected( false );
1346 myPreViewActor = aSActor;
1348 if ( aSActor->hasIO() ) {
1349 Handle( SALOME_InteractiveObject) IO = aSActor->getIO();
1350 if ( !GetSelector()->IsSelected(IO) ) {
1351 // Find All actors with same IO
1352 vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
1353 theActors->InitTraversal();
1354 while( vtkActor *ac = theActors->GetNextActor() ) {
1355 if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
1356 if ( anActor->hasIO() ) {
1357 Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
1358 if(IO->isSame(IOS)) {
1359 anActor->SetPreSelected( true );
1368 myPreViewActor = NULL;
1369 vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
1370 theActors->InitTraversal();
1371 while( vtkActor *ac = theActors->GetNextActor() ) {
1372 if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
1373 anActor->SetPreSelected( false );
1378 myInteractor->EndPickCallback();
1379 //myInteractor->Render();
1380 myGUIWindow->update();
1382 this->LastPos[0] = x;
1383 this->LastPos[1] = y;
1386 // called on finsh GlobalPan operation
1388 SVTK_InteractorStyle
1389 ::Place(const int theX, const int theY)
1391 if (this->CurrentRenderer == NULL) {
1396 int *aSize = this->CurrentRenderer->GetRenderWindow()->GetSize();
1397 int centerX = aSize[0]/2;
1398 int centerY = aSize[1]/2;
1400 TranslateView(centerX, centerY, theX, theY);
1402 // restore zoom scale
1403 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1404 cam->SetParallelScale(myScale);
1405 ::ResetCameraClippingRange(this->CurrentRenderer);
1407 if (myGUIWindow) myGUIWindow->update();
1413 // Translates view from Point to Point
1415 SVTK_InteractorStyle
1416 ::TranslateView(int toX, int toY, int fromX, int fromY)
1418 vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
1419 double viewFocus[4], focalDepth, viewPoint[3];
1420 float newPickPoint[4], oldPickPoint[4], motionVector[3];
1421 cam->GetFocalPoint(viewFocus);
1423 this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
1424 viewFocus[2], viewFocus);
1425 focalDepth = viewFocus[2];
1427 this->ComputeDisplayToWorld(double(toX), double(toY),
1428 focalDepth, newPickPoint);
1429 this->ComputeDisplayToWorld(double(fromX),double(fromY),
1430 focalDepth, oldPickPoint);
1432 // camera motion is reversed
1433 motionVector[0] = oldPickPoint[0] - newPickPoint[0];
1434 motionVector[1] = oldPickPoint[1] - newPickPoint[1];
1435 motionVector[2] = oldPickPoint[2] - newPickPoint[2];
1437 cam->GetFocalPoint(viewFocus);
1438 cam->GetPosition(viewPoint);
1439 cam->SetFocalPoint(motionVector[0] + viewFocus[0],
1440 motionVector[1] + viewFocus[1],
1441 motionVector[2] + viewFocus[2]);
1442 cam->SetPosition(motionVector[0] + viewPoint[0],
1443 motionVector[1] + viewPoint[1],
1444 motionVector[2] + viewPoint[2]);
1448 /// Checks: is the given Actor within display coordinates?
1450 SVTK_InteractorStyle
1451 ::IsInRect(vtkActor* theActor,
1452 const int left, const int top,
1453 const int right, const int bottom)
1455 float* aBounds = theActor->GetBounds();
1456 float aMin[3], aMax[3];
1457 ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
1458 ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
1459 if (aMin[0] > aMax[0]) {
1460 float aBuf = aMin[0];
1464 if (aMin[1] > aMax[1]) {
1465 float aBuf = aMin[1];
1470 return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
1474 /// Checks: is the given Cell within display coordinates?
1476 SVTK_InteractorStyle
1477 ::IsInRect(vtkCell* theCell,
1478 const int left, const int top,
1479 const int right, const int bottom)
1481 float* aBounds = theCell->GetBounds();
1482 float aMin[3], aMax[3];
1483 ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
1484 ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
1485 if (aMin[0] > aMax[0]) {
1486 float aBuf = aMin[0];
1490 if (aMin[1] > aMax[1]) {
1491 float aBuf = aMin[1];
1496 return ((aMin[0]>left) && (aMax[0]<right) && (aMin[1]>bottom) && (aMax[1]<top));
1501 SVTK_InteractorStyle
1502 ::IsInRect(float* thePoint,
1503 const int left, const int top,
1504 const int right, const int bottom)
1507 ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
1509 return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
1513 SVTK_InteractorStyle
1514 ::SetFilter( const Handle(VTKViewer_Filter)& theFilter )
1516 myFilters[ theFilter->GetId() ] = theFilter;
1520 SVTK_InteractorStyle
1521 ::IsFilterPresent( const int theId )
1523 return myFilters.find( theId ) != myFilters.end();
1527 SVTK_InteractorStyle
1528 ::RemoveFilter( const int theId )
1530 if ( IsFilterPresent( theId ) )
1531 myFilters.erase( theId );
1536 SVTK_InteractorStyle
1537 ::IsValid( SALOME_Actor* theActor,
1539 const bool theIsNode )
1541 std::map<int, Handle(VTKViewer_Filter)>::const_iterator anIter;
1542 for ( anIter = myFilters.begin(); anIter != myFilters.end(); ++anIter )
1544 const Handle(VTKViewer_Filter)& aFilter = anIter->second;
1545 if ( theIsNode == aFilter->IsNodeFilter() &&
1546 !aFilter->IsValid( theActor, theId ) )
1552 Handle(VTKViewer_Filter)
1553 SVTK_InteractorStyle
1554 ::GetFilter( const int theId )
1556 return IsFilterPresent( theId ) ? myFilters[ theId ] : Handle(VTKViewer_Filter)();
1560 SVTK_InteractorStyle
1561 ::IncrementalPan( const int incrX, const int incrY )
1563 this->PanXY( incrX, incrY, 0, 0 );
1567 SVTK_InteractorStyle
1568 ::IncrementalZoom( const int incr )
1570 this->DollyXY( incr, incr );
1574 SVTK_InteractorStyle
1575 ::IncrementalRotate( const int incrX, const int incrY )
1577 this->RotateXY( incrX, -incrY );