#include <GeomAPI_ShapeIterator.h>
#include <ModelAPI_AttributeSelectionList.h>
-#include <ModelAPI_ResultCompSolid.h>
+#include <ModelAPI_ResultBody.h>
#include <ModelAPI_Tools.h>
//=================================================================================================
return;
}
ResultPtr aContext = anObjectAttr->context();
- ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+ ResultBodyPtr aResCompSolidPtr = ModelAPI_Tools::bodyOwner(aContext);
if(aResCompSolidPtr.get()) {
std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
}
// Checking that the algorithm worked properly.
- GeomAlgoAPI_MakeShapeList aMakeShapeList;
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
GeomAPI_DataMapOfShapeShape aMapOfShapes;
if(!anAlgo->isDone()) {
setError("Error: Boolean algorithm failed.");
}
GeomShapePtr aShape = anAlgo->shape();
- aMakeShapeList.appendAlgo(anAlgo);
+ aMakeShapeList->appendAlgo(anAlgo);
aMapOfShapes.merge(anAlgo->mapOfSubShapes());
// Store original shapes for naming.
}
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<ModelAPI_ResultBody> 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);