Salome HOME
0022747: [EDF] Improvement of Get Shared Shapes operation
[modules/geom.git] / src / OperationGUI / OperationGUI_GetSharedShapesDlg.cxx
index c5880d796c46df914b08d444afe6d2e60cc3147f..95d0d67246f19230225060474229eee62815dc2d 100644 (file)
@@ -75,7 +75,7 @@ OperationGUI_GetSharedShapesDlg::OperationGUI_GetSharedShapesDlg
   GroupPoints->LineEdit1->setReadOnly(true);
   GroupPoints->LineEdit2->hide();
   GroupPoints->LineEdit1->setEnabled(true);
-  GroupPoints->CheckButton1->hide();
+  GroupPoints->CheckButton1->setText(tr("GEOM_SHARED_SHAPES_MULTISHARE"));
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -308,11 +308,13 @@ GEOM::GEOM_IOperations_ptr OperationGUI_GetSharedShapesDlg::createOperation()
 //=================================================================================
 bool OperationGUI_GetSharedShapesDlg::isValid (QString& msg)
 {
-  if (myListShapes.length() < 2) {
+  bool isOK = myListShapes.length() > 1 ||
+    ( myListShapes.length() > 0 && myListShapes[0]->GetShapeType() == GEOM::COMPOUND );
+
+  if ( !isOK )
     msg = tr("MSG_SHARED_SHAPES_TOO_FEW_SHAPES");
-    return false;
-  }
-  return true;
+
+  return isOK;
 }
 
 //=================================================================================
@@ -322,7 +324,7 @@ bool OperationGUI_GetSharedShapesDlg::isValid (QString& msg)
 bool OperationGUI_GetSharedShapesDlg::execute (ObjectList& objects)
 {
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
-  GEOM::ListOfGO_var aList = anOper->GetSharedShapesMulti(myListShapes, GetType());
+  GEOM::ListOfGO_var aList = anOper->GetSharedShapesMulti(myListShapes, GetType(), GroupPoints->CheckButton1->isChecked());
 
   if (!aList->length())
     return false;