Salome HOME
Preparation of intermediate revision
[modules/geom.git] / src / GenerationGUI / GenerationGUI_PrismDlg.cxx
index 9d4914dfec821122af3bfa015f6b7f24679bf42f..f8f4b677de8846d39c5967f29002ba22509ead3a 100644 (file)
@@ -32,6 +32,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_Notebook.h>
 #include <LightApp_SelectionMgr.h>
 
 // OCCT Includes
@@ -650,35 +651,29 @@ bool GenerationGUI_PrismDlg::isValid (QString& msg)
 //=================================================================================
 bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
 {
-  QStringList aParameters;
   GEOM::GEOM_Object_var anObj;
 
+  GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
+
   switch (getConstructorId()) {
   case 0:
     if (!myBothway) {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismVecH(myBase, myVec, getHeight());
+      anObj = anOper->MakePrismVecH(myBase, myVec, getHeight());
     }
     else {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismVecH2Ways(myBase, myVec, getHeight());
+      anObj = anOper->MakePrismVecH2Ways(myBase, myVec, getHeight());
     }
 
     if (!anObj->_is_nil() && !IsPreview())
-    {
-      aParameters << GroupPoints->SpinBox_DX->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-    }
+      myNoteBook->setParameters(anObj, 1, GroupPoints->SpinBox_DX );
 
     break;
   case 1:
     if (!myBothway2) {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismTwoPnt(myBase, myPoint1, myPoint2);
+      anObj = anOper->MakePrismTwoPnt(myBase, myPoint1, myPoint2);
     }
     else {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismTwoPnt2Ways(myBase, myPoint1, myPoint2);
+      anObj = anOper->MakePrismTwoPnt2Ways(myBase, myPoint1, myPoint2);
     }
     break;
   case 2:
@@ -687,21 +682,17 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
     double dz = GroupPoints3->SpinBox_DZ->value();
 
     if (!myBothway3) {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismDXDYDZ(myBase, dx, dy, dz);
+      anObj = anOper->MakePrismDXDYDZ(myBase, dx, dy, dz);
     }
     else {
-      anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
-        MakePrismDXDYDZ2Ways(myBase, dx, dy, dz);
+      anObj = anOper->MakePrismDXDYDZ2Ways(myBase, dx, dy, dz);
     }
 
     if (!anObj->_is_nil() && !IsPreview())
-    {
-      aParameters << GroupPoints3->SpinBox_DX->text();
-      aParameters << GroupPoints3->SpinBox_DY->text();
-      aParameters << GroupPoints3->SpinBox_DZ->text();
-      anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
-    }
+      myNoteBook->setParameters(anObj, 3,
+                                GroupPoints3->SpinBox_DX,
+                                GroupPoints3->SpinBox_DY,
+                                GroupPoints3->SpinBox_DZ);
 
     break;
   }