]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_BodyBuilder.cpp
Salome HOME
Issue #2021
[modules/shaper.git] / src / Model / Model_BodyBuilder.cpp
index 38d349bd7386b89dd822b2ab45ff9d03d22b4c22..2e5c4ba6c03b1ec610f64f8cbdd69b74c867779b 100755 (executable)
@@ -348,7 +348,8 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes (
   const int  theTag,
   const std::string& theName,
   GeomAPI_DataMapOfShapeShape& theSubShapes,
-  const bool theIsStoreSeparate)
+  const bool theIsStoreSeparate,
+  const bool theIsStoreAsGenerated)
 {
   int anIndex = 1;
   int aTag = theTag;
@@ -377,7 +378,13 @@ void Model_BodyBuilder::loadAndOrientModifiedShapes (
       GeomShapePtr aGeomNewShape(new GeomAPI_Shape());
       aGeomNewShape->setImpl(new TopoDS_Shape(aNewShape));
       if(!aRoot.IsSame(aNewShape) && aResultShape->isSubShape(aGeomNewShape)) {
-        builder(aTag)->Modify(aRoot,aNewShape);
+        if(theIsStoreAsGenerated) {
+          // Here we store shapes as generated, to avoid problem when one parent shape produce
+          // several child shapes. In this case naming could not determine which shape to select.
+          builder(aTag)->Generated(aRoot,aNewShape);
+        } else {
+          builder(aTag)->Modify(aRoot,aNewShape);
+        }
         if(isBuilt) {
           if(theIsStoreSeparate) {
             aStream.str(std::string());