]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #811 Be able to export the whole part
authornds <nds@opencascade.com>
Fri, 28 Aug 2015 13:51:15 +0000 (16:51 +0300)
committernds <nds@opencascade.com>
Fri, 28 Aug 2015 14:44:28 +0000 (17:44 +0300)
src/ExchangePlugin/plugin-Exchange.xml
src/ModuleBase/ModuleBase_WidgetSelector.cpp

index e98d9f710036f7a02d88559ddd2edfa116c290de..adb17dd86f3acdf4b7a6a0ba71ad0dd07569e7a6 100644 (file)
@@ -1,9 +1,9 @@
 <!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
 
 <plugin>
-  <workbench id="Features" document="Part">
+  <workbench id="Part">
     <group id="Exchange">
-      <feature id="Import" title="Import" tooltip="Import a file" icon=":icons/import.png">
+      <feature id="Import" title="Import" tooltip="Import a file" icon=":icons/import.png" document="Part">
         <file_selector id="file_path" title="Import file" path="">
           <validator id="ExchangePlugin_ImportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES" />
         </file_selector>
@@ -12,7 +12,9 @@
         <export_file_selector id="file_path" type="save" title="Export file" path="">
           <validator id="ExchangePlugin_ExportFormat" parameters="BREP|BRP:BREP,STEP|STP:STEP,IGES|IGS:IGES-5.1,IGES|IGS:IGES-5.3" />
         </export_file_selector>
-        <multi_selector id="selection_list" tooltip="Select a set of objects" type_choice="Vertices Edges Faces Solids" /> 
+        <multi_selector id="selection_list" tooltip="Select a set of objects" type_choice="Vertices Edges Faces Solids Objects">
+          <validator id="GeomValidators_PartSet"/>
+        </multi_selector>
       </feature>
     </group>
   </workbench>
index 6f9076bfbd7a15b918f5da74d762b5db3ed08e2b..daafd6431572392d16f687f1c714a6ada8d8275d 100755 (executable)
@@ -62,12 +62,18 @@ bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape,
   bool aValid = false;
 
   GeomShapePtr aShape = theShape;
+
+  QIntList aShapeTypes = getShapeTypes();
+  // when the SHAPE type is provided by XML, the hole result shape can be selected.
+  if (!aShape.get() && aShapeTypes.contains(TopAbs_SHAPE)) {
+    aValid = true;
+    return aValid;
+  }
+
   if (!aShape.get() && theResult.get()) {
     if (theResult.get())
       aShape = theResult->shape();
   }
-  QIntList aShapeTypes = getShapeTypes();
-
   TopAbs_ShapeEnum aShapeType = TopAbs_SHAPE;
   if (aShape.get()) {
     // Check that the selection corresponds to selection type
@@ -76,9 +82,6 @@ bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape,
     // for compounds check sub-shapes: it may be compound of needed type:
     // Booleans may produce compounds of Solids
     if (aShapeType == TopAbs_COMPOUND) {
-      if (aShapeTypes.contains(aShapeType))
-        return true;
-
       aShapeType = GeomValidators_Tools::getCompoundSubType(aTopoShape);
     }
   }