]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Naming for extrusion cut.
authordbv <dbv@opencascade.com>
Wed, 10 Jun 2015 15:43:16 +0000 (18:43 +0300)
committerdbv <dbv@opencascade.com>
Wed, 10 Jun 2015 15:43:16 +0000 (18:43 +0300)
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.h
src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp
src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h

index 555590596688b4b109c84552220276b6da397fa6..80effcb208a36da33056c4d194cf01e8031f6fe5 100644 (file)
@@ -130,9 +130,6 @@ void FeaturesPlugin_Boolean::execute()
 
         if(GeomAlgoAPI_ShapeProps::volume(aBoolAlgo.shape()) > 1.e-7) {
           std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
-          std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList = std::shared_ptr<GeomAlgoAPI_MakeShapeList>(
-            new GeomAlgoAPI_MakeShapeList(aListOfMakeShape));
-
           LoadNamingDS(aResultBody, anObject, aTools, aBoolAlgo);
           setResult(aResultBody, aResultIndex);
           aResultIndex++;
index 20f29ddbf42eae0ec27053d890b2243831c4cec1..df9065b25fcc609de4bf909427f3af470e279f79 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "FeaturesPlugin.h"
 #include <ModelAPI_Feature.h>
-#include <GeomAPI_Shape.h>
+
 #include <GeomAlgoAPI_Boolean.h>
 
 class GeomAlgoAPI_MakeShapeList;
index 63409d43821b02f93d376deeb6aa2e8fb0e8505e..6cd449d82f3c3b9281f3f452bf34f351f2ecc0e5 100755 (executable)
@@ -171,13 +171,38 @@ void FeaturesPlugin_ExtrusionCut::execute()
 
     if(GeomAlgoAPI_ShapeProps::volume(aBoolAlgo.shape()) > 1.e-7) {
       std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
-      if(anObject->isEqual(aBoolAlgo.shape())) {
-        aResultBody->store(aBoolAlgo.shape());
-      } else {
-        aResultBody->storeModified(anObject, aBoolAlgo.shape());
-        setResult(aResultBody, aResultIndex);
-        aResultIndex++;
-      }
+      LoadNamingDS(aResultBody, anObject, anExtrusionList, aBoolAlgo);
+      setResult(aResultBody, aResultIndex);
+      aResultIndex++;
+    }
+  }
+}
+
+//=================================================================================================
+void FeaturesPlugin_ExtrusionCut::LoadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+                                               const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
+                                               const ListOfShape& theTools,
+                                               const GeomAlgoAPI_Boolean& theAlgo)
+{
+  //load result
+  if(theBaseShape->isEqual(theAlgo.shape())) {
+    theResultBody->store(theAlgo.shape());
+  } else {
+    theResultBody->storeModified(theBaseShape, theAlgo.shape());
+
+    GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
+
+    const int aModTag = 1;
+    const int aDeleteTag = 2;
+    const std::string aModName = "Modified";
+    theResultBody->loadAndOrientModifiedShapes(theAlgo.makeShape().get(), theBaseShape, GeomAPI_Shape::FACE,
+                                               aModTag, aModName, *theAlgo.mapOfShapes().get());
+    theResultBody->loadDeletedShapes(theAlgo.makeShape().get(), theBaseShape, GeomAPI_Shape::FACE, aDeleteTag);
+
+    for(ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
+      theResultBody->loadAndOrientModifiedShapes(theAlgo.makeShape().get(), *anIter, GeomAPI_Shape::FACE,
+                                                 aModTag, aModName, *theAlgo.mapOfShapes().get());
+      theResultBody->loadDeletedShapes(theAlgo.makeShape().get(), *anIter, GeomAPI_Shape::FACE, aDeleteTag);
     }
   }
 }
index 650a6bcc0d7994e60bbfb4f1cbc000adf2411122..5735242fae2858bf382620e55440b30f76c25b49 100755 (executable)
@@ -11,6 +11,8 @@
 
 #include <ModelAPI_CompositeFeature.h>
 
+#include <GeomAlgoAPI_Boolean.h>
+
 /** \class FeaturesPlugin_ExtrusionCut
  *  \ingroup Plugins
  */
@@ -101,6 +103,12 @@ class FeaturesPlugin_ExtrusionCut : public ModelAPI_CompositeFeature
   /// This method to inform that sub-feature is removed and must be removed from the internal data
   /// structures of the owner (the remove from the document will be done outside just after)
   FEATURESPLUGIN_EXPORT virtual void removeFeature(std::shared_ptr<ModelAPI_Feature> theFeature);
+
+private:
+  void LoadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+                    const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
+                    const ListOfShape& theTools,
+                    const GeomAlgoAPI_Boolean& theAlgo);
 };
 
 #endif