From: dbv Date: Wed, 10 Jun 2015 15:43:16 +0000 (+0300) Subject: Naming for extrusion cut. X-Git-Tag: V_1.3.0~252 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1360833d0861ef1dac27f1c89773d6c11df63b47;p=modules%2Fshaper.git Naming for extrusion cut. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index 555590596..80effcb20 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -130,9 +130,6 @@ void FeaturesPlugin_Boolean::execute() if(GeomAlgoAPI_ShapeProps::volume(aBoolAlgo.shape()) > 1.e-7) { std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - std::shared_ptr aMakeShapeList = std::shared_ptr( - new GeomAlgoAPI_MakeShapeList(aListOfMakeShape)); - LoadNamingDS(aResultBody, anObject, aTools, aBoolAlgo); setResult(aResultBody, aResultIndex); aResultIndex++; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h index 20f29ddbf..df9065b25 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h @@ -9,7 +9,7 @@ #include "FeaturesPlugin.h" #include -#include + #include class GeomAlgoAPI_MakeShapeList; diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp index 63409d438..6cd449d82 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.cpp @@ -171,13 +171,38 @@ void FeaturesPlugin_ExtrusionCut::execute() if(GeomAlgoAPI_ShapeProps::volume(aBoolAlgo.shape()) > 1.e-7) { std::shared_ptr 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 theResultBody, + const std::shared_ptr& 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); } } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h index 650a6bcc0..5735242fa 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionCut.h @@ -11,6 +11,8 @@ #include +#include + /** \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 theFeature); + +private: + void LoadNamingDS(std::shared_ptr theResultBody, + const std::shared_ptr& theBaseShape, + const ListOfShape& theTools, + const GeomAlgoAPI_Boolean& theAlgo); }; #endif