+/*!
+ Sets preselection mode
+ \param theMode - new preselection mode
+*/
+void SVTK_Viewer::setPreSelectionMode( Preselection_Mode theMode )
+{
+ myPreSelectionMode = theMode;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetPreSelectionMode( theMode );
+ }
+ }
+}
+
+/*!
+ \return incremental speed value
+*/
+int SVTK_Viewer::incrementalSpeed() const
+{
+ return myIncrementSpeed;
+}
+
+/*!
+ \return modification mode of the incremental speed
+*/
+int SVTK_Viewer::incrementalSpeedMode() const
+{
+ return myIncrementMode;
+}
+
+/*!
+ Set the incremental speed value and modification mode
+ \param theValue - new value
+ \param theMode - new mode: 0 - arithmetic, 1 - geometrical progression
+*/
+void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode )
+{
+ myIncrementSpeed = theValue;
+ myIncrementMode = theMode;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetIncrementalSpeed( theValue, theMode );
+ }
+ }
+}
+
+/*!
+ \return spacemouse button assigned to the specified function
+ \param theIndex - function by number (from 1 to 3)
+*/
+int SVTK_Viewer::spacemouseBtn( const int theIndex ) const
+{
+ if ( theIndex < 1 || theIndex > 3 )
+ return -1;
+ return mySpaceBtn[theIndex-1];
+}
+
+/*!
+ Set the spacemouse buttons
+ \param theBtn1, theBtn2, theBtn3 - new buttons
+*/
+void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, const int theBtn3 )
+{
+ mySpaceBtn[0] = theBtn1;
+ mySpaceBtn[1] = theBtn2;
+ mySpaceBtn[2] = theBtn3;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
+ }
+ }
+}
+
+/*!
+ Sets new view manager
+ \param theViewManager - new view manager
+*/
+void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
+{
+ SUIT_ViewModel::setViewManager(theViewManager);
+
+ if ( !theViewManager )
+ return;
+
+ connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
+
+ connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
+
+ connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
+ this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+}
+
+/*!
+ Builds popup for vtk viewer
+*/
+void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
+{
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
+
+ thePopup->addSeparator();
+
+ if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
+ //Support of several toolbars in the popup menu
+ QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
+ QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
+ for( ; it!=last; it++ )
+ thePopup->addAction( (*it)->toggleViewAction() );
+ aView->RefreshDumpImage();
+ }
+}
+
+/*!
+ SLOT: called on mouse button press, empty implementation
+*/
+void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+{}
+
+/*!
+ SLOT: called on mouse move, empty implementation
+*/
+void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
+{}
+
+/*!
+ SLOT: called on mouse button release, empty implementation
+*/
+void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
+{}
+
+/*!
+ Enables/disables selection
+ \param isEnabled - new state
+*/
+void SVTK_Viewer::enableSelection(bool isEnabled)