]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Another fix for storing generated faces in ExtrusionCut/Fuse and RevolutionCut/Fuse.
authordbv <dbv@opencascade.com>
Thu, 1 Nov 2018 13:49:33 +0000 (16:49 +0300)
committerdbv <dbv@opencascade.com>
Thu, 1 Nov 2018 13:49:33 +0000 (16:49 +0300)
Now they stored as generated faces from edges, without intermediate generated face.

src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp
src/Model/Model_BodyBuilder.cpp

index f1b693c5bd005bce3f87cf806297fac7453d82dc..670dbe02a845e6f2768217bd3dbceb02ebad399b 100644 (file)
@@ -77,8 +77,6 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean()
   for(; aBoolObjIt != aBooleanObjects.cend() && aBoolMSIt != aBooleanMakeShapes.cend();
       ++aBoolObjIt, ++aBoolMSIt) {
 
-    int aTag = 1;
-
     ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex);
 
     if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) {
@@ -88,14 +86,15 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean()
     {
       aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape());
 
-      aTag += 5000;
-
       // Store generation history.
       ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
       ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
       for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
           ++aGenBaseIt, ++aGenMSIt) {
-        storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt);
+        std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMSList(new GeomAlgoAPI_MakeShapeList());
+        aMSList->appendAlgo(*aGenMSIt);
+        aMSList->appendAlgo(*aBoolMSIt);
+        storeGenerationHistory(aResultBody, *aGenBaseIt, aMSList);
       }
 
       storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt);
@@ -383,7 +382,6 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the
   ListOfShape aTools = theTools;
   aTools.push_back(theObject);
 
-  std::string aName;
   for(ListOfShape::const_iterator anIt = aTools.begin(); anIt != aTools.end(); anIt++) {
     theResultBody->loadModifiedShapes(theMakeShape, *anIt,
                                       (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
index a6e4446bb9ac96c1410ecc1a27f7c540432007a8..c751bcba9cd2433305a664d386092f6d374f421d 100755 (executable)
@@ -608,7 +608,9 @@ void Model_BodyBuilder::loadGeneratedShapes(const GeomMakeShapePtr& theAlgo,
       const TopoDS_Shape& aNewShape_ = aNewShape->impl<TopoDS_Shape>();
 
       bool aNewShapeIsSameAsOldShape = anOldSubShape->isSame(aNewShape);
-      if (aNewShapeIsSameAsOldShape)
+      bool aNewShapeIsNotInResultShape = !aResultShape->isSubShape(aNewShape, false);
+      if (aNewShapeIsSameAsOldShape
+        || aNewShapeIsNotInResultShape)
       {
         continue;
       }