From fe287b144d91e67a33f4761bd4313dc79ffb20db Mon Sep 17 00:00:00 2001 From: Alexey SOZINOV Date: Fri, 29 Jan 2021 21:11:00 +0300 Subject: [PATCH] Naming functions were from FeaturesPlugin_Tools to ModelAPI_Tools --- src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp | 8 +- src/FeaturesPlugin/FeaturesPlugin_Boolean.h | 2 +- .../FeaturesPlugin_BooleanCommon.cpp | 8 +- .../FeaturesPlugin_BooleanCut.cpp | 6 +- .../FeaturesPlugin_BooleanFill.cpp | 5 +- .../FeaturesPlugin_BooleanFuse.cpp | 22 ++-- .../FeaturesPlugin_BooleanSmash.cpp | 22 ++-- .../FeaturesPlugin_Defeaturing.cpp | 11 +- .../FeaturesPlugin_Extrusion.cpp | 6 +- .../FeaturesPlugin_Fillet1D.cpp | 6 +- .../FeaturesPlugin_FusionFaces.cpp | 6 +- .../FeaturesPlugin_Intersection.cpp | 21 +-- .../FeaturesPlugin_MultiRotation.cpp | 5 +- .../FeaturesPlugin_MultiTranslation.cpp | 5 +- .../FeaturesPlugin_Placement.cpp | 4 +- .../FeaturesPlugin_Rotation.cpp | 5 +- src/FeaturesPlugin/FeaturesPlugin_Scale.cpp | 9 +- .../FeaturesPlugin_Symmetry.cpp | 5 +- src/FeaturesPlugin/FeaturesPlugin_Tools.cpp | 120 ------------------ src/FeaturesPlugin/FeaturesPlugin_Tools.h | 30 ----- .../FeaturesPlugin_Translation.cpp | 5 +- src/FeaturesPlugin/FeaturesPlugin_Union.cpp | 4 +- .../FeaturesPlugin_VersionedBoolean.cpp | 18 +-- .../FeaturesPlugin_VersionedBoolean.h | 7 +- .../FeaturesPlugin_VersionedChFi.cpp | 9 +- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h | 6 +- src/ModelAPI/ModelAPI_Tools.cpp | 120 ++++++++++++++++++ src/ModelAPI/ModelAPI_Tools.h | 30 +++++ 28 files changed, 252 insertions(+), 253 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index ed051dc00..e10cc331c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -111,7 +111,7 @@ void FeaturesPlugin_Boolean::storeResult( const GeomShapePtr theResultShape, int& theResultIndex, std::shared_ptr theMakeShapeList, - std::vector& theResultBaseAlgoList) + std::vector& theResultBaseAlgoList) { if (!theResultShape) return; @@ -119,7 +119,7 @@ void FeaturesPlugin_Boolean::storeResult( std::shared_ptr aResultBody = document()->createBody(data(), theResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, + ModelAPI_Tools::loadModifiedShapes(aResultBody, theObjects, theTools, theMakeShapeList, @@ -127,10 +127,10 @@ void FeaturesPlugin_Boolean::storeResult( setResult(aResultBody, theResultIndex++); // merge algorithms - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = theObjects.front(); - for (std::vector::iterator + for (std::vector::iterator aRBAIt = theResultBaseAlgoList.begin(); aRBAIt != theResultBaseAlgoList.end(); ++aRBAIt) { theMakeShapeList->appendAlgo(aRBAIt->makeShape); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h index f6bf52266..3a8986a24 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h @@ -75,7 +75,7 @@ protected: const GeomShapePtr theResultShape, int& theResultIndex, std::shared_ptr theMakeShapeList, - std::vector& theResultBaseAlgoList); + std::vector& theResultBaseAlgoList); private: OperationType myOperationType; diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp index 085107edb..60b3581b3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp @@ -94,7 +94,7 @@ void FeaturesPlugin_BooleanCommon::execute() std::string anError; std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); - std::vector aResultBaseAlgoList; + std::vector aResultBaseAlgoList; ListOfShape aResultShapesList; if (isSimpleMode) { @@ -128,7 +128,7 @@ void FeaturesPlugin_BooleanCommon::execute() ListOfShape anObjectList = anObjects.objects(); ListOfShape aToolsList; - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, + ModelAPI_Tools::loadModifiedShapes(aResultBody, anObjectList, aToolsList, aMakeShapeList, @@ -139,7 +139,7 @@ void FeaturesPlugin_BooleanCommon::execute() aResultIndex++; aToolsList = anObjectList; - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = aBaseShape; aRBA.makeShape = aMakeShapeList; @@ -194,7 +194,7 @@ void FeaturesPlugin_BooleanCommon::execute() // result shape has been deleted, but in another it was modified or stayed. if (!aResultCompound) aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList); - FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, + ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools.objects(), aResultCompound); diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp index f24d6f78b..fe831bec3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp @@ -19,8 +19,6 @@ #include "FeaturesPlugin_BooleanCut.h" -#include "FeaturesPlugin_Tools.h" - #include #include #include @@ -67,7 +65,7 @@ void FeaturesPlugin_BooleanCut::execute() return; } - std::vector aResultBaseAlgoList; + std::vector aResultBaseAlgoList; ListOfShape aResultShapesList; std::string anError; @@ -120,7 +118,7 @@ void FeaturesPlugin_BooleanCut::execute() // result shape has been deleted, but in another it was modified or stayed. if (!aResultCompound) aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList); - FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, + ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools.objects(), aResultCompound); diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp index de0c313ba..cbab08a64 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp @@ -18,7 +18,6 @@ // #include "FeaturesPlugin_BooleanFill.h" -#include "FeaturesPlugin_Tools.h" #include #include @@ -78,7 +77,7 @@ void FeaturesPlugin_BooleanFill::execute() return; } - std::vector aResultBaseAlgoList; + std::vector aResultBaseAlgoList; ListOfShape aResultShapesList; std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); @@ -122,7 +121,7 @@ void FeaturesPlugin_BooleanFill::execute() // result shape has been deleted, but in another it was modified or stayed. if (!aResultCompound) aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList); - FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, + ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList, aTools.objects(), aResultCompound); diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp index 1214bb214..dd7f59d68 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp @@ -19,8 +19,6 @@ #include "FeaturesPlugin_BooleanFuse.h" -#include "FeaturesPlugin_Tools.h" - #include #include #include @@ -271,19 +269,19 @@ void FeaturesPlugin_BooleanFuse::execute() ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); ListOfShape anEmptyTools; - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, - anOriginalShapes, - anEmptyTools, - aMakeShapeList, - aShape); + ModelAPI_Tools::loadModifiedShapes(aResultBody, + anOriginalShapes, + anEmptyTools, + aMakeShapeList, + aShape); setResult(aResultBody, aResultIndex); aResultIndex++; - FeaturesPlugin_Tools::loadDeletedShapes(aResultBody, - GeomShapePtr(), - anOriginalShapes, - aMakeShapeList, - aShape); + ModelAPI_Tools::loadDeletedShapes(aResultBody, + GeomShapePtr(), + anOriginalShapes, + aMakeShapeList, + aShape); // remove the rest results if there were produced in the previous pass removeResults(aResultIndex); diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp index 2eb3753cc..f8336b240 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp @@ -19,8 +19,6 @@ #include "FeaturesPlugin_BooleanSmash.h" -#include "FeaturesPlugin_Tools.h" - #include #include #include @@ -175,20 +173,20 @@ void FeaturesPlugin_BooleanSmash::execute() std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, - anOriginalShapes, - anOriginalShapes, - aMakeShapeList, - aShape); + ModelAPI_Tools::loadModifiedShapes(aResultBody, + anOriginalShapes, + anOriginalShapes, + aMakeShapeList, + aShape); setResult(aResultBody, aResultIndex); aResultIndex++; - FeaturesPlugin_Tools::loadDeletedShapes(aResultBody, - GeomShapePtr(), - anOriginalShapes, - aMakeShapeList, - aShape); + ModelAPI_Tools::loadDeletedShapes(aResultBody, + GeomShapePtr(), + anOriginalShapes, + aMakeShapeList, + aShape); // remove the rest results if there were produced in the previous pass removeResults(aResultIndex); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp b/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp index ac60462ce..47291b11d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp @@ -18,7 +18,6 @@ // #include -#include #include #include @@ -72,7 +71,7 @@ void FeaturesPlugin_Defeaturing::execute() int aResultIndex = 0; std::string anError; - std::vector aResultBaseAlgoList; + std::vector aResultBaseAlgoList; ListOfShape anOriginalShapesList, aResultShapesList; for (SolidFaces::iterator anIt = aBodiesAndFacesToRemove.begin(); @@ -90,13 +89,13 @@ void FeaturesPlugin_Defeaturing::execute() aBaseShapes.push_back(anExp.current()); std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(), - anAlgo, aResult, "Defeaturing"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(), + anAlgo, aResult, "Defeaturing"); setResult(aResultBody, aResultIndex); aResultIndex++; - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = aParent; aRBA.makeShape = anAlgo; @@ -108,7 +107,7 @@ void FeaturesPlugin_Defeaturing::execute() // Store deleted shapes after all results has been proceeded. This is to avoid issue when in one // result shape has been deleted, but in another it was modified or stayed. GeomShapePtr aResultShapesCompound = GeomAlgoAPI_CompoundBuilder::compound(aResultShapesList); - FeaturesPlugin_Tools::loadDeletedShapes(aResultBaseAlgoList, + ModelAPI_Tools::loadDeletedShapes(aResultBaseAlgoList, anOriginalShapesList, aResultShapesCompound); removeResults(aResultIndex); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index aa95790a5..436462796 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -18,13 +18,13 @@ // #include "FeaturesPlugin_Extrusion.h" -#include "FeaturesPlugin_Tools.h" #include #include #include #include #include +#include #include #include @@ -173,8 +173,8 @@ void FeaturesPlugin_Extrusion::storeResultWithBoundaries( ResultBodyPtr aResultBody = document()->createBody(data(), theIndex); // Store modified shapes. - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, theBoundaryShapes, ListOfShape(), - theMakeShape, theMakeShape->shape()); + ModelAPI_Tools::loadModifiedShapes(aResultBody, theBoundaryShapes, ListOfShape(), + theMakeShape, theMakeShape->shape()); // Store generated edges/faces. storeGenerationHistory(aResultBody, theBaseShape, theMakeShape); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Fillet1D.cpp b/src/FeaturesPlugin/FeaturesPlugin_Fillet1D.cpp index b3b4b8493..e1145fb52 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Fillet1D.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Fillet1D.cpp @@ -18,7 +18,6 @@ // #include -#include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include void sendMessageWithFailedShapes(const ListOfShape& theVertices) { @@ -190,8 +190,8 @@ bool FeaturesPlugin_Fillet1D::performFillet(const GeomShapePtr& theWire, ResultBodyPtr aResult = document()->createBody(data(), theResultIndex); ListOfShape anOriginal; anOriginal.push_back(theWire); - FeaturesPlugin_Tools::loadModifiedShapes(aResult, anOriginal, ListOfShape(), - aFilletBuilder, aFilletBuilder->shape(), THE_PREFIX); + ModelAPI_Tools::loadModifiedShapes(aResult, anOriginal, ListOfShape(), + aFilletBuilder, aFilletBuilder->shape(), THE_PREFIX); setResult(aResult, theResultIndex); // store new edges generated from vertices for (ListOfShape::const_iterator anIt = theVertices.begin(); anIt != theVertices.end(); ++anIt) diff --git a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp index 1ded92cbe..b01ab3a49 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp @@ -18,7 +18,6 @@ // #include "FeaturesPlugin_FusionFaces.h" -#include "FeaturesPlugin_Tools.h" #include #include @@ -26,6 +25,7 @@ #include #include #include +#include #include #include @@ -73,7 +73,7 @@ void FeaturesPlugin_FusionFaces::execute() ListOfShape aBaseShapesList; aBaseShapesList.push_back(aBaseShape); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapesList, ListOfShape(), - anAlgo, aResultShape); + ModelAPI_Tools::loadModifiedShapes(aResultBody, aBaseShapesList, ListOfShape(), + anAlgo, aResultShape); setResult(aResultBody); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp index aa95218e0..4a2c31715 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -84,19 +85,19 @@ void FeaturesPlugin_Intersection::execute() } std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, - anObjects, - ListOfShape(), - aMakeShapeList, - aResShape); + ModelAPI_Tools::loadModifiedShapes(aResultBody, + anObjects, + ListOfShape(), + aMakeShapeList, + aResShape); setResult(aResultBody, aResultIndex); aResultIndex++; - FeaturesPlugin_Tools::loadDeletedShapes(aResultBody, - GeomShapePtr(), - anObjects, - aMakeShapeList, - aResShape); + ModelAPI_Tools::loadDeletedShapes(aResultBody, + GeomShapePtr(), + anObjects, + aMakeShapeList, + aResShape); // remove the rest results if there were produced in the previous pass removeResults(aResultIndex); diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp index e8caba9bf..adb0c81f0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -223,8 +224,8 @@ void FeaturesPlugin_MultiRotation::performRotation1D() anObjects.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Rotated"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Rotated"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp index c507c7d50..637fcfa31 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -169,8 +170,8 @@ void FeaturesPlugin_MultiTranslation::execute() anObjects.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Translated"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Translated"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp index efc09092a..7a21c667a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp @@ -179,8 +179,8 @@ void FeaturesPlugin_Placement::execute() for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { //LoadNamingDS ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Placed"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Placed"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp index 1fe9334eb..144e57ef2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -224,8 +225,8 @@ void FeaturesPlugin_Rotation::performRotation(const GeomTrsfPtr& theTrsf) anObjects.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Rotated"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Rotated"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Scale.cpp b/src/FeaturesPlugin/FeaturesPlugin_Scale.cpp index 73cbd10bc..6c92629c8 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Scale.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Scale.cpp @@ -32,6 +32,7 @@ #include #include #include +#include static const std::string SCALE_VERSION_1("v9.5"); @@ -141,8 +142,8 @@ void FeaturesPlugin_Scale::performScaleByFactor() anObjects.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Scaled"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Scaled"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } @@ -213,8 +214,8 @@ void FeaturesPlugin_Scale::performScaleByDimensions() anObjects.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Scaled"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Scaled"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp index e877c4016..d007306fc 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -208,8 +209,8 @@ void FeaturesPlugin_Symmetry::buildResult( { // Store and name the result. ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, theOriginalShapes, ListOfShape(), - theAlgo, theTargetShape, "Symmetried"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, theOriginalShapes, ListOfShape(), + theAlgo, theTargetShape, "Symmetried"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, theResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Tools.cpp b/src/FeaturesPlugin/FeaturesPlugin_Tools.cpp index 9a36609a4..a6dc9169f 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Tools.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Tools.cpp @@ -33,126 +33,6 @@ #include -//================================================================================================== -void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody, - const ListOfShape& theBaseShapes, - const ListOfShape& theTools, - const GeomMakeShapePtr& theMakeShape, - const GeomShapePtr theResultShape, - const std::string& theNamePrefix) -{ - theResultBody->storeModified(theBaseShapes, theResultShape, theMakeShape); - - ListOfShape aShapes = theBaseShapes; - ListOfShape::const_iterator aToolIter = theTools.cbegin(); - for(; aToolIter != theTools.cend(); aToolIter++) - aShapes.push_back(*aToolIter); - - for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); ++anIter) - { - theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::VERTEX, theNamePrefix); - theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::EDGE, theNamePrefix); - theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE, theNamePrefix); - } -} - -//================================================================================================== -void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody, - const GeomShapePtr& theBaseShape, - const GeomMakeShapePtr& theMakeShape, - const std::string theName) -{ - switch(theBaseShape->shapeType()) { - case GeomAPI_Shape::COMPOUND: { - for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next()) - { - loadModifiedShapes(theResultBody, - anIt.current(), - theMakeShape, - theName); - } - break; - } - case GeomAPI_Shape::COMPSOLID: - case GeomAPI_Shape::SOLID: - case GeomAPI_Shape::SHELL: { - theResultBody->loadModifiedShapes(theMakeShape, - theBaseShape, - GeomAPI_Shape::FACE, - theName); - } - case GeomAPI_Shape::FACE: - case GeomAPI_Shape::WIRE: { - theResultBody->loadModifiedShapes(theMakeShape, - theBaseShape, - GeomAPI_Shape::EDGE, - theName); - } - case GeomAPI_Shape::EDGE: { - theResultBody->loadModifiedShapes(theMakeShape, - theBaseShape, - GeomAPI_Shape::VERTEX, - theName); - } - default: // [to avoid compilation warning] - break; - } -} - -//================================================================================================== -void FeaturesPlugin_Tools::loadDeletedShapes(ResultBodyPtr theResultBody, - const GeomShapePtr theBaseShape, - const ListOfShape& theTools, - const GeomMakeShapePtr& theMakeShape, - const GeomShapePtr theResultShapesCompound) -{ - ListOfShape aShapes = theTools; - if (theBaseShape.get()) - aShapes.push_front(theBaseShape); - - for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); anIter++) - { - theResultBody->loadDeletedShapes(theMakeShape, - *anIter, - GeomAPI_Shape::VERTEX, - theResultShapesCompound); - theResultBody->loadDeletedShapes(theMakeShape, - *anIter, - GeomAPI_Shape::EDGE, - theResultShapesCompound); - theResultBody->loadDeletedShapes(theMakeShape, - *anIter, - GeomAPI_Shape::FACE, - theResultShapesCompound); - // store information about deleted solids because of unittest TestBooleanCommon_SolidsHistory - // on OCCT 7.4.0 : common produces modified compsolid, so, move to the end for removed solids - // starts to produce whole compsolid - theResultBody->loadDeletedShapes(theMakeShape, - *anIter, - GeomAPI_Shape::SOLID, - theResultShapesCompound); - } -} - -//================================================================================================== -void FeaturesPlugin_Tools::loadDeletedShapes( - std::vector& theResultBaseAlgoList, - const ListOfShape& theTools, - const GeomShapePtr theResultShapesCompound) -{ - for (std::vector::iterator anIt = theResultBaseAlgoList.begin(); - anIt != theResultBaseAlgoList.end(); - ++anIt) - { - ResultBaseAlgo& aRCA = *anIt; - loadDeletedShapes(aRCA.resultBody, - aRCA.baseShape, - theTools, - aRCA.makeShape, - theResultShapesCompound); - } -} - //================================================================================================== bool FeaturesPlugin_Tools::getShape(const AttributeSelectionListPtr theSelectionList, const bool theShareTopology, diff --git a/src/FeaturesPlugin/FeaturesPlugin_Tools.h b/src/FeaturesPlugin/FeaturesPlugin_Tools.h index c9a138a37..92cfe2f47 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Tools.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Tools.h @@ -28,36 +28,6 @@ class FeaturesPlugin_Tools { public: - struct ResultBaseAlgo { - ResultBodyPtr resultBody; - GeomShapePtr baseShape; - GeomMakeShapePtr makeShape; - }; - -public: - static void loadModifiedShapes(ResultBodyPtr theResultBody, - const ListOfShape& theBaseShapes, - const ListOfShape& theTools, - const GeomMakeShapePtr& theMakeShape, - const GeomShapePtr theResultShape, - const std::string& theNamePrefix = ""); - - static void loadModifiedShapes(ResultBodyPtr theResultBody, - const GeomShapePtr& theBaseShape, - const GeomMakeShapePtr& theMakeShape, - const std::string theName); - /// Stores deleted shapes. - static void loadDeletedShapes(ResultBodyPtr theResultBody, - const GeomShapePtr theBaseShape, - const ListOfShape& theTools, - const GeomMakeShapePtr& theMakeShape, - const GeomShapePtr theResultShapesCompound); - - /// Stores deleted shapes. - static void loadDeletedShapes(std::vector& theResultBaseAlgoList, - const ListOfShape& theTools, - const GeomShapePtr theResultShapesCompound); - /// Obtain shapes from the selection list attribute. static bool getShape(const std::shared_ptr theSelectionList, const bool theShareTopology, diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index 11a0dca22..ca8039765 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -239,8 +240,8 @@ void FeaturesPlugin_Translation::performTranslation(const GeomTrsfPtr& theTrsf) for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { //LoadNamingDS ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), - aMakeShapeList, *anIt, "Translated"); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(), + aMakeShapeList, *anIt, "Translated"); aResultBody->setTextureFile(theTextureFile); setResult(aResultBody, aResultIndex++); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index ad7a638de..8120f025d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -62,7 +62,7 @@ void FeaturesPlugin_Union::execute() std::string anError; int aResultIndex = 0; - std::vector aResultBaseAlgoList; + std::vector aResultBaseAlgoList; ListOfShape aResultShapesList; GeomShapePtr aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(ListOfShape()); @@ -93,7 +93,7 @@ void FeaturesPlugin_Union::execute() } std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); - for (std::vector::iterator + for (std::vector::iterator aRBAIt = aResultBaseAlgoList.begin(); aRBAIt != aResultBaseAlgoList.end(); ++aRBAIt) { aMakeShapeList->appendAlgo(aRBAIt->makeShape); diff --git a/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.cpp index 50dd45bcb..d2fe447f3 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.cpp @@ -123,7 +123,7 @@ bool FeaturesPlugin_VersionedBoolean::processObject( const ListOfShape& theTools, const ListOfShape& thePlanes, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResultCompound) { @@ -187,7 +187,7 @@ bool FeaturesPlugin_VersionedBoolean::processObject( ListOfShape aUsedTools = theTools; aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end()); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, + ModelAPI_Tools::loadModifiedShapes(aResultBody, aListWithObject, aUsedTools, aMakeShapeList, @@ -197,7 +197,7 @@ bool FeaturesPlugin_VersionedBoolean::processObject( } - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = theObject; aRBA.makeShape = aMakeShapeList; @@ -215,7 +215,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompsolid( const ListOfShape& theTools, const ListOfShape& thePlanes, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResultCompound) { @@ -283,7 +283,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompsolid( ListOfShape aUsedTools = theTools; aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end()); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, + ModelAPI_Tools::loadModifiedShapes(aResultBody, aCompSolidList, aUsedTools, aMakeShapeList, @@ -292,7 +292,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompsolid( ++theResultIndex; } - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = theCompsolid; aRBA.makeShape = aMakeShapeList; @@ -309,7 +309,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompound( const GeomShapePtr& theCompound, const ListOfShape& theTools, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResultCompound) { @@ -372,7 +372,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompound( ListOfShape aCompoundList; aCompoundList.push_back(theCompound); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, + ModelAPI_Tools::loadModifiedShapes(aResultBody, aCompoundList, theTools, aMakeShapeList, @@ -381,7 +381,7 @@ bool FeaturesPlugin_VersionedBoolean::processCompound( ++theResultIndex; } - FeaturesPlugin_Tools::ResultBaseAlgo aRBA; + ModelAPI_Tools::ResultBaseAlgo aRBA; aRBA.resultBody = aResultBody; aRBA.baseShape = theCompound; aRBA.makeShape = aMakeShapeList; diff --git a/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.h index f244542b9..62fecd361 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.h @@ -27,6 +27,7 @@ #include #include +#include class ModelAPI_Attribute; class ModelAPI_Result; @@ -70,7 +71,7 @@ protected: const ListOfShape& theTools, const ListOfShape& thePlanes, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResulCompound = GeomShapePtr()); @@ -84,7 +85,7 @@ protected: const ListOfShape& theTools, const ListOfShape& thePlanes, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResulCompound = GeomShapePtr()); @@ -97,7 +98,7 @@ protected: const GeomShapePtr& theCompound, const ListOfShape& theTools, int& theResultIndex, - std::vector& theResultBaseAlgoList, + std::vector& theResultBaseAlgoList, ListOfShape& theResultShapesList, GeomShapePtr theResulCompound = GeomShapePtr()); diff --git a/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp b/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp index 7417bf570..0239b2221 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp @@ -18,7 +18,6 @@ // #include "FeaturesPlugin_VersionedChFi.h" -#include "FeaturesPlugin_Tools.h" #include #include @@ -89,8 +88,8 @@ void FeaturesPlugin_VersionedChFi::execute() anObjectHierarchy.topLevelObjects(aTopLevel); for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalSolids, ListOfShape(), - aMakeShapeList, *anIt, aPrefix); + ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalSolids, ListOfShape(), + aMakeShapeList, *anIt, aPrefix); setResult(aResultBody, aResultIndex++); for (ListOfShape::iterator aEIt = anEdges.begin(); aEIt != anEdges.end(); ++aEIt) { @@ -99,8 +98,8 @@ void FeaturesPlugin_VersionedChFi::execute() aResultBody->loadGeneratedShapes(aMakeShapeList, aBase, GeomAPI_Shape::EDGE, aPrefix, true); } - FeaturesPlugin_Tools::loadDeletedShapes(aResultBody, GeomShapePtr(), anOriginalSolids, - aMakeShapeList, *anIt); + ModelAPI_Tools::loadDeletedShapes(aResultBody, GeomShapePtr(), anOriginalSolids, + aMakeShapeList, *anIt); } removeResults(aResultIndex); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h index c8b558e37..f928eedda 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h @@ -149,15 +149,15 @@ public: protected: /// \brief Sets builder type. /// \param[in] theBuilderType new builder type. - void setBuilderType(const BuilderType theBuilderType); + GEOMALGOAPI_EXPORT void setBuilderType(const BuilderType theBuilderType); /// \brief Sets status of builder. /// \param[in] theFlag new status. - void setDone(const bool theFlag); + GEOMALGOAPI_EXPORT void setDone(const bool theFlag); /// \brief Sets result shape. /// \param[in] theShape new shape. - void setShape(const GeomShapePtr theShape); + GEOMALGOAPI_EXPORT void setShape(const GeomShapePtr theShape); /// \return true if passed shape is valid for history. bool isValidForHistory(const GeomShapePtr theShape); diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index f78af49b8..5db4588bb 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -197,6 +198,125 @@ ObjectPtr objectByName(const DocumentPtr& theDocument, const std::string& theGro return ObjectPtr(); } +//================================================================================================== +void loadModifiedShapes(ResultBodyPtr theResultBody, + const ListOfShape& theBaseShapes, + const ListOfShape& theTools, + const GeomMakeShapePtr& theMakeShape, + const GeomShapePtr theResultShape, + const std::string& theNamePrefix) +{ + theResultBody->storeModified(theBaseShapes, theResultShape, theMakeShape); + + ListOfShape aShapes = theBaseShapes; + ListOfShape::const_iterator aToolIter = theTools.cbegin(); + for (; aToolIter != theTools.cend(); aToolIter++) + aShapes.push_back(*aToolIter); + + for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); ++anIter) + { + theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::VERTEX, theNamePrefix); + theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::EDGE, theNamePrefix); + theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE, theNamePrefix); + } +} + +//================================================================================================== +void loadModifiedShapes(ResultBodyPtr theResultBody, + const GeomShapePtr& theBaseShape, + const GeomMakeShapePtr& theMakeShape, + const std::string theName) +{ + switch (theBaseShape->shapeType()) { + case GeomAPI_Shape::COMPOUND: { + for (GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next()) + { + loadModifiedShapes(theResultBody, + anIt.current(), + theMakeShape, + theName); + } + break; + } + case GeomAPI_Shape::COMPSOLID: + case GeomAPI_Shape::SOLID: + case GeomAPI_Shape::SHELL: { + theResultBody->loadModifiedShapes(theMakeShape, + theBaseShape, + GeomAPI_Shape::FACE, + theName); + } + case GeomAPI_Shape::FACE: + case GeomAPI_Shape::WIRE: { + theResultBody->loadModifiedShapes(theMakeShape, + theBaseShape, + GeomAPI_Shape::EDGE, + theName); + } + case GeomAPI_Shape::EDGE: { + theResultBody->loadModifiedShapes(theMakeShape, + theBaseShape, + GeomAPI_Shape::VERTEX, + theName); + } + default: // [to avoid compilation warning] + break; + } +} + +//================================================================================================== +void loadDeletedShapes(ResultBodyPtr theResultBody, + const GeomShapePtr theBaseShape, + const ListOfShape& theTools, + const GeomMakeShapePtr& theMakeShape, + const GeomShapePtr theResultShapesCompound) +{ + ListOfShape aShapes = theTools; + if (theBaseShape.get()) + aShapes.push_front(theBaseShape); + + for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); anIter++) + { + theResultBody->loadDeletedShapes(theMakeShape, + *anIter, + GeomAPI_Shape::VERTEX, + theResultShapesCompound); + theResultBody->loadDeletedShapes(theMakeShape, + *anIter, + GeomAPI_Shape::EDGE, + theResultShapesCompound); + theResultBody->loadDeletedShapes(theMakeShape, + *anIter, + GeomAPI_Shape::FACE, + theResultShapesCompound); + // store information about deleted solids because of unittest TestBooleanCommon_SolidsHistory + // on OCCT 7.4.0 : common produces modified compsolid, so, move to the end for removed solids + // starts to produce whole compsolid + theResultBody->loadDeletedShapes(theMakeShape, + *anIter, + GeomAPI_Shape::SOLID, + theResultShapesCompound); + } +} + +//================================================================================================== +void loadDeletedShapes(std::vector& theResultBaseAlgoList, + const ListOfShape& theTools, + const GeomShapePtr theResultShapesCompound) +{ + for (std::vector::iterator anIt = theResultBaseAlgoList.begin(); + anIt != theResultBaseAlgoList.end(); + ++anIt) + { + ResultBaseAlgo& aRCA = *anIt; + loadDeletedShapes(aRCA.resultBody, + aRCA.baseShape, + theTools, + aRCA.makeShape, + theResultShapesCompound); + } +} + bool findVariable(const DocumentPtr& theDocument, FeaturePtr theSearcher, const std::wstring& theName, double& outValue, ResultParameterPtr& theParam) { diff --git a/src/ModelAPI/ModelAPI_Tools.h b/src/ModelAPI/ModelAPI_Tools.h index 79d4f4a8b..29f655484 100644 --- a/src/ModelAPI/ModelAPI_Tools.h +++ b/src/ModelAPI/ModelAPI_Tools.h @@ -29,6 +29,7 @@ class ModelAPI_Result; class ModelAPI_ResultParameter; class ModelAPI_ResultBody; +class GeomAlgoAPI_MakeShape; class GeomAPI_Shape; class GeomAPI_ShapeHierarchy; @@ -49,6 +50,35 @@ MODELAPI_EXPORT std::shared_ptr shape( */ MODELAPI_EXPORT std::string getFeatureError(const std::shared_ptr& theFeature); +MODELAPI_EXPORT struct ResultBaseAlgo { + std::shared_ptr resultBody; + std::shared_ptr baseShape; + std::shared_ptr makeShape; +}; + +MODELAPI_EXPORT void loadModifiedShapes(std::shared_ptr theResultBody, + const std::list>& theBaseShapes, + const std::list>& theTools, + const std::shared_ptr& theMakeShape, + const std::shared_ptr theResultShape, + const std::string& theNamePrefix = ""); + +MODELAPI_EXPORT void loadModifiedShapes(std::shared_ptr theResultBody, + const std::shared_ptr& theBaseShape, + const std::shared_ptr& theMakeShape, + const std::string theName); +/// Stores deleted shapes. +MODELAPI_EXPORT void loadDeletedShapes(std::shared_ptr theResultBody, + const std::shared_ptr theBaseShape, + const std::list>& theTools, + const std::shared_ptr& theMakeShape, + const std::shared_ptr theResultShapesCompound); + +/// Stores deleted shapes. +MODELAPI_EXPORT void loadDeletedShapes(std::vector& theResultBaseAlgoList, + const std::list>& theTools, + const std::shared_ptr theResultShapesCompound); + /*! * Searches for variable with name \param theName in \param theDocument. * If found, set it value in the \param outValue and returns true. -- 2.39.2