]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Mantis issue 0020626: EDF 1200 GEOM: the discretisation of the circles in the OCC...
authorjfa <jfa@opencascade.com>
Fri, 29 Jan 2010 14:07:33 +0000 (14:07 +0000)
committerjfa <jfa@opencascade.com>
Fri, 29 Jan 2010 14:07:33 +0000 (14:07 +0000)
src/GEOMGUI/GeometryGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx

index 5dd76283cef1c68428d77277d5be1e0e9773d832..fd461f03b5d5d2d1aee49c5d43eb6714323fae98 100644 (file)
@@ -1601,8 +1601,9 @@ void GeometryGUI::createPreferences()
 
   // Set property for deflection value for spinboxes
   setPreferenceProperty( defl, "min", 1.0e-07 );
-  setPreferenceProperty( defl, "max", 10000.0 );
-  setPreferenceProperty( defl, "step", 0.0001 );
+  setPreferenceProperty( defl, "max", 1.0 );
+  setPreferenceProperty( defl, "step", 1.0e-04 );
+  setPreferenceProperty( defl, "precision", 10 );
 
   // Set property vertex marker type
   QList<QVariant> aMarkerTypeIndicesList;
index 4e4ce7c9e09ddecb403e145aebe362656ef5fd2d..34b1f08357bc383629fbdd13c5396ba9df2e408f 100644 (file)
@@ -557,13 +557,23 @@ void GEOMToolsGUI::OnDeflection()
       GEOMToolsGUI_DeflectionDlg * DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
         (SUIT_Session::session()->activeApplication()->desktop());
       DeflectionDlg->setDC(aDC);
-      if (DeflectionDlg->exec()) {
-        SUIT_OverrideCursor();
-        double aNewDC = DeflectionDlg->getDC();
-        for (; ic->MoreCurrent(); ic->NextCurrent()) {
-          CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
-          ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
-          ic->Redisplay(CurObject);
+      double aNewDC = 0.0;
+      bool ok = false;
+      while (!ok) {
+        if (DeflectionDlg->exec()) {
+          SUIT_OverrideCursor();
+          aNewDC = DeflectionDlg->getDC();
+          ok = (1e-07 <= aNewDC && aNewDC <= 1.0); // spinbox can return zero
+          if (ok) {
+            for (; ic->MoreCurrent(); ic->NextCurrent()) {
+              CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
+              ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
+              ic->Redisplay(CurObject);
+            }
+          }
+        }
+        else {
+          ok = true;
         }
       }
     }
index 8f4137a4de468c88774ca6bdfe89bdfd5db1878c..8f240d26b3c2959947b46b911298c63bf95d94c7 100644 (file)
@@ -71,11 +71,18 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
   TextLabel1->setText(tr("GEOM_DEFLECTION"));
   GroupC1Layout->addWidget(TextLabel1, 0, 0);
 
+  //SpinBox = new SalomeApp_DoubleSpinBox (/*min*/1.0e-07, /*max*/1.0, /*step*/1.0e-04, GroupC1);
   SpinBox = new SalomeApp_DoubleSpinBox (GroupC1);
+  SpinBox->setPrecision( 10 );
+  SpinBox->setDecimals( 10 );
+  SpinBox->setRange( 1.0e-07, 1.0 );
+  SpinBox->setSingleStep( 1.0e-04 );
+  //SpinBox->setMinimum(1.0e-07);
+  //SpinBox->setMaximum(1.0);
+  //SpinBox->setStep(1.0e-04);
   SpinBox->setObjectName("SpinBoxU");
   SpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  SpinBox->setMinimum(0);
-  SpinBox->setValue(1);
+  SpinBox->setValue(1.0e-04);
   GroupC1Layout->addWidget(SpinBox, 0, 1);
 
   /***************************************************************/