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++;
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);
}
}
}
#include <ModelAPI_CompositeFeature.h>
+#include <GeomAlgoAPI_Boolean.h>
+
/** \class FeaturesPlugin_ExtrusionCut
* \ingroup Plugins
*/
/// 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