From: mzn Date: Fri, 8 Sep 2006 11:05:11 +0000 (+0000) Subject: Fix for external bug PAL13398(EDF PAL 139 : trihedron_size < 1). X-Git-Tag: For_GUI_AutoTools~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77fa65d1d8f1464a6508a954e79c49d627cc16b6;p=modules%2Fgui.git Fix for external bug PAL13398(EDF PAL 139 : trihedron_size < 1). --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 0c3d7c81c..1e53b1621 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1340,7 +1340,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType vm = new OCCViewer_Viewer(); #endif vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) ); - vm->setTrihedronSize( resMgr->integerValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) ); + vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) ); int u( 1 ), v( 1 ); vm->isos( u, v ); u = resMgr->integerValue( "OCCViewer", "iso_number_u", u ); @@ -1363,7 +1363,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType if( vm ) { vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); - vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ), + vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ), resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) ); new LightApp_VTKSelector( vm, mySelMgr ); } @@ -1780,11 +1780,11 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( plot2dGroup, "columns", 1 ); int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup, - LightApp_Preferences::IntSpin, "OCCViewer", "trihedron_size" ); + LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup, LightApp_Preferences::Color, "OCCViewer", "background" ); - pref->setItemProperty( occTS, "min", 1 ); + pref->setItemProperty( occTS, "min", 1.0E-06 ); pref->setItemProperty( occTS, "max", 1000 ); int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup, @@ -1799,12 +1799,12 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( isoV, "max", 100000 ); int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGroup, - LightApp_Preferences::IntSpin, "VTKViewer", "trihedron_size" ); + LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" ); pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGroup, LightApp_Preferences::Color, "VTKViewer", "background" ); - pref->setItemProperty( vtkTS, "min", 1 ); + pref->setItemProperty( vtkTS, "min", 1.0E-06 ); pref->setItemProperty( vtkTS, "max", 150 ); pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup, @@ -1906,7 +1906,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString #ifndef DISABLE_OCCVIEWER if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) ) { - int sz = resMgr->integerValue( sec, param, -1 ); + double sz = resMgr->doubleValue( sec, param, -1 ); QPtrList lst; viewManagers( OCCViewer_Viewer::Type(), lst ); for ( QPtrListIterator it( lst ); it.current() && sz >= 0; ++it ) @@ -1925,7 +1925,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString #ifndef DISABLE_VTKVIEWER if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) ) { - int sz = resMgr->integerValue( "VTKViewer", "trihedron_size", -1 ); + double sz = resMgr->doubleValue( "VTKViewer", "trihedron_size", -1 ); bool isRelative = resMgr->booleanValue( "VTKViewer", "relative_size", true ); QPtrList lst; #ifndef DISABLE_SALOMEOBJECT diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index c4917d7b0..61d8ea446 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -572,11 +572,11 @@ void OCCViewer_Viewer::setTrihedronShown( const bool on ) /*! \return trihedron size */ -int OCCViewer_Viewer::trihedronSize() const +double OCCViewer_Viewer::trihedronSize() const { - int sz = 0; + double sz = 0; if ( !myTrihedron.IsNull() ) - sz = (int)myTrihedron->Size(); + sz = myTrihedron->Size(); return sz; } @@ -584,7 +584,7 @@ int OCCViewer_Viewer::trihedronSize() const Changes trihedron size \param sz - new size */ -void OCCViewer_Viewer::setTrihedronSize( const int sz ) +void OCCViewer_Viewer::setTrihedronSize( const double sz ) { if ( !myTrihedron.IsNull() ) myTrihedron->SetSize( sz ); diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index ebdc47049..56ffbbfa4 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -102,8 +102,8 @@ public: bool isTrihedronVisible() const; virtual void setTrihedronShown( const bool ); - int trihedronSize() const; - virtual void setTrihedronSize( const int ); + double trihedronSize() const; + virtual void setTrihedronSize( const double ); public slots: void onClearViewAspects(); diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index 2cb5d4379..8493b1721 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -312,7 +312,7 @@ SVTK_MainWindow /*! Redirect the request to SVTK_Renderer::GetTrihedronSize */ -int +vtkFloatingPointType SVTK_MainWindow ::GetTrihedronSize() { @@ -324,7 +324,7 @@ SVTK_MainWindow */ void SVTK_MainWindow -::SetTrihedronSize( const int theSize, const bool theRelative ) +::SetTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative ) { GetRenderer()->SetTrihedronSize(theSize, theRelative); Repaint(); diff --git a/src/SVTK/SVTK_MainWindow.h b/src/SVTK/SVTK_MainWindow.h index 3d9637a40..6533ff8cb 100644 --- a/src/SVTK/SVTK_MainWindow.h +++ b/src/SVTK/SVTK_MainWindow.h @@ -163,12 +163,12 @@ public: bool theIsUpdate = false); //! Redirect the request to #SVTK_Renderer::GetTrihedronSize - int + vtkFloatingPointType GetTrihedronSize(); //! Redirect the request to #SVTK_Renderer::SetTrihedronSize void - SetTrihedronSize(const int theSize, const bool theRelative = true); + SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative = true); //! Redirect the request to #SVTK_Renderer::AdjustActors void diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 2ca7c7aef..d3020f1c1 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -466,7 +466,7 @@ SVTK_Renderer */ void SVTK_Renderer -::SetTrihedronSize(int theSize, const bool theRelative) +::SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative) { if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){ myTrihedronSize = theSize; @@ -478,7 +478,7 @@ SVTK_Renderer /*! \return size of the trihedron in percents from bounding box of the scene */ -int +vtkFloatingPointType SVTK_Renderer ::GetTrihedronSize() const { diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index c9908539d..6683cf384 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -128,10 +128,10 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //! Set size of the trihedron in percents from bounding box of the scene void - SetTrihedronSize(int theSize, const bool theRelative = true); + SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative = true); //! Get size of the trihedron in percents from bounding box of the scene - int + vtkFloatingPointType GetTrihedronSize() const; //! Shows if the size of the trihedron is relative @@ -243,7 +243,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //---------------------------------------------------------------------------- vtkSmartPointer myCubeAxes; vtkSmartPointer myTrihedron; - int myTrihedronSize; + vtkFloatingPointType myTrihedronSize; bool myIsTrihedronRelative; vtkFloatingPointType myBndBox[6]; }; diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 4a1722242..15afb69f3 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -127,7 +127,7 @@ createView( SUIT_Desktop* theDesktop ) /*! \return trihedron size */ -int SVTK_Viewer::trihedronSize() const +vtkFloatingPointType SVTK_Viewer::trihedronSize() const { return myTrihedronSize; } @@ -145,7 +145,7 @@ bool SVTK_Viewer::trihedronRelative() const \param theSize - new size \param theRelative - new relativeness */ -void SVTK_Viewer::setTrihedronSize( const int theSize, const bool theRelative ) +void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative ) { myTrihedronSize = theSize; myTrihedronRelative = theRelative; diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index 3c55105c1..ec61193b2 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -63,13 +63,13 @@ public: void setBackgroundColor( const QColor& ); //! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) - int trihedronSize() const; + vtkFloatingPointType trihedronSize() const; //! Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize) bool trihedronRelative() const; //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize) - void setTrihedronSize( const int, const bool = true ); + void setTrihedronSize( const vtkFloatingPointType, const bool = true ); public: void enableSelection(bool isEnabled); @@ -117,7 +117,7 @@ protected slots: private: QColor myBgColor; - int myTrihedronSize; + vtkFloatingPointType myTrihedronSize; bool myTrihedronRelative; bool mySelectionEnabled; bool myMultiSelectionEnabled; diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 2e3aa0a66..e0c21ddd7 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -549,7 +549,7 @@ SVTK_ViewWindow /*! \return trihedron size */ -int +vtkFloatingPointType SVTK_ViewWindow ::GetTrihedronSize() const { @@ -563,7 +563,7 @@ SVTK_ViewWindow */ void SVTK_ViewWindow -::SetTrihedronSize(const int theSize, const bool theRelative) +::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative) { myMainWindow->SetTrihedronSize(theSize, theRelative); } diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index cc56484de..3031624b8 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -215,13 +215,13 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow GetCubeAxes(); //! Redirect the request to #SVTK_Renderer::GetTrihedronSize - int + vtkFloatingPointType GetTrihedronSize() const; //! Redirect the request to #SVTK_Renderer::SetTrihedronSize virtual void - SetTrihedronSize( const int, const bool = true ); + SetTrihedronSize( const vtkFloatingPointType, const bool = true ); //! Redirect the request to #SVTK_Renderer::SetSelectionProp virtual