Salome HOME
Additional minor fix of issue 0017431: unset the MODAL behavior for the 'Basic Proper...
[modules/geom.git] / src / GenerationGUI / GenerationGUI_RevolDlg.cxx
index 3e6f7fa8e94e8ac55fd12c1b25051799eab47c82..8f9a6008e97668248e8d2fd5f64c0c6c145bcdcf 100644 (file)
@@ -218,7 +218,11 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   erasePreview();
   myEditCurrentArgument->setText( "" );
   
-  if ( IObjectCount() != 1 ) {
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
+
+  if (aSelList.Extent() != 1) {
     if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
       myOkBase = false;        
     else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@@ -228,7 +232,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   
   // 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);
   QString aName = GEOMBase::GetName( aSelectedObject );
   
   if ( !testResult )
@@ -249,9 +253,8 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
       TopoDS_Shape aShape;
       
       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
-       LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
        TColStd_IndexedMapOfInteger aMap;
-       aSelMgr->GetIndexes( firstIObject(), aMap );
+       aSelMgr->GetIndexes(aSelList.First(), aMap);
        if ( aMap.Extent() == 1 ) {
          
          int anIndex = aMap( 1 );
@@ -289,7 +292,6 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   displayPreview();
 }
 
-
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :