1 #include "SVTK_Selector.h"
2 #include "SALOME_Actor.h"
4 #include <qapplication.h>
6 #include <vtkActorCollection.h>
7 #include <vtkRenderWindow.h>
8 #include <vtkRenderer.h>
11 #include "QtxAction.h"
13 #include "SUIT_Session.h"
14 #include "SUIT_ToolButton.h"
15 #include "SUIT_MessageBox.h"
17 #include "SUIT_Tools.h"
18 #include "SUIT_ResourceMgr.h"
19 #include "SUIT_FileDlg.h"
21 #include "VTKViewer_Transform.h"
22 #include "VTKViewer_Utilities.h"
24 #include "SVTK_Trihedron.h"
25 #include "SVTK_ViewWindow.h"
26 #include "SVTK_ViewModel.h"
27 #include "SVTK_RenderWindow.h"
28 #include "SVTK_RenderWindowInteractor.h"
29 #include "SVTK_InteractorStyle.h"
31 #include "SALOME_ListIteratorOfListIO.hxx"
33 #include "VTKViewer_Algorithm.h"
34 #include "SVTK_Functor.h"
36 //----------------------------------------------------------------------------
38 ::SVTK_ViewWindow( SUIT_Desktop* theDesktop,
39 SVTK_Viewer* theModel)
40 : SUIT_ViewWindow(theDesktop)
43 mySelector = new SVTK_Selector();
44 connect(this,SIGNAL(selectionChanged()),theModel,SLOT(onSelectionChanged()));
46 myTransform = VTKViewer_Transform::New();
47 myTrihedron = SVTK_Trihedron::New();
48 myRenderer = vtkRenderer::New() ;
50 myTrihedron->AddToRender( myRenderer );
52 myRenderWindow = new SVTK_RenderWindow( this, "RenderWindow" );
53 setCentralWidget(myRenderWindow);
54 myRenderWindow->setFocusPolicy( StrongFocus );
55 myRenderWindow->setFocus();
57 myRenderWindow->getRenderWindow()->AddRenderer( myRenderer );
59 myRenderer->GetActiveCamera()->ParallelProjectionOn();
60 myRenderer->LightFollowCameraOn();
61 myRenderer->TwoSidedLightingOn();
63 // Set BackgroundColor
64 QString BgrColorRed = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorRed");
65 QString BgrColorGreen = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorGreen");
66 QString BgrColorBlue = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorBlue");
68 if( !BgrColorRed.isEmpty() && !BgrColorGreen.isEmpty() && !BgrColorBlue.isEmpty() )
69 myRenderer->SetBackground( BgrColorRed.toInt()/255., BgrColorGreen.toInt()/255., BgrColorBlue.toInt()/255. );
71 myRenderer->SetBackground( 0, 0, 0 );
73 // Create an interactor.
74 myRWInteractor = SVTK_RenderWindowInteractor::New();
75 myRWInteractor->SetRenderWindow( myRenderWindow->getRenderWindow() );
76 myRWInteractor->setViewWindow( this );
78 SVTK_InteractorStyle* RWS = SVTK_InteractorStyle::New();
79 RWS->setGUIWindow( myRenderWindow );
80 RWS->setViewWindow( this );
81 myRWInteractor->SetInteractorStyle( RWS );
83 myRWInteractor->Initialize();
84 RWS->setTriedron( myTrihedron );
85 RWS->FindPokedRenderer( 0, 0 );
87 SetSelectionMode(ActorSelection);
89 setCentralWidget( myRenderWindow );
91 myToolBar = new QToolBar(this);
92 myToolBar->setCloseMode(QDockWindow::Undocked);
93 myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
98 connect( myRenderWindow, SIGNAL(KeyPressed( QKeyEvent* )),
99 this, SLOT(onKeyPressed( QKeyEvent* )) );
100 connect( myRenderWindow, SIGNAL(KeyReleased( QKeyEvent* )),
101 this, SLOT(onKeyReleased( QKeyEvent* )) );
102 connect( myRenderWindow, SIGNAL(MouseButtonPressed( QMouseEvent* )),
103 this, SLOT(onMousePressed( QMouseEvent* )) );
104 connect( myRenderWindow, SIGNAL(MouseButtonReleased( QMouseEvent* )),
105 this, SLOT(onMouseReleased( QMouseEvent* )) );
106 connect( myRenderWindow, SIGNAL(MouseDoubleClicked( QMouseEvent* )),
107 this, SLOT(onMouseDoubleClicked( QMouseEvent* )) );
108 connect( myRenderWindow, SIGNAL(MouseMove( QMouseEvent* )),
109 this, SLOT(onMouseMoving( QMouseEvent* )) );
111 connect( myRWInteractor, SIGNAL(RenderWindowModified()),
112 myRenderWindow, SLOT(update()) );
113 connect( myRWInteractor, SIGNAL(contextMenuRequested( QContextMenuEvent * )),
114 this, SIGNAL(contextMenuRequested( QContextMenuEvent * )) );
119 //----------------------------------------------------------------------------
123 myTransform->Delete();
124 // In order to ensure that the interactor unregisters
125 // this RenderWindow, we assign a NULL RenderWindow to
126 // it before deleting it.
127 myRWInteractor->SetRenderWindow( NULL );
128 myRWInteractor->Delete();
131 myRenderer->RemoveAllProps();
132 //m_Renderer->Delete() ;
133 myTrihedron->Delete();
136 //----------------------------------------------------------------------------
141 myRWInteractor->GetSInteractorStyle()->startZoom();
144 //----------------------------------------------------------------------------
149 myRWInteractor->GetSInteractorStyle()->startPan();
152 //----------------------------------------------------------------------------
157 myRWInteractor->GetSInteractorStyle()->startRotate();
160 //----------------------------------------------------------------------------
163 ::activateGlobalPanning()
165 if(myTrihedron->GetVisibleActorCount(myRenderer))
166 myRWInteractor->GetSInteractorStyle()->startGlobalPan();
169 //----------------------------------------------------------------------------
172 ::activateWindowFit()
174 myRWInteractor->GetSInteractorStyle()->startFitArea();
177 //----------------------------------------------------------------------------
182 if (!myActionsMap.isEmpty()) return;
184 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
189 aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
190 tr( "MNU_DUMP_VIEW" ), 0, this);
191 aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
192 connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
193 myActionsMap[ DumpId ] = aAction;
196 aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
197 tr( "MNU_FITALL" ), 0, this);
198 aAction->setStatusTip(tr("DSC_FITALL"));
199 connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll()));
200 myActionsMap[ FitAllId ] = aAction;
203 aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
204 tr( "MNU_FITRECT" ), 0, this);
205 aAction->setStatusTip(tr("DSC_FITRECT"));
206 connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
207 myActionsMap[ FitRectId ] = aAction;
210 aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
211 tr( "MNU_ZOOM_VIEW" ), 0, this);
212 aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
213 connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom()));
214 myActionsMap[ ZoomId ] = aAction;
217 aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
218 tr( "MNU_PAN_VIEW" ), 0, this);
219 aAction->setStatusTip(tr("DSC_PAN_VIEW"));
220 connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning()));
221 myActionsMap[ PanId ] = aAction;
224 aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
225 tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
226 aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
227 connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
228 myActionsMap[ GlobalPanId ] = aAction;
231 aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
232 tr( "MNU_ROTATE_VIEW" ), 0, this);
233 aAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
234 connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation()));
235 myActionsMap[ RotationId ] = aAction;
238 aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
239 tr( "MNU_FRONT_VIEW" ), 0, this);
240 aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
241 connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView()));
242 myActionsMap[ FrontId ] = aAction;
244 aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
245 tr( "MNU_BACK_VIEW" ), 0, this);
246 aAction->setStatusTip(tr("DSC_BACK_VIEW"));
247 connect(aAction, SIGNAL(activated()), this, SLOT(onBackView()));
248 myActionsMap[ BackId ] = aAction;
250 aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
251 tr( "MNU_TOP_VIEW" ), 0, this);
252 aAction->setStatusTip(tr("DSC_TOP_VIEW"));
253 connect(aAction, SIGNAL(activated()), this, SLOT(onTopView()));
254 myActionsMap[ TopId ] = aAction;
256 aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
257 tr( "MNU_BOTTOM_VIEW" ), 0, this);
258 aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
259 connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView()));
260 myActionsMap[ BottomId ] = aAction;
262 aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
263 tr( "MNU_LEFT_VIEW" ), 0, this);
264 aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
265 connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView()));
266 myActionsMap[ LeftId ] = aAction;
268 aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
269 tr( "MNU_RIGHT_VIEW" ), 0, this);
270 aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
271 connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
272 myActionsMap[ RightId ] = aAction;
275 aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
276 tr( "MNU_RESET_VIEW" ), 0, this);
277 aAction->setStatusTip(tr("DSC_RESET_VIEW"));
278 connect(aAction, SIGNAL(activated()), this, SLOT(onResetView()));
279 myActionsMap[ ResetId ] = aAction;
282 //----------------------------------------------------------------------------
287 myActionsMap[DumpId]->addTo(myToolBar);
289 SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
290 aScaleBtn->AddAction(myActionsMap[FitAllId]);
291 aScaleBtn->AddAction(myActionsMap[FitRectId]);
292 aScaleBtn->AddAction(myActionsMap[ZoomId]);
294 SUIT_ToolButton* aPanningBtn = new SUIT_ToolButton(myToolBar);
295 aPanningBtn->AddAction(myActionsMap[PanId]);
296 aPanningBtn->AddAction(myActionsMap[GlobalPanId]);
298 myActionsMap[RotationId]->addTo(myToolBar);
300 SUIT_ToolButton* aViewsBtn = new SUIT_ToolButton(myToolBar);
301 aViewsBtn->AddAction(myActionsMap[FrontId]);
302 aViewsBtn->AddAction(myActionsMap[BackId]);
303 aViewsBtn->AddAction(myActionsMap[TopId]);
304 aViewsBtn->AddAction(myActionsMap[BottomId]);
305 aViewsBtn->AddAction(myActionsMap[LeftId]);
306 aViewsBtn->AddAction(myActionsMap[RightId]);
308 myActionsMap[ResetId]->addTo(myToolBar);
311 //----------------------------------------------------------------------------
316 vtkCamera* camera = myRenderer->GetActiveCamera();
317 camera->SetPosition(1,0,0);
318 camera->SetViewUp(0,0,1);
319 camera->SetFocalPoint(0,0,0);
323 //----------------------------------------------------------------------------
328 vtkCamera* camera = myRenderer->GetActiveCamera();
329 camera->SetPosition(-1,0,0);
330 camera->SetViewUp(0,0,1);
331 camera->SetFocalPoint(0,0,0);
335 //----------------------------------------------------------------------------
340 vtkCamera* camera = myRenderer->GetActiveCamera();
341 camera->SetPosition(0,0,1);
342 camera->SetViewUp(0,1,0);
343 camera->SetFocalPoint(0,0,0);
347 //----------------------------------------------------------------------------
352 vtkCamera* camera = myRenderer->GetActiveCamera();
353 camera->SetPosition(0,0,-1);
354 camera->SetViewUp(0,1,0);
355 camera->SetFocalPoint(0,0,0);
359 //----------------------------------------------------------------------------
364 vtkCamera* camera = myRenderer->GetActiveCamera();
365 camera->SetPosition(0,-1,0);
366 camera->SetViewUp(0,0,1);
367 camera->SetFocalPoint(0,0,0);
371 //----------------------------------------------------------------------------
376 vtkCamera* camera = myRenderer->GetActiveCamera();
377 camera->SetPosition(0,1,0);
378 camera->SetViewUp(0,0,1);
379 camera->SetFocalPoint(0,0,0);
383 //----------------------------------------------------------------------------
388 int aTrihedronIsVisible = isTrihedronDisplayed();
389 myTrihedron->SetVisibility( VTKViewer_Trihedron::eOnlyLineOn );
390 ::ResetCamera(myRenderer,true);
391 vtkCamera* aCamera = myRenderer->GetActiveCamera();
392 aCamera->SetPosition(1,-1,1);
393 aCamera->SetViewUp(0,0,1);
394 ::ResetCamera(myRenderer,true);
395 if(aTrihedronIsVisible) myTrihedron->VisibilityOn();
396 else myTrihedron->VisibilityOff();
397 static float aCoeff = 3.0;
398 aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
402 //----------------------------------------------------------------------------
407 myRWInteractor->GetSInteractorStyle()->ViewFitAll();
411 //----------------------------------------------------------------------------
416 QApplication::setOverrideCursor( Qt::waitCursor );
417 QPixmap px = QPixmap::grabWindow(myRenderWindow->winId());
418 QApplication::restoreOverrideCursor();
420 QString fileName = SUIT_FileDlg::getFileName(this,
422 tr("VTK_IMAGE_FILES"),
423 tr("INF_APP_DUMP_VIEW"),
425 if (!fileName.isNull()) {
426 QApplication::setOverrideCursor( Qt::waitCursor );
427 QString fmt = SUIT_Tools::extension( fileName ).upper();
429 fmt = QString("BMP"); // default format
432 bool bOk = px.save(fileName, fmt.latin1());
433 QApplication::restoreOverrideCursor();
435 SUIT_MessageBox::error1(this, tr("ERROR"), tr("ERR_DOC_CANT_SAVE_FILE"), tr("BUT_OK"));
440 //----------------------------------------------------------------
443 ::onSelectionChanged()
447 const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
448 SALOME_ListIteratorOfListIO anIter(aListIO);
449 for(; anIter.More(); anIter.Next()){
450 highlight(anIter.Value(),true,!anIter.More());
453 emit selectionChanged();
456 //----------------------------------------------------------------
459 ::SetSelectionMode(Selection_Mode theMode)
461 mySelector->SetSelectionMode(theMode);
462 myRWInteractor->SetSelectionMode(theMode);
465 //----------------------------------------------------------------
468 ::SelectionMode() const
470 return mySelector->SelectionMode();
473 //----------------------------------------------------------------
478 myRWInteractor->unHighlightAll();
481 //----------------------------------------------------------------
484 ::highlight( const Handle(SALOME_InteractiveObject)& theIO,
488 myRWInteractor->highlight(theIO, theIsHighlight, theIsUpdate);
490 if(mySelector->HasIndex(theIO) && theIO->hasEntry()){
491 TColStd_IndexedMapOfInteger aMapIndex;
492 mySelector->GetIndex(theIO,aMapIndex);
494 const char* anEntry = theIO->getEntry();
495 vtkActorCollection* aCollection = myRenderer->GetActors();
496 if(SALOME_Actor* anActor = Find<SALOME_Actor>(aCollection,TIsSameEntry<SALOME_Actor>(anEntry))){
497 switch (mySelector->SelectionMode()) {
499 myRWInteractor->highlightPoint(aMapIndex,anActor,theIsHighlight,theIsUpdate);
501 case EdgeOfCellSelection:
502 myRWInteractor->highlightEdge(aMapIndex,anActor,theIsHighlight,theIsUpdate);
507 case VolumeSelection:
508 myRWInteractor->highlightCell(aMapIndex,anActor,theIsHighlight,theIsUpdate);
513 myRWInteractor->unHighlightSubSelection();
517 //----------------------------------------------------------------
520 ::isInViewer( const Handle(SALOME_InteractiveObject)& theIO )
522 return myRWInteractor->isInViewer( theIO );
525 //----------------------------------------------------------------
528 ::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
530 return myRWInteractor->isVisible( theIO );
533 //----------------------------------------------------------------------------
536 ::setBackgroundColor( const QColor& color )
539 myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
542 //----------------------------------------------------------------------------
545 ::backgroundColor() const
549 myRenderer->GetBackground( backint );
550 return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255));
552 return SUIT_ViewWindow::backgroundColor();
555 //----------------------------------------------------------------------------
558 ::Repaint(bool theUpdateTrihedron)
560 if (theUpdateTrihedron)
562 myRenderWindow->update();
565 //----------------------------------------------------------------------------
568 ::GetScale( double theScale[3] )
570 myTransform->GetScale( theScale );
573 //----------------------------------------------------------------------------
576 ::SetScale( double theScale[3] )
578 myTransform->SetScale( theScale[0], theScale[1], theScale[2] );
579 myRWInteractor->Render();
583 //----------------------------------------------------------------------------
586 ::isTrihedronDisplayed()
588 return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
591 //----------------------------------------------------------------------------
599 if(isTrihedronDisplayed())
600 myTrihedron->VisibilityOff();
602 myTrihedron->VisibilityOn();
607 //----------------------------------------------------------------------------
610 ::ComputeTrihedronSize( double& theNewSize, double& theSize )
612 // calculating diagonal of visible props of the renderer
614 myTrihedron->VisibilityOff();
616 if ( ::ComputeVisiblePropBounds( myRenderer, aBndBox ) == 0 ) {
617 aBndBox[ 1 ] = aBndBox[ 3 ] = aBndBox[ 5 ] = 100;
618 aBndBox[ 0 ] = aBndBox[ 2 ] = aBndBox[ 4 ] = 0;
621 myTrihedron->VisibilityOn();
623 static bool aCalcByDiag = false;
625 aLength = sqrt( ( aBndBox[1]-aBndBox[0])*(aBndBox[1]-aBndBox[0] )+
626 ( aBndBox[3]-aBndBox[2])*(aBndBox[3]-aBndBox[2] )+
627 ( aBndBox[5]-aBndBox[4])*(aBndBox[5]-aBndBox[4] ) );
629 aLength = aBndBox[ 1 ]-aBndBox[ 0 ];
630 aLength = max( ( aBndBox[ 3 ] - aBndBox[ 2 ] ),aLength );
631 aLength = max( ( aBndBox[ 5 ] - aBndBox[ 4 ] ),aLength );
634 static float aSizeInPercents = 105;
635 //QString aSetting = QAD_CONFIG->getSetting( "Viewer:TrihedronSize" );
636 //if ( !aSetting.isEmpty() )
637 // aSizeInPercents = aSetting.toFloat();
639 static float EPS_SIZE = 5.0E-3;
640 theSize = myTrihedron->GetSize();
641 theNewSize = aLength * aSizeInPercents / 100.0;
643 // if the new trihedron size have sufficient difference, then apply the value
644 return fabs( theNewSize - theSize) > theSize * EPS_SIZE ||
645 fabs( theNewSize-theSize ) > theNewSize * EPS_SIZE;
648 //----------------------------------------------------------------------------
651 ::GetTrihedronSize() const
653 return myTrihedron->GetSize();
656 //----------------------------------------------------------------------------
659 ::AdjustTrihedrons( const bool theIsForcedUpdate )
661 if ( !isTrihedronDisplayed() && !theIsForcedUpdate )
664 int aVisibleNum = myTrihedron->GetVisibleActorCount( myRenderer );
665 if ( aVisibleNum || theIsForcedUpdate ) {
666 // if the new trihedron size have sufficient difference, then apply the value
667 double aNewSize = 100, anOldSize;
668 if ( ComputeTrihedronSize( aNewSize, anOldSize ) || theIsForcedUpdate ) {
669 myTrihedron->SetSize( aNewSize );
670 // itearte throuh displayed objects and set size if necessary
672 vtkActorCollection* anActors = getRenderer()->GetActors();
673 anActors->InitTraversal();
674 while( vtkActor* anActor = anActors->GetNextActor() ) {
675 if( SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast( anActor ) ) {
676 if ( aSActor->IsResizable() )
677 aSActor->SetSize( 0.5 * aNewSize );
683 ::ResetCameraClippingRange(myRenderer);
686 //----------------------------------------------------------------------------
689 ::onAdjustTrihedron()
691 AdjustTrihedrons( false );
694 #define INCREMENT_FOR_OP 10
696 //=======================================================================
698 // Purpose : Performs incremental panning to the left
699 //=======================================================================
704 myRWInteractor->GetSInteractorStyle()->IncrementalPan( -INCREMENT_FOR_OP, 0 );
707 //=======================================================================
709 // Purpose : Performs incremental panning to the right
710 //=======================================================================
715 myRWInteractor->GetSInteractorStyle()->IncrementalPan( INCREMENT_FOR_OP, 0 );
718 //=======================================================================
720 // Purpose : Performs incremental panning to the top
721 //=======================================================================
726 myRWInteractor->GetSInteractorStyle()->IncrementalPan( 0, INCREMENT_FOR_OP );
729 //=======================================================================
731 // Purpose : Performs incremental panning to the bottom
732 //=======================================================================
737 myRWInteractor->GetSInteractorStyle()->IncrementalPan( 0, -INCREMENT_FOR_OP );
740 //=======================================================================
742 // Purpose : Performs incremental zooming in
743 //=======================================================================
748 myRWInteractor->GetSInteractorStyle()->IncrementalZoom( INCREMENT_FOR_OP );
751 //=======================================================================
753 // Purpose : Performs incremental zooming out
754 //=======================================================================
759 myRWInteractor->GetSInteractorStyle()->IncrementalZoom( -INCREMENT_FOR_OP );
762 //=======================================================================
763 // name : onRotateLeft
764 // Purpose : Performs incremental rotating to the left
765 //=======================================================================
770 myRWInteractor->GetSInteractorStyle()->IncrementalRotate( -INCREMENT_FOR_OP, 0 );
773 //=======================================================================
774 // name : onRotateRight
775 // Purpose : Performs incremental rotating to the right
776 //=======================================================================
781 myRWInteractor->GetSInteractorStyle()->IncrementalRotate( INCREMENT_FOR_OP, 0 );
784 //=======================================================================
786 // Purpose : Performs incremental rotating to the top
787 //=======================================================================
792 myRWInteractor->GetSInteractorStyle()->IncrementalRotate( 0, -INCREMENT_FOR_OP );
795 //=======================================================================
798 ::onKeyPressed(QKeyEvent* event)
800 emit keyPressed( this, event );
803 //=======================================================================
806 ::onKeyReleased(QKeyEvent* event)
808 emit keyReleased( this, event );
811 //=======================================================================
814 ::onMousePressed(QMouseEvent* event)
816 emit mousePressed(this, event);
819 //=======================================================================
822 ::onMouseReleased(QMouseEvent* event)
824 emit mouseReleased( this, event );
827 //=======================================================================
830 ::onMouseMoving(QMouseEvent* event)
832 emit mouseMoving( this, event );
835 //=======================================================================
838 ::onMouseDoubleClicked( QMouseEvent* event )
840 emit mouseDoubleClicked( this, event );
843 //=======================================================================
844 // name : onRotateDown
845 // Purpose : Performs incremental rotating to the bottom
846 //=======================================================================
851 myRWInteractor->GetSInteractorStyle()->IncrementalRotate( 0, INCREMENT_FOR_OP );
854 //----------------------------------------------------------------------------
857 ::InsertActor( SALOME_Actor* theActor, bool theMoveInternalActors )
859 theActor->AddToRender(myRenderer);
860 theActor->SetTransform(myTransform);
861 if(theMoveInternalActors)
862 myRWInteractor->MoveInternalActors();
865 //----------------------------------------------------------------------------
868 ::AddActor( SALOME_Actor* theActor, bool theUpdate /*=false*/ )
870 InsertActor(theActor);
875 //----------------------------------------------------------------------------
878 ::RemoveActor( SALOME_Actor* theActor, bool theUpdate /*=false*/ )
880 theActor->RemoveFromRender(myRenderer);
885 //----------------------------------------------------------------------------
888 ::MoveActor( SALOME_Actor* theActor)
890 RemoveActor(theActor);
891 InsertActor(theActor,true);