Salome HOME
0021031: EDF 1646 GEOM: Modify Location leads to Position driver failed
[modules/geom.git] / src / TransformationGUI / TransformationGUI_ScaleDlg.cxx
index 112c1c61b1d97787650c89cc6a38adc4f28c0b7d..17023381f3bebe2b3796e7119284742cc7515df6 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : TransformationGUI_ScaleDlg.cxx
 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
@@ -155,9 +156,9 @@ void TransformationGUI_ScaleDlg::Init()
   double aFactor = 2.0;
   double SpecificStep = 0.5;
 
-  initSpinBox(SpinBox_FX, COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
-  initSpinBox(SpinBox_FY, COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
-  initSpinBox(SpinBox_FZ, COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+  initSpinBox(SpinBox_FX, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
+  initSpinBox(SpinBox_FY, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
+  initSpinBox(SpinBox_FZ, COORD_MIN, COORD_MAX, SpecificStep, "parametric_precision" );
   SpinBox_FX->setValue(aFactor);
   SpinBox_FY->setValue(aFactor);
   SpinBox_FZ->setValue(aFactor);
@@ -182,8 +183,9 @@ void TransformationGUI_ScaleDlg::Init()
   connect(SpinBox_FX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(SpinBox_FY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(SpinBox_FZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
-
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
+  
+  // san : Commented so as not to override specific step settings
+  //connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
 
   connect(CheckBoxCopy, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
 
@@ -200,6 +202,9 @@ void TransformationGUI_ScaleDlg::ConstructorsClicked (int constructorId)
 {
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
 
+  myPoint = GEOM::GEOM_Object::_nil();
+  LineEdit2->clear();
+  
   switch (constructorId) {
   case 0: // translation an object by dx, dy, dz
     TextLabel3->setText(tr("GEOM_SCALE_FACTOR"));
@@ -256,6 +261,12 @@ bool TransformationGUI_ScaleDlg::ClickOnApply()
     return false;
 
   initName(tr("GEOM_SCALE"));
+
+  myObjects.length(0);
+  myEditCurrentArgument = LineEdit1;
+  myEditCurrentArgument->setText("");
+  myGeomGUI->getApp()->selectionMgr()->clearSelected();
+
   // activate selection and connect selection manager
   ConstructorsClicked(getConstructorId());
   return true;
@@ -317,7 +328,7 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
             //Find SubShape Object in Father
             GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
 
-            if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+            if (aFindedObject->_is_nil()) { // Object not found in study
               GEOM::GEOM_IShapesOperations_var aShapesOp =
                 getGeomEngine()->GetIShapesOperations(getStudyId());
               aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
@@ -567,7 +578,8 @@ void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStud
     // empty list of arguments means that all arguments should be restored
     getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
                                         /*theFindMethod=*/GEOM::FSM_Transformed,
-                                        /*theInheritFirstArg=*/true);
+                                        /*theInheritFirstArg=*/true,
+                                        mainFrame()->CheckBoxAddPrefix->isChecked());
   }
 }