X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Union.cpp;h=e9cbaee7de9a13a1aaa3a2d56001da00a5becfaf;hb=84ff9a5e90ebf75292b9ef97a05a4609e67c4022;hp=66bef610ccf6784882a93a7291050995f306fa57;hpb=2714903267d23cd0c81166c506fb3edd1e069d40;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index 66bef610c..e9cbaee7d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include //================================================================================================= @@ -59,7 +59,7 @@ void FeaturesPlugin_Union::execute() return; } ResultPtr aContext = anObjectAttr->context(); - ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext); + ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext); if(aResCompSolidPtr.get()) { std::shared_ptr aContextShape = aResCompSolidPtr->shape(); std::map, ListOfShape>::iterator @@ -121,7 +121,7 @@ void FeaturesPlugin_Union::execute() } // Checking that the algorithm worked properly. - GeomAlgoAPI_MakeShapeList aMakeShapeList; + std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); GeomAPI_DataMapOfShapeShape aMapOfShapes; if(!anAlgo->isDone()) { setError("Error: Boolean algorithm failed."); @@ -137,7 +137,7 @@ void FeaturesPlugin_Union::execute() } GeomShapePtr aShape = anAlgo->shape(); - aMakeShapeList.appendAlgo(anAlgo); + aMakeShapeList->appendAlgo(anAlgo); aMapOfShapes.merge(anAlgo->mapOfSubShapes()); // Store original shapes for naming. @@ -163,27 +163,20 @@ void FeaturesPlugin_Union::execute() } aShape = aFillerAlgo->shape(); - aMakeShapeList.appendAlgo(aFillerAlgo); + aMakeShapeList->appendAlgo(aFillerAlgo); aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); } + // workaround: make copy to name edges correctly // Store result and naming. - const int aModifyEdgeTag = 1; - const int aModifyFaceTag = 2; - const int aDeletedTag = 3; - /// sub solids will be placed at labels 4, 5 etc. if result is compound of solids - const int aSubsolidsTag = 4; - const std::string aModName = "Modified"; std::shared_ptr aResultBody = document()->createBody(data()); - aResultBody->storeModified(anObjects.front(), aShape, aSubsolidsTag); + aResultBody->storeModified(anObjects.front(), aShape); for(ListOfShape::const_iterator anIter = anObjects.begin(); anIter != anObjects.end(); ++anIter) { - aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::EDGE, - aModifyEdgeTag, aModName, aMapOfShapes); - aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, - aModifyFaceTag, aModName, aMapOfShapes); - aResultBody->loadDeletedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aDeletedTag); + aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::EDGE); + aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::FACE); + //aResultBody->loadDeletedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aDeletedTag); } setResult(aResultBody);