]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1351: partition is not done
authordbv <dbv@opencascade.com>
Thu, 3 Mar 2016 07:24:08 +0000 (10:24 +0300)
committerdbv <dbv@opencascade.com>
Thu, 3 Mar 2016 08:46:19 +0000 (11:46 +0300)
src/FeaturesPlugin/FeaturesPlugin_Partition.cpp

index e7e74c68e91a6d69aab4e473bb11793e084df74c..fd3d270a4c7b4a6e87d6de11ee74688cb0f18e0d 100755 (executable)
@@ -102,12 +102,12 @@ void FeaturesPlugin_Partition::execute()
 
   if(isCombine) {
     // Create single result.
-    if(!aTools.empty()) {
-      // This is a workaround for naming. Passing compound of objects as argument instead each object separately.
-      std::shared_ptr<GeomAPI_Shape> aCompoud = GeomAlgoAPI_CompoundBuilder::compound(anObjects);
-      anObjects.clear();
-      anObjects.push_back(aCompoud);
-    }
+    //if(!aTools.empty()) {
+    //  // This is a workaround for naming. Passing compound of objects as argument instead each object separately.
+    //  std::shared_ptr<GeomAPI_Shape> aCompoud = GeomAlgoAPI_CompoundBuilder::compound(anObjects);
+    //  anObjects.clear();
+    //  anObjects.push_back(aCompoud);
+    //}
     std::shared_ptr<GeomAlgoAPI_Partition> aPartitionAlgo(new GeomAlgoAPI_Partition(anObjects, aTools));
 
     // Checking that the algorithm worked properly.
@@ -131,7 +131,10 @@ void FeaturesPlugin_Partition::execute()
       std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
       aMakeShapeList.appendAlgo(aPartitionAlgo);
       GeomAPI_DataMapOfShapeShape& aMapOfShapes = *aPartitionAlgo->mapOfSubShapes().get();
-      loadNamingDS(aResultBody, anObjects.front(), aToolsForNaming, aPartitionAlgo->shape(), aMakeShapeList, aMapOfShapes);
+      std::shared_ptr<GeomAPI_Shape> aBaseShape = anObjects.front();
+      anObjects.pop_front();
+      aToolsForNaming.insert(aToolsForNaming.end(), anObjects.begin(), anObjects.end());
+      loadNamingDS(aResultBody, aBaseShape, aToolsForNaming, aPartitionAlgo->shape(), aMakeShapeList, aMapOfShapes);
       setResult(aResultBody, aResultIndex);
       aResultIndex++;
     }