Salome HOME
0020044: EDF 866 GEOM: Extrusion along a path : impossible to select a Wire
[modules/geom.git] / src / GenerationGUI / GenerationGUI_FillingDlg.cxx
index 2e7a380e1c4351a584bf27ce8546c6de47e55650..ae4f0251ac9335b1128d33fffe1353dbb646299b 100644 (file)
@@ -107,7 +107,7 @@ void GenerationGUI_FillingDlg::Init()
   myMaxDeg = 5;
   myTol3D = 0.0001;
   myTol2D = 0.0001;
-  myNbIter = 5;
+  myNbIter = 0;
   myIsApprox = false;
   myOkCompound = false;
 
@@ -118,7 +118,7 @@ void GenerationGUI_FillingDlg::Init()
   /* min, max, step and decimals for spin boxes & initial values */
   initSpinBox( GroupPoints->SpinBox1, 2.0, MAX_NUMBER,  SpecificStep1, 3 );
   initSpinBox( GroupPoints->SpinBox2, 0.00001, 10000.0, SpecificStep2, 5 );
-  initSpinBox( GroupPoints->SpinBox3, 1.0, MAX_NUMBER,  SpecificStep1, 3 );
+  initSpinBox( GroupPoints->SpinBox3, 0.0, MAX_NUMBER,  SpecificStep1, 3 );
   initSpinBox( GroupPoints->SpinBox4, 1.0, MAX_NUMBER,  SpecificStep1, 3 );
   initSpinBox( GroupPoints->SpinBox5, 0.00001, 10000.0, SpecificStep2, 5 );
 
@@ -197,41 +197,43 @@ bool GenerationGUI_FillingDlg::ClickOnApply()
 void GenerationGUI_FillingDlg::SelectionIntoArgument()
 {
   erasePreview();
-  myEditCurrentArgument->setText( "" );
+  myEditCurrentArgument->setText("");
 
-  if ( IObjectCount() != 1 ) {
-    if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
+
+  if (aSelList.Extent() != 1) {
+    if (myEditCurrentArgument == GroupPoints->LineEdit1)
       myOkCompound = false;
     return;
   }
 
   // nbSel == 1
   Standard_Boolean testResult = Standard_False;
-  GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+  GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
 
-  if ( !testResult )
+  if (!testResult)
     return;
 
-  if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+  if (myEditCurrentArgument == GroupPoints->LineEdit1) {
     TopoDS_Shape S;
     myOkCompound = false;
 
-    if ( GEOMBase::GetShape(aSelectedObject, S) &&
-        S.ShapeType() == TopAbs_COMPOUND ) {
-       // myCompound should be a compound of edges
-       for ( TopoDS_Iterator it( S ); it.More(); it.Next() )
-         if ( it.Value().ShapeType() != TopAbs_EDGE )
-           return;
-       myCompound = aSelectedObject;
-       myOkCompound = true;
-      }
+    if (GEOMBase::GetShape(aSelectedObject, S) && S.ShapeType() == TopAbs_COMPOUND) {
+      // myCompound should be a compound of edges
+      for (TopoDS_Iterator it (S); it.More(); it.Next())
+        if (it.Value().ShapeType() != TopAbs_EDGE)
+          return;
+      myCompound = aSelectedObject;
+      myOkCompound = true;
+    }
   }
 
-  myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+  myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
   displayPreview();
 }
 
-
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :