SVTK_Viewer* vm = dynamic_cast<SVTK_Viewer*>( viewMgr->getViewModel() );
if( vm )
{
+ vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+ vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) );
+ vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
+ resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
+ vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
+ resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
+ resMgr->integerValue( "VTKViewer", "spacemouse_func3_btn", vm->spacemouseBtn(3) ) );
new LightApp_VTKSelector( vm, mySelMgr );
vm->connectToApplication(this);
}
int supervGroup = pref->addPreference( tr( "PREF_GROUP_SUPERV" ), viewTab );
pref->setItemProperty( "columns", 4, occGroup );
- pref->setItemProperty( "columns", 4, vtkGroup );
+ pref->setItemProperty( "columns", 1, vtkGroup );
pref->setItemProperty( "columns", 4, plot2dGroup );
+ // OCC Viewer
int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup,
LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
pref->setItemProperty( "min", 0, isoV );
pref->setItemProperty( "max", 100000, isoV );
- int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGroup,
- LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGroup,
+ // VTK Viewer
+ int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
+ pref->setItemProperty( "columns", 2, vtkGen );
+
+ int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
+ QStringList aProjModeList;
+ aProjModeList.append( tr("PREF_ORTHOGRAPHIC") );
+ aProjModeList.append( tr("PREF_PERSPECTIVE") );
+
+ QList<QVariant> aModeIndexesList;
+ aModeIndexesList.append(0);
+ aModeIndexesList.append(1);
+
+ pref->setItemProperty( "strings", aProjModeList, vtkProjMode );
+ pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode );
+
+ pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
LightApp_Preferences::Color, "VTKViewer", "background" );
- pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+
+ int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGen,
+ LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
pref->setItemProperty( "min", 1.0E-06, vtkTS );
pref->setItemProperty( "max", 150, vtkTS );
+ pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+
+ int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
+ QStringList aStyleModeList;
+ aStyleModeList.append( tr("PREF_STANDARD_STYLE") );
+ aStyleModeList.append( tr("PREF_KEYFREE_STYLE") );
+
+ pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
+ pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
+
+ pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
+
+ int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
+ LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
+
+ pref->setItemProperty( "min", 1, vtkSpeed );
+ pref->setItemProperty( "max", 1000, vtkSpeed );
+
+ int vtkSpeedMode = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED_MODE" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
+ QStringList aSpeedModeList;
+ aSpeedModeList.append( tr("PREF_ARITHMETIC") );
+ aSpeedModeList.append( tr("PREF_GEOMETRICAL") );
+
+ pref->setItemProperty( "strings", aSpeedModeList, vtkSpeedMode );
+ pref->setItemProperty( "indexes", aModeIndexesList, vtkSpeedMode );
+
+ int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox );
+ pref->setItemProperty( "columns", 2, vtkSM );
+ int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM,
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func1_btn" ); //decrease_speed_increment
+ int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM,
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func2_btn" ); //increase_speed_increment
+ int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM,
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func3_btn" ); //dominant_combined_switch
+
+ QStringList values;
+ values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_2" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_3" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_4" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_5" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_6" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_7" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_8" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_*" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_10" ) );
+ values.append( tr( "PREF_SPACEMOUSE_BTN_11" ) );
+ QList<QVariant> indices;
+ indices.append( 1 );
+ indices.append( 2 );
+ indices.append( 3 );
+ indices.append( 4 );
+ indices.append( 5 );
+ indices.append( 6 );
+ indices.append( 7 );
+ indices.append( 8 );
+ indices.append( 9 ); // == button_*
+ indices.append( 10 );
+ indices.append( 11 );
+ pref->setItemProperty( "strings", values, spacemousePref1 );
+ pref->setItemProperty( "indexes", indices, spacemousePref1 );
+ pref->setItemProperty( "strings", values, spacemousePref2 );
+ pref->setItemProperty( "indexes", indices, spacemousePref2 );
+ pref->setItemProperty( "strings", values, spacemousePref3 );
+ pref->setItemProperty( "indexes", indices, spacemousePref3 );
+
+ // Plot2d
pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup,
LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
}
#endif
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && (param == QString( "speed_value" ) || param == QString( "speed_mode" )) )
+ {
+ int speed = resMgr->integerValue( "VTKViewer", "speed_value", 10 );
+ int mode = resMgr->integerValue( "VTKViewer", "speed_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setIncrementalSpeed( speed, mode );
+ }
+#endif
+ }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "projection_mode" ) )
+ {
+ int mode = resMgr->integerValue( "VTKViewer", "projection_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setProjectionMode( mode );
+ }
+#endif
+ }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "navigation_mode" ) )
+ {
+ int mode = resMgr->integerValue( "VTKViewer", "navigation_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setInteractionStyle( mode );
+ }
+#endif
+ }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) ||
+ param == QString( "spacemouse_func2_btn" ) ||
+ param == QString( "spacemouse_func3_btn" ) ) )
+ {
+ int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 );
+ int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 );
+ int btn3 = resMgr->integerValue( "VTKViewer", "spacemouse_func3_btn", 9 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setSpacemouseButtons( btn1, btn2, btn3 );
+ }
+#endif
+ }
+#endif
+
#ifndef DISABLE_OCCVIEWER
if ( sec == QString( "OCCViewer" ) && ( param == QString( "iso_number_u" ) || param == QString( "iso_number_v" ) ) )
{
<parameter name="trihedron_size" value="100" />
</section>
<section name="VTKViewer" >
- <!-- OCC viewer preferences -->
+ <!-- VTK viewer preferences -->
<parameter name="background" value="0, 0, 0"/>
+ <parameter name="projection_mode" value="0" />
<parameter name="trihedron_size" value="100" />
+ <parameter name="navigation_mode" value="0" />
+ <parameter name="speed_value" val ue="10" />
+ <parameter name="speed_mode" value="0" />
+ <parameter name="spacemouse_func1_btn" value="1" />
+ <parameter name="spacemouse_func2_btn" value="2" />
+ <parameter name="spacemouse_func3_btn" value="9" />
</section>
<section name="Plot2d" >
<!-- Plot2d viewer preferences -->
<source>PREF_STORE_POS</source>
<translation>Store positions of windows</translation>
</message>
+ <message>
+ <source>PREF_PROJECTION_MODE</source>
+ <translation>Projection mode:</translation>
+ </message>
+ <message>
+ <source>PREF_ORTHOGRAPHIC</source>
+ <translation>Orthogonal</translation>
+ </message>
+ <message>
+ <source>PREF_PERSPECTIVE</source>
+ <translation>Perspective</translation>
+ </message>
+ <message>
+ <source>PREF_NAVIGATION</source>
+ <translation>Navigation:</translation>
+ </message>
+ <message>
+ <source>PREF_STANDARD_STYLE</source>
+ <translation>Salome standard controls</translation>
+ </message>
+ <message>
+ <source>PREF_KEYFREE_STYLE</source>
+ <translation>Keyboard free style</translation>
+ </message>
+ <message>
+ <source>PREF_INCREMENTAL_SPEED</source>
+ <translation>Speed increment:</translation>
+ </message>
+ <message>
+ <source>PREF_INCREMENTAL_SPEED_MODE</source>
+ <translation>Modification mode:</translation>
+ </message>
+ <message>
+ <source>PREF_ARITHMETIC</source>
+ <translation>Arithmetic progression</translation>
+ </message>
+ <message>
+ <source>PREF_GEOMETRICAL</source>
+ <translation>Geometrical progression</translation>
+ </message>
+ <message>
+ <source>PREF_FRAME_SPACEMOUSE</source>
+ <translation>Spacemouse</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_FUNC_1</source>
+ <translation>Decrease speed increment</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_FUNC_2</source>
+ <translation>Increase speed increment</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_FUNC_3</source>
+ <translation>Dominant / combined switch</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_1</source>
+ <translation>Button 1</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_2</source>
+ <translation>Button 2</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_3</source>
+ <translation>Button 3</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_4</source>
+ <translation>Button 4</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_5</source>
+ <translation>Button 5</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_6</source>
+ <translation>Button 6</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_7</source>
+ <translation>Button 7</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_8</source>
+ <translation>Button 8</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_*</source>
+ <translation>Button *</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_10</source>
+ <translation>Button 10</translation>
+ </message>
+ <message>
+ <source>PREF_SPACEMOUSE_BTN_11</source>
+ <translation>Button 11</translation>
+ </message>
<message>
<source>PREF_BOTTOM</source>
<translation>Bottom</translation>
}
/*!
- To get current increment controller
+ To set current increment controller
*/
void SVTK_InteractorStyle::SetControllerIncrement(SVTK_ControllerIncrement* theController)
{
myControllerIncrement=theController;
}
+/*!
+ To modify current increment controller
+*/
+void SVTK_InteractorStyle::SetIncrementSpeed(const int theValue, const int theMode)
+{
+ SVTK_ControllerIncrement* c = 0;
+ switch (theMode) {
+ case 0: c = SVTK_ControllerIncrement::New(); break;
+ case 1: c = SVTK_GeomControllerIncrement::New(); break;
+ }
+ c->SetStartValue(theValue);
+
+ SetControllerIncrement(c);
+ c->Delete();
+}
+
/*!
To get current increment controller
*/
//! Generate special #SVTK_SelectionEvent
- virtual
- SVTK_SelectionEvent*
- GetSelectionEvent();
+ virtual SVTK_SelectionEvent* GetSelectionEvent();
//! Generate special #SVTK_SelectionEvent with flipped Y coordinate
- virtual
- SVTK_SelectionEvent*
- GetSelectionEventFlipY();
+ virtual SVTK_SelectionEvent* GetSelectionEventFlipY();
//! Redefined in order to add an observer (callback) for custom event (space mouse event)
- virtual
- void
- SetInteractor( vtkRenderWindowInteractor* );
+ virtual void SetInteractor( vtkRenderWindowInteractor* );
//! To invoke #vtkRenderWindowInteractor::CreateTimer
- virtual
- void
- Render();
+ virtual void Render();
//! To implement cached rendering
- virtual
- void
- OnTimer();
+ virtual void OnTimer();
//! To reset reset view
- virtual
- void
- OnConfigure();
+ virtual void OnConfigure();
//! To handle mouse move event
- virtual
- void
- OnMouseMove();
+ virtual void OnMouseMove();
//! To handle left mouse button down event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnLeftButtonDown();
+ virtual void OnLeftButtonDown();
//! To handle left mouse button up event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnLeftButtonUp();
+ virtual void OnLeftButtonUp();
//! To handle middle mouse button down event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnMiddleButtonDown();
+ virtual void OnMiddleButtonDown();
//! To handle middle mouse button up event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnMiddleButtonUp();
+ virtual void OnMiddleButtonUp();
//! To handle right mouse button down event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnRightButtonDown();
+ virtual void OnRightButtonDown();
//! To handle right mouse button up event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnRightButtonUp();
+ virtual void OnRightButtonUp();
//! To handle keyboard event (reimplemented from #vtkInteractorStyle)
- virtual
- void
- OnChar();
+ virtual void OnChar();
//! To set current increment controller
void SetControllerIncrement(SVTK_ControllerIncrement*);
+ //! To modify current increment controller
+ void SetIncrementSpeed(const int, const int = 0);
+
//! To get current increment controller
SVTK_ControllerIncrement* ControllerIncrement();
Repaint();
}
+/*!
+ Redirect the request to SVTK_InteractorStyle::SetTrihedronSize
+*/
+void SVTK_MainWindow::SetIncrementalSpeed( const int theValue, const int theMode )
+{
+ if ( (SVTK_InteractorStyle*)GetInteractorStyle() )
+ ((SVTK_InteractorStyle*)GetInteractorStyle())->SetIncrementSpeed(theValue, theMode);
+}
+
+/*!
+ Redirect the request to SVTK_InteractorStyle
+*/
+void SVTK_MainWindow::SetSMButtons( const int theBtn1, const int theBtn2, const int theBtn3 )
+{
+ int val = theBtn1;
+ myEventDispatcher->InvokeEvent(SVTK::SetSMDecreaseSpeedEvent, &val);
+ val = theBtn2;
+ myEventDispatcher->InvokeEvent(SVTK::SetSMIncreaseSpeedEvent, &val);
+ val = theBtn3;
+ myEventDispatcher->InvokeEvent(SVTK::SetSMDominantCombinedSwitchEvent, &val);
+}
+
+
/*!
Redirect the request to SVTK_Renderer::GetTrihedronSize
*/
else {
PopInteractorStyle();
}
+
+ // update action state if method is called outside
+ action(SwitchInteractionStyleId)->setChecked( theOn );
}
/*!
virtual void RemoveActor(VTKViewer_Actor* theActor,
bool theIsUpdate = false);
+ //! Redirect the request to #SVTK_InteractorStyle::SetIncrementalSpeed
+ void SetIncrementalSpeed( const int, const int = 0 );
+
+ //! Redirect the request to #SVTK_InteractorStyle::SetIncrementalSpeed
+ void SetSMButtons( const int, const int, const int );
+
//! Redirect the request to #SVTK_Renderer::GetTrihedronSize
vtkFloatingPointType GetTrihedronSize();
myActiveModule = 0;
myTrihedronSize = 105;
myTrihedronRelative = true;
+ myIncrementSpeed = 10;
+ myIncrementMode = 0;
+ myProjMode = 0;
+ myStyle = 0;
+ mySpaceBtn[0] = 1;
+ mySpaceBtn[1] = 2;
+ mySpaceBtn[2] = 9;
}
/*!
/*!
\return background color
*/
-QColor
-SVTK_Viewer
-::backgroundColor() const
+QColor SVTK_Viewer::backgroundColor() const
{
return myBgColor;
}
Changes background color
\param theColor - new background color
*/
-void
-SVTK_Viewer
-::setBackgroundColor( const QColor& theColor )
+void SVTK_Viewer::setBackgroundColor( const QColor& theColor )
{
if ( !theColor.isValid() )
return;
/*!Create new instance of view window on desktop \a theDesktop.
*\retval SUIT_ViewWindow* - created view window pointer.
*/
-SUIT_ViewWindow*
-SVTK_Viewer::
-createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
{
TViewWindow* aViewWindow = new TViewWindow(theDesktop);
aViewWindow->Initialize(this);
}
}
+
+/*!
+ \return projection mode
+*/
+int SVTK_Viewer::projectionMode() const
+{
+ return myProjMode;
+}
+
+
+/*!
+ Sets projection mode: 0 - orthogonal, 1 - perspective projection
+ \param theMode - new projection mode
+*/
+void SVTK_Viewer::setProjectionMode( const int theMode )
+{
+ if ( myProjMode != theMode ) {
+ myProjMode = 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->SetProjectionMode( theMode );
+ }
+ }
+ }
+}
+
+/*!
+ \return interaction style
+*/
+int SVTK_Viewer::interactionStyle() const
+{
+ return myStyle;
+}
+
+/*!
+ Sets interaction style: 0 - standard, 1 - keyboard free interaction
+ \param theStyle - new interaction style
+*/
+void SVTK_Viewer::setInteractionStyle( const int theStyle )
+{
+ myStyle = theStyle;
+
+ 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->SetInteractionStyle( theStyle );
+ }
+ }
+}
+
+/*!
+ \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
/*!
Builds popup for vtk viewer
*/
-void
-SVTK_Viewer
-::contextMenuPopup( QMenu* thePopup )
+void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
{
thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
/*!
SLOT: called on mouse button press, empty implementation
*/
-void
-SVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+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)
+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)
+void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
{}
/*!
Enables/disables selection
\param isEnabled - new state
*/
-void
-SVTK_Viewer
-::enableSelection(bool isEnabled)
+void SVTK_Viewer::enableSelection(bool isEnabled)
{
mySelectionEnabled = isEnabled;
//!! To be done for view windows
Enables/disables selection of many object
\param isEnabled - new state
*/
-void
-SVTK_Viewer
-::enableMultiselection(bool isEnable)
+void SVTK_Viewer::enableMultiselection(bool isEnable)
{
myMultiSelectionEnabled = isEnable;
//!! To be done for view windows
/*!
SLOT: called on dump view operation is activated, stores scene to raster file
*/
-void
-SVTK_Viewer
-::onDumpView()
+void SVTK_Viewer::onDumpView()
{
if(SUIT_ViewWindow* aView = myViewManager->getActiveView())
aView->onDumpView();
/*!
SLOT: called if background color is to be changed changed, passes new color to view port
*/
-void
-SVTK_Viewer
-::onChangeBgColor()
+void SVTK_Viewer::onChangeBgColor()
{
if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
Display presentation
\param prs - presentation
*/
-void
-SVTK_Viewer
-::Display( const SALOME_VTKPrs* prs )
+void SVTK_Viewer::Display( const SALOME_VTKPrs* prs )
{
// try do downcast object
if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
\param prs - presentation
\param forced - removes object from view
*/
-void
-SVTK_Viewer
-::Erase( const SALOME_VTKPrs* prs, const bool forced )
+void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced )
{
// try do downcast object
if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>( prs )){
Erase all presentations
\param forced - removes all objects from view
*/
-void
-SVTK_Viewer
-::EraseAll( const bool forced )
+void SVTK_Viewer::EraseAll( const bool forced )
{
// Temporarily commented to avoid awful dependecy on SALOMEDS
// TODO: better mechanism of storing display/erse status in a study
Create presentation corresponding to the entry
\param entry - entry
*/
-SALOME_Prs*
-SVTK_Viewer
-::CreatePrs( const char* entry )
+SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry )
{
SVTK_Prs* prs = new SVTK_Prs();
if ( entry ) {
/*!
Auxiliary method called before displaying of objects
*/
-void
-SVTK_Viewer
-::BeforeDisplay( SALOME_Displayer* d )
+void SVTK_Viewer::BeforeDisplay( SALOME_Displayer* d )
{
d->BeforeDisplay( this, SALOME_VTKViewType() );
}
/*!
Auxiliary method called after displaying of objects
*/
-void
-SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
+void SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
{
d->AfterDisplay( this, SALOME_VTKViewType() );
}
\return true if object is displayed in viewer
\param obj - object to be checked
*/
-bool
-SVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& io )
+bool SVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& io )
{
QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
/*!
Updates current viewer
*/
-void
-SVTK_Viewer
-::Repaint()
+void SVTK_Viewer::Repaint()
{
// if (theUpdateTrihedron) onAdjustTrihedron();
QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
//! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
void setTrihedronSize( const vtkFloatingPointType, const bool = true );
+ //! Gets projection mode
+ int projectionMode() const;
+
+ //! Sets projection mode
+ void setProjectionMode( const int );
+
+ //! Gets interaction style
+ int interactionStyle() const;
+
+ //! Sets interaction style
+ void setInteractionStyle( const int );
+
+ //! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
+ int incrementalSpeed() const;
+
+ //! Returns modification mode of incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
+ int incrementalSpeedMode() const;
+
+ //! Set the incremental speed for view operation (see #SVTK_InteractorStyle::ControllerIncrement)
+ void setIncrementalSpeed( const int, const int = 0 );
+
+ //! Gets spacemouse button for specified function
+ int spacemouseBtn( const int ) const;
+
+ //! Sets spacemouse buttons
+ void setSpacemouseButtons( const int, const int, const int );
+
public:
void enableSelection(bool isEnabled);
bool isSelectionEnabled() const { return mySelectionEnabled; }
bool myTrihedronRelative;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
+ int myIncrementSpeed;
+ int myIncrementMode;
+ int myProjMode;
+ int myStyle;
+ int mySpaceBtn[3];
CAM_Module* myActiveModule;
int myExtToolBarId;
/*!
Constructor
*/
-SVTK_ViewWindow
-::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
+SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
SUIT_ViewWindow(theDesktop),
myMainWindow(0),
myView(NULL),
/*!
To initialize #SVTK_ViewWindow instance
*/
-void
-SVTK_ViewWindow
-::Initialize(SVTK_ViewModelBase* theModel)
+void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
{
if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){
myMainWindow = new SVTK_MainWindow(this,"SVTK_MainWindow",aResourceMgr,this);
/*!
To initialize #SVTK_ViewWindow instance
*/
-void
-SVTK_ViewWindow
-::Initialize(SVTK_View* theView,
- SVTK_ViewModelBase* theModel)
+void SVTK_ViewWindow::Initialize(SVTK_View* theView,
+ SVTK_ViewModelBase* theModel)
{
connect(theView,SIGNAL(KeyPressed(QKeyEvent*)),
this,SLOT(onKeyPressed(QKeyEvent*)) );
/*!
Destructor
*/
-SVTK_ViewWindow
-::~SVTK_ViewWindow()
+SVTK_ViewWindow::~SVTK_ViewWindow()
{}
/*!
\return corresponding view
*/
-SVTK_View*
-SVTK_ViewWindow
-::getView()
+SVTK_View* SVTK_ViewWindow::getView()
{
return myView;
}
/*!
\return corresponding vtk main window
*/
-SVTK_MainWindow*
-SVTK_ViewWindow
-::getMainWindow()
+SVTK_MainWindow* SVTK_ViewWindow::getMainWindow()
{
return myMainWindow;
}
/*!
\return corresponding vtk render window
*/
-vtkRenderWindow*
-SVTK_ViewWindow
-::getRenderWindow()
+vtkRenderWindow* SVTK_ViewWindow::getRenderWindow()
{
return getMainWindow()->getRenderWindow();
}
/*!
\return corresponding vtk render window interactor
*/
-vtkRenderWindowInteractor*
-SVTK_ViewWindow
-::getInteractor()
+vtkRenderWindowInteractor* SVTK_ViewWindow::getInteractor()
{
return getMainWindow()->getInteractor();
}
/*!
\return corresponding vtk renderer
*/
-vtkRenderer*
-SVTK_ViewWindow
-::getRenderer()
+vtkRenderer* SVTK_ViewWindow::getRenderer()
{
return myMainWindow->getRenderer();
}
/*!
\return corresponding vtk selector
*/
-SVTK_Selector*
-SVTK_ViewWindow
-::GetSelector()
+SVTK_Selector* SVTK_ViewWindow::GetSelector()
{
return myMainWindow->GetSelector();
}
/*!
Processes transformation "front view"
*/
-void
-SVTK_ViewWindow
-::onFrontView()
+void SVTK_ViewWindow::onFrontView()
{
myMainWindow->onFrontView();
}
/*!
Processes transformation "back view"
*/
-void
-SVTK_ViewWindow
-::onBackView()
+void SVTK_ViewWindow::onBackView()
{
myMainWindow->onBackView();
}
/*!
Processes transformation "top view"
*/
-void
-SVTK_ViewWindow
-::onTopView()
+void SVTK_ViewWindow::onTopView()
{
myMainWindow->onTopView();
}
/*!
Processes transformation "bottom view"
*/
-void
-SVTK_ViewWindow
-::onBottomView()
+void SVTK_ViewWindow::onBottomView()
{
myMainWindow->onBottomView();
}
/*!
Processes transformation "left view"
*/
-void
-SVTK_ViewWindow
-::onLeftView()
+void SVTK_ViewWindow::onLeftView()
{
myMainWindow->onLeftView();
}
/*!
Processes transformation "right view"
*/
-void
-SVTK_ViewWindow
-::onRightView()
+void SVTK_ViewWindow::onRightView()
{
myMainWindow->onRightView();
}
/*!
Processes transformation "reset view": sets default orientation of viewport camera
*/
-void
-SVTK_ViewWindow
-::onResetView()
+void SVTK_ViewWindow::onResetView()
{
myMainWindow->onResetView();
}
/*!
Processes transformation "fit all"
*/
-void
-SVTK_ViewWindow
-::onFitAll()
+void SVTK_ViewWindow::onFitAll()
{
myMainWindow->onFitAll();
}
/*!
SLOT: called if selection is changed
*/
-void
-SVTK_ViewWindow
-::onSelectionChanged()
+void SVTK_ViewWindow::onSelectionChanged()
{
myView->onSelectionChanged();
}
Change selection mode
\param theMode - new selection mode
*/
-void
-SVTK_ViewWindow
-::SetSelectionMode(Selection_Mode theMode)
+void SVTK_ViewWindow::SetSelectionMode(Selection_Mode theMode)
{
myMainWindow->SetSelectionMode( theMode );
}
/*!
\return selection mode
*/
-Selection_Mode
-SVTK_ViewWindow
-::SelectionMode() const
+Selection_Mode SVTK_ViewWindow::SelectionMode() const
{
return myMainWindow->SelectionMode();
}
/*!
Unhilights all objects in viewer
*/
-void
-SVTK_ViewWindow
-::unHighlightAll()
+void SVTK_ViewWindow::unHighlightAll()
{
myView->unHighlightAll();
}
\param theIsHighlight - if it is true, object will be hilighted, otherwise it will be unhilighted
\param theIsUpdate - update current viewer
*/
-void
-SVTK_ViewWindow
-::highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
+void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO,
+ bool theIsHighlight,
+ bool theIsUpdate )
{
myView->highlight( theIO, theIsHighlight, theIsUpdate );
}
\return true if object is in viewer or in collector
\param theIO - object to be checked
*/
-bool
-SVTK_ViewWindow
-::isInViewer( const Handle(SALOME_InteractiveObject)& theIO )
+bool SVTK_ViewWindow::isInViewer( const Handle(SALOME_InteractiveObject)& theIO )
{
return myView->isInViewer( theIO );
}
\return true if object is displayed in viewer
\param theIO - object to be checked
*/
-bool
-SVTK_ViewWindow
-::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
+bool SVTK_ViewWindow::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
{
return myView->isVisible( theIO );
}
Display object
\param theEntry - entry that corresponds to intractive objects
*/
-Handle(SALOME_InteractiveObject)
-SVTK_ViewWindow
-::FindIObject(const char* theEntry)
+Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEntry)
{
return myView->FindIObject(theEntry);
}
\param theIO - object
\param theImmediatly - update viewer
*/
-void
-SVTK_ViewWindow
-::Display(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
+ bool theImmediatly)
{
myView->Display(theIO,theImmediatly);
}
\param theIO - object
\param theImmediatly - update viewer
*/
-void
-SVTK_ViewWindow
-::Erase(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
+ bool theImmediatly)
{
myView->Erase(theIO,theImmediatly);
}
Display only passed object
\param theIO - object
*/
-void
-SVTK_ViewWindow
-::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO)
+void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO)
{
myView->DisplayOnly(theIO);
}
/*!
Display all objects in view
*/
-void
-SVTK_ViewWindow
-::DisplayAll()
+void SVTK_ViewWindow::DisplayAll()
{
myView->DisplayAll();
}
/*!
Erase all objects in view
*/
-void
-SVTK_ViewWindow
-::EraseAll()
+void SVTK_ViewWindow::EraseAll()
{
myView->EraseAll();
}
Sets background color
\param color - new background color
*/
-void
-SVTK_ViewWindow
-::setBackgroundColor( const QColor& color )
+void SVTK_ViewWindow::setBackgroundColor( const QColor& color )
{
myMainWindow->SetBackgroundColor( color );
}
/*!
\return background color of viewer
*/
-QColor
-SVTK_ViewWindow
-::backgroundColor() const
+QColor SVTK_ViewWindow::backgroundColor() const
{
return myMainWindow->BackgroundColor();
}
/*!
Updates current viewer
*/
-void
-SVTK_ViewWindow
-::Repaint(bool theUpdateTrihedron)
+void SVTK_ViewWindow::Repaint(bool theUpdateTrihedron)
{
myMainWindow->Repaint( theUpdateTrihedron );
}
/*!
Redirect the request to #SVTK_Renderer::GetScale
*/
-void
-SVTK_ViewWindow
-::GetScale( double theScale[3] )
+void SVTK_ViewWindow::GetScale( double theScale[3] )
{
myMainWindow->GetScale( theScale );
}
/*!
Redirect the request to #SVTK_Renderer::SetScale
*/
-void
-SVTK_ViewWindow
-::SetScale( double theScale[3] )
+void SVTK_ViewWindow::SetScale( double theScale[3] )
{
myMainWindow->SetScale( theScale );
}
/*!
Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
*/
-bool
-SVTK_ViewWindow
-::isTrihedronDisplayed()
+bool SVTK_ViewWindow::isTrihedronDisplayed()
{
return myMainWindow->IsTrihedronDisplayed();
}
/*!
Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
*/
-bool
-SVTK_ViewWindow
-::isCubeAxesDisplayed()
+bool SVTK_ViewWindow::isCubeAxesDisplayed()
{
return myMainWindow->IsCubeAxesDisplayed();
}
/*!
Redirect the request to #SVTK_Renderer::OnViewTrihedron
*/
-void
-SVTK_ViewWindow
-::onViewTrihedron()
+void SVTK_ViewWindow::onViewTrihedron()
{
myMainWindow->onViewTrihedron();
}
/*!
Redirect the request to #SVTK_Renderer::OnViewCubeAxes
*/
-void
-SVTK_ViewWindow
-::onViewCubeAxes()
+void SVTK_ViewWindow::onViewCubeAxes()
{
myMainWindow->onViewCubeAxes();
}
/*!
Redirect the request to #SVTK_Renderer::GetTrihedron
*/
-VTKViewer_Trihedron*
-SVTK_ViewWindow::
-GetTrihedron()
+VTKViewer_Trihedron* SVTK_ViewWindow::GetTrihedron()
{
return myMainWindow->GetTrihedron();
}
/*!
Redirect the request to #SVTK_Renderer::GetCubeAxes
*/
-SVTK_CubeAxesActor2D*
-SVTK_ViewWindow
-::GetCubeAxes()
+SVTK_CubeAxesActor2D* SVTK_ViewWindow::GetCubeAxes()
{
return myMainWindow->GetCubeAxes();
}
/*!
\return trihedron size
*/
-vtkFloatingPointType
-SVTK_ViewWindow
-::GetTrihedronSize() const
+vtkFloatingPointType SVTK_ViewWindow::GetTrihedronSize() const
{
return myMainWindow->GetTrihedronSize();
}
+/*!
+ Sets projection mode
+ \param theMode - projection mode ( 0 - orthogonal, 1 - perspective )
+*/
+void SVTK_ViewWindow::SetProjectionMode(const int theMode)
+{\r
+ myMainWindow->activateProjectionMode( theMode );
+}
+\r
+/*!\r
+ Sets actual interaction style\r
+ \param theStyle - type of interaction style ( 0 - standard, 1 - keyboard free )\r
+*/\r
+void SVTK_ViewWindow::SetInteractionStyle(const int theStyle)\r
+{\r
+ myMainWindow->onSwitchInteractionStyle( theStyle==1 );\r
+}\r
+\r
+/*!\r
+ Sets incremental speed\r
+ \param theValue - new incremental speed\r
+ \param theMode - modification mode\r
+*/\r
+void SVTK_ViewWindow::SetIncrementalSpeed(const int theValue, const int theMode)\r
+{\r
+ myMainWindow->SetIncrementalSpeed(theValue, theMode);\r
+}\r
+\r
+/*!\r
+ Sets spacemouse buttons for the functions\r
+ \param theBtn1 - spacemouse button for the "decrease speed increment"\r
+ \param theBtn2 - spacemouse button for the "increase speed increment"\r
+ \param theBtn3 - spacemouse button for the "dominant combined switch"\r
+*/\r
+void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1, \r
+ const int theBtn2,\r
+ const int theBtn3)\r
+{\r
+ myMainWindow->SetSMButtons(theBtn1, theBtn2, theBtn3);\r
+}\r
+
/*!
Sets trihedron size
\param theSize - new trihedron size
\param theRelative - trihedron relativeness
*/
-void
-SVTK_ViewWindow
-::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
+void SVTK_ViewWindow::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
{
myMainWindow->SetTrihedronSize(theSize, theRelative);
}
/*! If parameter theIsForcedUpdate is true, recalculate parameters for
* trihedron and cube axes, even if trihedron and cube axes is invisible.
*/
-void
-SVTK_ViewWindow
-::AdjustTrihedrons(const bool theIsForcedUpdate)
+void SVTK_ViewWindow::AdjustTrihedrons(const bool theIsForcedUpdate)
{
myMainWindow->AdjustActors();
}
/*!
Redirect the request to #SVTK_Renderer::OnAdjustTrihedron
*/
-void
-SVTK_ViewWindow
-::onAdjustTrihedron()
+void SVTK_ViewWindow::onAdjustTrihedron()
{
myMainWindow->onAdjustTrihedron();
}
/*!
Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
*/
-void
-SVTK_ViewWindow
-::onAdjustCubeAxes()
+void SVTK_ViewWindow::onAdjustCubeAxes()
{
myMainWindow->onAdjustCubeAxes();
}
/*!
Emits key pressed
*/
-void
-SVTK_ViewWindow
-::onKeyPressed(QKeyEvent* event)
+void SVTK_ViewWindow::onKeyPressed(QKeyEvent* event)
{
emit keyPressed( this, event );
}
/*!
Emits key released
*/
-void
-SVTK_ViewWindow
-::onKeyReleased(QKeyEvent* event)
+void SVTK_ViewWindow::onKeyReleased(QKeyEvent* event)
{
emit keyReleased( this, event );
}
/*!
Emits mouse pressed
*/
-void
-SVTK_ViewWindow
-::onMousePressed(QMouseEvent* event)
+void SVTK_ViewWindow::onMousePressed(QMouseEvent* event)
{
emit mousePressed(this, event);
}
/*!
Emits mouse released
*/
-void
-SVTK_ViewWindow
-::onMouseReleased(QMouseEvent* event)
+void SVTK_ViewWindow::onMouseReleased(QMouseEvent* event)
{
emit mouseReleased( this, event );
}
/*!
Emits mouse moving
*/
-void
-SVTK_ViewWindow
-::onMouseMoving(QMouseEvent* event)
+void SVTK_ViewWindow::onMouseMoving(QMouseEvent* event)
{
emit mouseMoving( this, event );
}
/*!
Emits mouse double clicked
*/
-void
-SVTK_ViewWindow
-::onMouseDoubleClicked( QMouseEvent* event )
+void SVTK_ViewWindow::onMouseDoubleClicked( QMouseEvent* event )
{
emit mouseDoubleClicked( this, event );
}
Redirect the request to #SVTK_Renderer::AddActor
*/
void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
- bool theUpdate )
+ bool theUpdate )
{
myMainWindow->AddActor( theActor, theUpdate );
emit actorAdded(theActor);
/*!
Redirect the request to #SVTK_Renderer::RemoveActor
*/
-void
-SVTK_ViewWindow
-::RemoveActor( VTKViewer_Actor* theActor,
- bool theUpdate )
+void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor,
+ bool theUpdate )
{
myMainWindow->RemoveActor( theActor, theUpdate );
emit actorRemoved(theActor);
/*!
\return QImage, containing all scene rendering in window
*/
-QImage
-SVTK_ViewWindow
-::dumpView()
+QImage SVTK_ViewWindow::dumpView()
{
if ( myMainWindow->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
return myMainWindow->dumpView();
/*!
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
-void
-SVTK_ViewWindow
-::SetSelectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+void SVTK_ViewWindow::SetSelectionProp(const double& theRed,
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
}
/*!
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
-void
-SVTK_ViewWindow
-::SetPreselectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+void SVTK_ViewWindow::SetPreselectionProp(const double& theRed,
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
}
/*!
Redirect the request to #SVTK_Renderer::SetSelectionTolerance
*/
-void
-SVTK_ViewWindow
-::SetSelectionTolerance(const double& theTolNodes,
- const double& theTolItems,
- const double& theTolObjects)
+void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
+ const double& theTolItems,
+ const double& theTolObjects)
{
myView->SetSelectionTolerance(theTolNodes, theTolItems, theTolObjects);
}
Performs action
\param accelAction - action
*/
-bool
-SVTK_ViewWindow
-::action( const int accelAction )
+bool SVTK_ViewWindow::action( const int accelAction )
{
if ( !myMainWindow->hasFocus() )
return false;
/*! The method returns the visual parameters of this view as a formated string
*/
-QString
-SVTK_ViewWindow
-::getVisualParameters()
+QString SVTK_ViewWindow::getVisualParameters()
{
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
/*!
The method restores visual parameters of this view or postpones it untill the view is shown
-*/
-void
-SVTK_ViewWindow
-::setVisualParameters( const QString& parameters )
+*/
+void SVTK_ViewWindow::setVisualParameters( const QString& parameters )
{
SVTK_RenderWindowInteractor* anInteractor = getMainWindow()->GetInteractor();
if ( anInteractor->isVisible() ) {
/*!
The method restores visual parameters of this view from a formated string
*/
-void
-SVTK_ViewWindow
-::doSetVisualParameters( const QString& parameters )
+void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
{
QStringList paramsLst = parameters.split( '*' );
if ( paramsLst.size() >= nNormalParams ) {
//! To construct #SVTK_ViewWindow instance
SVTK_ViewWindow(SUIT_Desktop* theDesktop);
- virtual
- ~SVTK_ViewWindow();
+ virtual ~SVTK_ViewWindow();
virtual QImage dumpView();
//! To initialize #SVTK_ViewWindow instance
- virtual
- void
- Initialize(SVTK_ViewModelBase* theModel);
+ virtual void Initialize(SVTK_ViewModelBase* theModel);
//! Get #SVTK_View
- SVTK_View*
- getView();
+ SVTK_View* getView();
//! Get #SVTK_MainWindow
- SVTK_MainWindow*
- getMainWindow();
+ SVTK_MainWindow* getMainWindow();
//! Redirect the request to #SVTK_MainWindow::getRenderWindow
- vtkRenderWindow*
- getRenderWindow();
+ vtkRenderWindow* getRenderWindow();
//! Redirect the request to #SVTK_MainWindow::getInteractor
- vtkRenderWindowInteractor*
- getInteractor();
+ vtkRenderWindowInteractor* getInteractor();
//! Redirect the request to #SVTK_MainWindow::getRenderer
- vtkRenderer*
- getRenderer();
+ vtkRenderer* getRenderer();
//! Redirect the request to #SVTK_MainWindow::GetSelector
- SVTK_Selector*
- GetSelector();
+ SVTK_Selector* GetSelector();
//! Redirect the request to #SVTK_Selector::SelectionMode
- Selection_Mode
- SelectionMode() const;
+ Selection_Mode SelectionMode() const;
//! Change selection mode
- virtual
- void
- SetSelectionMode(Selection_Mode theMode);
+ virtual void SetSelectionMode(Selection_Mode theMode);
//! Redirect the request to #SVTK_MainWindow::SetBackgroundColor
- virtual
- void
- setBackgroundColor( const QColor& );
+ virtual void setBackgroundColor( const QColor& );
//! Redirect the request to #SVTK_MainWindow::SetBackgroundColor
- QColor
- backgroundColor() const;
+ QColor backgroundColor() const;
//! Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
- bool
- isTrihedronDisplayed();
+ bool isTrihedronDisplayed();
//! Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
- bool
- isCubeAxesDisplayed();
+ bool isCubeAxesDisplayed();
/* interactive object management */
//! Redirect the request to #SVTK_View::highlight (to support old code)
- virtual
- void
- highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight = true,
- bool theIsUpdate = true);
+ virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO,
+ bool theIsHighlight = true,
+ bool theIsUpdate = true);
//! Redirect the request to #SVTK_View::unHighlightAll (to support old code)
- virtual
- void
- unHighlightAll();
+ virtual void unHighlightAll();
//! Redirect the request to #SVTK_View::isInViewer (to support old code)
- bool
- isInViewer(const Handle(SALOME_InteractiveObject)& theIObject);
+ bool isInViewer(const Handle(SALOME_InteractiveObject)& theIObject);
//! Redirect the request to #SVTK_View::isVisible (to support old code)
- bool
- isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
+ bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
//! Redirect the request to #SVTK_View::FindIObject (to support old code)
//----------------------------------------------------------------------------
- Handle(SALOME_InteractiveObject)
- FindIObject(const char* theEntry);
+ Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry);
/* display */
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_View::Display (to support old code)
- virtual
- void
- Display(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theImmediatly = true);
+ virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
+ bool theImmediatly = true);
//! Redirect the request to #SVTK_View::DisplayOnly (to support old code)
- virtual
- void
- DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
+ virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
//! Redirect the request to #SVTK_View::Erase (to support old code)
- virtual
- void
- Erase(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theImmediatly = true);
+ virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
+ bool theImmediatly = true);
//! Redirect the request to #SVTK_View::DisplayAll (to support old code)
- virtual
- void
- DisplayAll();
+ virtual void DisplayAll();
//! Redirect the request to #SVTK_View::EraseAll (to support old code)
- virtual
- void
- EraseAll();
+ virtual void EraseAll();
//! To repaint the viewer
- virtual
- void
- Repaint(bool theUpdateTrihedron = true);
+ virtual void Repaint(bool theUpdateTrihedron = true);
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_Renderer::SetScale
- virtual
- void
- SetScale( double theScale[3] );
+ virtual void SetScale( double theScale[3] );
//! Redirect the request to #SVTK_Renderer::GetScale
- virtual
- void
- GetScale( double theScale[3] );
+ virtual void GetScale( double theScale[3] );
//! Redirect the request to #SVTK_Renderer::AddActor
- virtual
- void
- AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ virtual void AddActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate = false);
//! Redirect the request to #SVTK_Renderer::RemoveActor
- virtual
- void
- RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ virtual void RemoveActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate = false);
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_Renderer::AdjustActors
- virtual
- void
- AdjustTrihedrons(const bool theIsForced);
+ virtual void AdjustTrihedrons(const bool theIsForced);
//! Redirect the request to #SVTK_Renderer::GetTrihedron
- VTKViewer_Trihedron*
- GetTrihedron();
+ VTKViewer_Trihedron* GetTrihedron();
//! Redirect the request to #SVTK_Renderer::GetCubeAxes
- SVTK_CubeAxesActor2D*
- GetCubeAxes();
+ SVTK_CubeAxesActor2D* GetCubeAxes();
//! Redirect the request to #SVTK_Renderer::GetTrihedronSize
- vtkFloatingPointType
- GetTrihedronSize() const;
+ vtkFloatingPointType GetTrihedronSize() const;
//! Redirect the request to #SVTK_Renderer::SetTrihedronSize
- virtual
- void
- SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+ virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+
+ //! Redirect the request to #SVTK_MainWindow::SetIncrementalSpeed
+ virtual void SetIncrementalSpeed( const int, const int = 0 );
+
+ //! Redirect the request to #SVTK_MainWindow::SetProjectionMode
+ virtual void SetProjectionMode( const int );
+
+ //! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
+ virtual void SetInteractionStyle( const int );
+
+ //! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
+ virtual void SetSpacemouseButtons( const int, const int, const int );
//! Redirect the request to #SVTK_Renderer::SetSelectionProp
- virtual
- void
- SetSelectionProp(const double& theRed = 1,
- const double& theGreen = 1,
- const double& theBlue = 0,
- const int& theWidth = 5);
+ virtual void SetSelectionProp(const double& theRed = 1,
+ const double& theGreen = 1,
+ const double& theBlue = 0,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
- virtual
- void
- SetPreselectionProp(const double& theRed = 0,
- const double& theGreen = 1,
- const double& theBlue = 1,
- const int& theWidth = 5);
+ virtual void SetPreselectionProp(const double& theRed = 0,
+ const double& theGreen = 1,
+ const double& theBlue = 1,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetSelectionTolerance
- virtual
- void
- SetSelectionTolerance(const double& theTolNodes = 0.025,
- const double& theTolCell = 0.001,
- const double& theTolObjects = 0.025);
+ virtual void SetSelectionTolerance(const double& theTolNodes = 0.025,
+ const double& theTolCell = 0.001,
+ const double& theTolObjects = 0.025);
//! Methods to save/restore visual parameters of a view (pan, zoom, etc.)
- virtual
- QString
- getVisualParameters();
+ virtual QString getVisualParameters();
- virtual
- void
- setVisualParameters( const QString& parameters );
+ virtual void setVisualParameters( const QString& parameters );
- virtual
- bool
- eventFilter( QObject*, QEvent* );
+ virtual bool eventFilter( QObject*, QEvent* );
- virtual
- void RefreshDumpImage();
+ virtual void RefreshDumpImage();
public slots:
- virtual
- void
- onSelectionChanged();
+ virtual void onSelectionChanged();
signals:
void selectionChanged();
public slots:
//! Redirect the request to #SVTK_Renderer::OnFrontView
- virtual
- void
- onFrontView();
+ virtual void onFrontView();
//! Redirect the request to #SVTK_Renderer::OnBackView
- virtual
- void
- onBackView();
+ virtual void onBackView();
//! Redirect the request to #SVTK_Renderer::OnTopView
- virtual
- void
- onTopView();
+ virtual void onTopView();
//! Redirect the request to #SVTK_Renderer::OnBottomView
- virtual
- void
- onBottomView();
+ virtual void onBottomView();
//! Redirect the request to #SVTK_Renderer::OnRightView
- virtual
- void
- onRightView();
+ virtual void onRightView();
//! Redirect the request to #SVTK_Renderer::OnLeftView
- virtual
- void
- onLeftView();
+ virtual void onLeftView();
//! Redirect the request to #SVTK_Renderer::OnResetView
- virtual
- void
- onResetView();
+ virtual void onResetView();
//! Redirect the request to #SVTK_Renderer::OnFitAll
- virtual
- void
- onFitAll();
+ virtual void onFitAll();
//! Redirect the request to #SVTK_Renderer::OnViewTrihedron
- virtual
- void
- onViewTrihedron();
+ virtual void onViewTrihedron();
//! Redirect the request to #SVTK_Renderer::OnViewCubeAxes
- virtual
- void
- onViewCubeAxes();
+ virtual void onViewCubeAxes();
//! Redirect the request to #SVTK_Renderer::OnAdjustTrihedron
- virtual
- void
- onAdjustTrihedron();
+ virtual void onAdjustTrihedron();
//! Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
- virtual
- void
- onAdjustCubeAxes();
+ virtual void onAdjustCubeAxes();
protected slots:
void onKeyPressed(QKeyEvent* event);
void onMouseMoving(QMouseEvent* event);
protected:
- virtual
- void
- Initialize(SVTK_View* theView,
- SVTK_ViewModelBase* theModel);
+ virtual void Initialize(SVTK_View* theView,
+ SVTK_ViewModelBase* theModel);
- void
- doSetVisualParameters( const QString& );
+ void doSetVisualParameters( const QString& );
virtual QString filter() const;
virtual bool dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format );