]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for external bug PAL13398(EDF PAL 139 : trihedron_size < 1).
authormzn <mzn@opencascade.com>
Fri, 8 Sep 2006 11:05:11 +0000 (11:05 +0000)
committermzn <mzn@opencascade.com>
Fri, 8 Sep 2006 11:05:11 +0000 (11:05 +0000)
src/LightApp/LightApp_Application.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/SVTK/SVTK_MainWindow.cxx
src/SVTK/SVTK_MainWindow.h
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 0c3d7c81c4f8a5e060e4d0d83a1b7ffe0a31ce38..1e53b1621e8b8dc39c2e95172edeb54ea693cfbd 100644 (file)
@@ -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<SUIT_ViewManager> lst;
     viewManagers( OCCViewer_Viewer::Type(), lst );
     for ( QPtrListIterator<SUIT_ViewManager> 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<SUIT_ViewManager> lst;
 #ifndef DISABLE_SALOMEOBJECT
index c4917d7b06f6e07633b725107488a35e865e19de..61d8ea446d5eff8e483413f4de80956c2cf94bca 100755 (executable)
@@ -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 );
index ebdc4704901c3c1d583ffc47810e539dd2f9a3d0..56ffbbfa43d3b1d7bcd99c0956cd150b4463b8cc 100755 (executable)
@@ -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();
index 2cb5d437959cd2b1c25187277716ea02ef34cce7..8493b172163d26ce49d3e78c4a91da75000334a4 100644 (file)
@@ -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();
index 3d9637a40482fdfac5be52804861bb7a4e9660ae..6533ff8cbd95862c525313c9430168814291ff33 100644 (file)
@@ -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 
index 2ca7c7aef08f4490c82a24c420ca1d2f2827aab2..d3020f1c1a03657e55164e121ef585ca51c91b3b 100644 (file)
@@ -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
 {
index c9908539d1c050855e967d791200374151b40482..6683cf384181aeb0ea618394609b279b31f5846d 100644 (file)
@@ -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<SVTK_CubeAxesActor2D> myCubeAxes;
   vtkSmartPointer<VTKViewer_Trihedron> myTrihedron;  
-  int  myTrihedronSize;
+  vtkFloatingPointType myTrihedronSize;
   bool myIsTrihedronRelative;
   vtkFloatingPointType myBndBox[6];
 };
index 4a1722242d896668339a078bb4c0898bf29955bf..15afb69f34526264fd0a46105abcfa89f51a722e 100644 (file)
@@ -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;
index 3c55105c11344537a2c229b36a2404a5f8ed3ebd..ec61193b2363b83e00397c71d77515ffb24a7f6f 100644 (file)
@@ -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;
index 2e3aa0a66b3f05783d644825cb591510a1555de1..e0c21ddd7ef9c86357b40902d5791f0c9d9fc6df 100755 (executable)
@@ -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);
 }
index cc56484de15473c8e7ce8fd3d008b0422ffaa22d..3031624b8077f14b747c1aa78afb1ee09e87654b 100755 (executable)
@@ -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