#include <GeomAlgoAPI_PaveFiller.h>
#include <GeomAlgoAPI_ShapeTools.h>
-#include <GeomAPI_ShapeExplorer.h>
+#include <GeomAPI_ShapeIterator.h>
#include <map>
for(; aBoolObjIt != aBooleanObjects.cend() && aBoolMSIt != aBooleanMakeShapes.cend();
++aBoolObjIt, ++aBoolMSIt) {
- int aTag = 1;
-
ResultBodyPtr aResultBody = myFeature->document()->createBody(myFeature->data(), aResultIndex);
if((*aBoolObjIt)->isEqual((*aBoolMSIt)->shape())) {
}
else
{
- aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape(), aTag);
-
- aTag += 5000;
+ aResultBody->storeModified(*aBoolObjIt, (*aBoolMSIt)->shape());
// Store generation history.
ListOfShape::const_iterator aGenBaseIt = aGenBaseShapes.cbegin();
ListOfMakeShape::const_iterator aGenMSIt = aGenMakeShapes.cbegin();
for(; aGenBaseIt != aGenBaseShapes.cend() && aGenMSIt != aGenMakeShapes.cend();
++aGenBaseIt, ++aGenMSIt) {
- storeGenerationHistory(aResultBody, *aGenBaseIt, *aGenMSIt, aTag);
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMSList(new GeomAlgoAPI_MakeShapeList());
+ aMSList->appendAlgo(*aGenMSIt);
+ aMSList->appendAlgo(*aBoolMSIt);
+ storeGenerationHistory(aResultBody, *aGenBaseIt, aMSList);
}
- int aModTag = aTag;
- storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt, aModTag);
+ storeModificationHistory(aResultBody, *aBoolObjIt, aTools, *aBoolMSIt);
ResultBaseAlgo aRBA;
aRBA.resultBody = aResultBody;
aRBA.baseShape = *aBoolObjIt;
aRBA.makeShape = *aBoolMSIt;
- aRBA.delTag = aModTag;
aResultBaseAlgoList.push_back(aRBA);
aResultShapesList.push_back((*aBoolMSIt)->shape());
}
// Collecting solids from compsolids which will not be modified in boolean operation.
ListOfShape aShapesToAdd;
- for(GeomAPI_ShapeExplorer
- anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
- GeomShapePtr aSolidInCompSolid = anExp.current();
+ for (GeomAPI_ShapeIterator aCompSolidIt(aCompSolid);
+ aCompSolidIt.more();
+ aCompSolidIt.next())
+ {
+ GeomShapePtr aSolidInCompSolid = aCompSolidIt.current();
ListOfShape::const_iterator aUsedShapesIt = aUsedShapes.cbegin();
for(; aUsedShapesIt != aUsedShapes.cend(); ++aUsedShapesIt) {
if(aSolidInCompSolid->isEqual(*aUsedShapesIt)) {
aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedShapes.begin(), aUsedShapes.end());
// Collect solids from compsolid which will not be modified in boolean operation.
- for(GeomAPI_ShapeExplorer
- anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
- GeomShapePtr aSolidInCompSolid = anExp.current();
+ for (GeomAPI_ShapeIterator aCompSolidIt(aCompSolid);
+ aCompSolidIt.more();
+ aCompSolidIt.next())
+ {
+ GeomShapePtr aSolidInCompSolid = aCompSolidIt.current();
ListOfShape::iterator anIt = aUsedShapes.begin();
for(; anIt != aUsedShapes.end(); anIt++) {
if(aSolidInCompSolid->isEqual(*anIt)) {
void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr theResultBody,
const GeomShapePtr theObject,
const ListOfShape& theTools,
- const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
- int& theTag)
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
{
- int aModTag = theTag;
- int anEdgesAndFacesTag = ++aModTag;
- int aDelTag = ++anEdgesAndFacesTag;
- theTag = aDelTag;
-
- const std::string aModName = "Modfied";
-
ListOfShape aTools = theTools;
aTools.push_back(theObject);
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMap = theMakeShape->mapOfSubShapes();
-
- int aTag;
- std::string aName;
for(ListOfShape::const_iterator anIt = aTools.begin(); anIt != aTools.end(); anIt++) {
- if((*anIt)->shapeType() == GeomAPI_Shape::EDGE) {
- aTag = anEdgesAndFacesTag;
- aName = aModName + "_Edge";
- }
- else if((*anIt)->shapeType() == GeomAPI_Shape::FACE) {
- aTag = anEdgesAndFacesTag;
- aName = aModName + "_Face";
- } else {
- aTag = aModTag;
- aName = aModName;
- }
- theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt,
- (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
- GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get(), false, false, true);
+ theResultBody->loadModifiedShapes(theMakeShape, *anIt,
+ (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
+ GeomAPI_Shape::EDGE :
+ GeomAPI_Shape::FACE);
}
}
++anIt)
{
ResultBaseAlgo& aRCA = *anIt;
- aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
+ aRCA.resultBody->loadDeletedShapes(aRCA.makeShape,
aRCA.baseShape,
GeomAPI_Shape::FACE,
- aRCA.delTag,
theResultShapesCompound);
for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++)
{
- aRCA.resultBody->loadDeletedShapes(aRCA.makeShape.get(),
+ aRCA.resultBody->loadDeletedShapes(aRCA.makeShape,
*anIter,
GeomAPI_Shape::FACE,
- aRCA.delTag,
theResultShapesCompound);
}
}