Salome HOME
Preparation of intermediate revision
[modules/geom.git] / src / BlocksGUI / BlocksGUI_TrsfDlg.cxx
index 9e5e91a97b83ad142dc1b246f531ec9fc583e7fa..cf6c2afefcfa92c6416b09471937c59299fb6e4e 100644 (file)
@@ -35,6 +35,7 @@
 #include <SUIT_ViewWindow.h>
 #include <SUIT_ViewManager.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_Notebook.h>
 #include <LightApp_SelectionMgr.h>
 #include <OCCViewer_ViewModel.h>
 
@@ -111,11 +112,11 @@ BlocksGUI_TrsfDlg::~BlocksGUI_TrsfDlg()
 void BlocksGUI_TrsfDlg::Init()
 {
   // Set range of spinboxes
-  double SpecificStep = 1.0;
-  QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIter;
+  int SpecificStep = 1;
+  QMap<int, SalomeApp_IntSpinBox*>::iterator anIter;
   for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) {
-    //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3);
-    initSpinBox(anIter.value(), 1.0, 999, SpecificStep, 3);
+    //anIter.data()->RangeStepAndValidator(1, 999, SpecificStep);
+    initSpinBox(anIter.value(), 1, 999, SpecificStep);
   }
 
   // signals and slots connections
@@ -128,7 +129,7 @@ void BlocksGUI_TrsfDlg::Init()
   for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
     connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
 
-  QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIterSpin;
+  QMap<int, SalomeApp_IntSpinBox*>::iterator anIterSpin;
   for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin)
     connect(anIterSpin.value(), SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
 
@@ -166,16 +167,13 @@ void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId)
     myGrp2->hide();
     myGrp1->show();
     mySpinBox[SpinBox1]->setValue(2);
-    mySpinBox[SpinBox1]->setDecimals(0);
     mySelBtn[MainObj1]->click();
     break;
   case 1:
     myGrp1->hide();
     myGrp2->show();
     mySpinBox[SpinBox2U]->setValue(2);
-    mySpinBox[SpinBox2U]->setDecimals(0);
     mySpinBox[SpinBox2V]->setValue(2);
-    mySpinBox[SpinBox2V]->setDecimals(0);
     mySelBtn[MainObj2]->click();
     break;
   default:
@@ -453,7 +451,7 @@ void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl,
                                       const int      theId)
 {
   QLabel* lab = new QLabel(theLbl, theParent);
-  mySpinBox[theId] = new SalomeApp_DoubleSpinBox(theParent);
+  mySpinBox[theId] = new SalomeApp_IntSpinBox(theParent);
   QGridLayout* l = 0;
   if (!theParent->layout()) {
     l = new QGridLayout(theParent);
@@ -579,37 +577,25 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
 
   GEOM::GEOM_Object_var anObj;
 
+  GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
+
   switch (getConstructorId()) {
   case 0:
-    anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
-      MakeMultiTransformation1D(myShape,
-                                myFaces[Face1], myFaces[Face2],
-                                mySpinBox[SpinBox1]->value());
+    anObj = anOper->MakeMultiTransformation1D(myShape,
+                                             myFaces[Face1], myFaces[Face2],
+                                             mySpinBox[SpinBox1]->value());
     if (!anObj->_is_nil() && !IsPreview())
-    {
-      QStringList aParameters;
-      aParameters << "" << "";
-      aParameters << mySpinBox[SpinBox1]->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-    }
+      myNoteBook->setParameters(anObj, 1, mySpinBox[SpinBox1]);
     res = true;
     break;
   case 1:
-    anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
-      MakeMultiTransformation2D (myShape,
-                                 myFaces[Face1U], myFaces[Face2U],
-                                 mySpinBox[SpinBox2U]->value(),
-                                 myFaces[Face1V], myFaces[Face2V],
-                                 mySpinBox[SpinBox2V]->value());
+    anObj = anOper->MakeMultiTransformation2D (myShape,
+                                              myFaces[Face1U], myFaces[Face2U],
+                                              mySpinBox[SpinBox2U]->value(),
+                                              myFaces[Face1V], myFaces[Face2V],
+                                              mySpinBox[SpinBox2V]->value());
     if (!anObj->_is_nil() && !IsPreview())
-    {
-      QStringList aParameters;
-      aParameters << "" << "";
-      aParameters << mySpinBox[SpinBox2U]->text();
-      aParameters << "" << "";
-      aParameters << mySpinBox[SpinBox2V]->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-    }
+      myNoteBook->setParameters(anObj, 2, mySpinBox[SpinBox2U], mySpinBox[SpinBox2V]);
     res = true;
     break;
   default: