]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Naming functions were from FeaturesPlugin_Tools to ModelAPI_Tools
authorAlexey SOZINOV <alexey.sozinov.ext@opencascade.com>
Fri, 29 Jan 2021 18:11:00 +0000 (21:11 +0300)
committerazv <azv@opencascade.com>
Tue, 28 Dec 2021 19:25:00 +0000 (22:25 +0300)
28 files changed:
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.h
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanCut.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanFill.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp
src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp
src/FeaturesPlugin/FeaturesPlugin_Defeaturing.cpp
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Fillet1D.cpp
src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp
src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp
src/FeaturesPlugin/FeaturesPlugin_Scale.cpp
src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp
src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
src/FeaturesPlugin/FeaturesPlugin_Tools.h
src/FeaturesPlugin/FeaturesPlugin_Translation.cpp
src/FeaturesPlugin/FeaturesPlugin_Union.cpp
src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.cpp
src/FeaturesPlugin/FeaturesPlugin_VersionedBoolean.h
src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h
src/ModelAPI/ModelAPI_Tools.cpp
src/ModelAPI/ModelAPI_Tools.h

index ed051dc00015ad7034cbe7fe24cce215e82c4df5..e10cc331c831916fdbe6ba2fc1931a8dec5b675c 100644 (file)
@@ -111,7 +111,7 @@ void FeaturesPlugin_Boolean::storeResult(
     const GeomShapePtr theResultShape,
     int& theResultIndex,
     std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList,
-    std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList)
+    std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList)
 {
   if (!theResultShape)
     return;
@@ -119,7 +119,7 @@ void FeaturesPlugin_Boolean::storeResult(
   std::shared_ptr<ModelAPI_ResultBody> 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<FeaturesPlugin_Tools::ResultBaseAlgo>::iterator
+  for (std::vector<ModelAPI_Tools::ResultBaseAlgo>::iterator
        aRBAIt = theResultBaseAlgoList.begin();
        aRBAIt != theResultBaseAlgoList.end(); ++aRBAIt) {
     theMakeShapeList->appendAlgo(aRBAIt->makeShape);
index f6bf522665117ede34710d71038165f30819739f..3a8986a246f57a9bf266131877f6d10a3278b6bd 100644 (file)
@@ -75,7 +75,7 @@ protected:
                    const GeomShapePtr theResultShape,
                    int& theResultIndex,
                    std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList,
-                   std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList);
+                   std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList);
 
 private:
   OperationType myOperationType;
index 085107edb431bd23ece7571978a4b23b0d632188..60b3581b37a6cb6096f35a0e29c70faaa2756680 100644 (file)
@@ -94,7 +94,7 @@ void FeaturesPlugin_BooleanCommon::execute()
 
   std::string anError;
   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
-  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<ModelAPI_Tools::ResultBaseAlgo> 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);
 
index f24d6f78bb7d322edfbe041f6256b3b4806b23ff..fe831bec36bf650739bebd7b3874ebccfb349439 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "FeaturesPlugin_BooleanCut.h"
 
-#include "FeaturesPlugin_Tools.h"
-
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -67,7 +65,7 @@ void FeaturesPlugin_BooleanCut::execute()
     return;
   }
 
-  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<ModelAPI_Tools::ResultBaseAlgo> 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);
 
index de0c313baa9bf5c62ddb8a4043b67d9dcc854413..cbab08a645a056ba516c868be9597e6f996c0c73 100644 (file)
@@ -18,7 +18,6 @@
 //
 
 #include "FeaturesPlugin_BooleanFill.h"
-#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
@@ -78,7 +77,7 @@ void FeaturesPlugin_BooleanFill::execute()
     return;
   }
 
-  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<ModelAPI_Tools::ResultBaseAlgo> aResultBaseAlgoList;
   ListOfShape aResultShapesList;
 
   std::shared_ptr<GeomAlgoAPI_MakeShapeList> 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);
 
index 1214bb2147d2c0ffdf712727fb27c44dc5e20313..dd7f59d685fffec09e5f6bf0577d961ef2406562 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "FeaturesPlugin_BooleanFuse.h"
 
-#include "FeaturesPlugin_Tools.h"
-
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_AttributeInteger.h>
@@ -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);
index 2eb3753cccdbad18049892826a866ba343f87438..f8336b240b22b06d604c52197c83c014f714bae4 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "FeaturesPlugin_BooleanSmash.h"
 
-#include "FeaturesPlugin_Tools.h"
-
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -175,20 +173,20 @@ void FeaturesPlugin_BooleanSmash::execute()
 
   std::shared_ptr<ModelAPI_ResultBody> 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);
index ac60462ce6316acef4cd59863d275629795eb745..47291b11d3eac772c39691b6e727babb306beac2 100644 (file)
@@ -18,7 +18,6 @@
 //
 
 #include <FeaturesPlugin_Defeaturing.h>
-#include <FeaturesPlugin_Tools.h>
 
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -72,7 +71,7 @@ void FeaturesPlugin_Defeaturing::execute()
   int aResultIndex = 0;
   std::string anError;
 
-  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<ModelAPI_Tools::ResultBaseAlgo> 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<ModelAPI_ResultBody> 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);
index aa95790a54b023b4933f02153e0aaeb567288a9c..436462796606444f0f464522f301f0153fbc27f0 100644 (file)
 //
 
 #include "FeaturesPlugin_Extrusion.h"
-#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAlgoAPI_Prism.h>
 #include <GeomAlgoAPI_Tools.h>
@@ -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);
index b3b4b8493e54a56a7c55f10c48dc3188a0c89bbd..e1145fb52bb79fd1149f47b78c2dc9c7ef8416d5 100644 (file)
@@ -18,7 +18,6 @@
 //
 
 #include <FeaturesPlugin_Fillet1D.h>
-#include <FeaturesPlugin_Tools.h>
 
 #include <GeomAlgoAPI_Fillet1D.h>
 #include <GeomAlgoAPI_MapShapesAndAncestors.h>
@@ -33,6 +32,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Events.h>
+#include <ModelAPI_Tools.h>
 
 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)
index 1ded92cbecf35142b7e4d72a88e5446e08829143..b01ab3a49117620027b28caf325056810610c3f8 100644 (file)
@@ -18,7 +18,6 @@
 //
 
 #include "FeaturesPlugin_FusionFaces.h"
-#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeString.h>
@@ -26,6 +25,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAPI_ShapeIterator.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -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);
 }
index aa95218e08e118772d62fac93e579602d6afd92f..4a2c31715024abc290416df69d80a357a58217ba 100644 (file)
@@ -24,6 +24,7 @@
 #include <ModelAPI_BodyBuilder.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAlgoAPI_Intersection.h>
 #include <GeomAlgoAPI_MakeShapeList.h>
@@ -84,19 +85,19 @@ void FeaturesPlugin_Intersection::execute()
   }
 
   std::shared_ptr<ModelAPI_ResultBody> 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);
index e8caba9bff97b72d8fc5eb6ae156b7874e4c7907..adb0c81f0b97ba739e3d53aa5f203c63043139c7 100644 (file)
@@ -44,6 +44,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 #include <math.h>
 #include <iostream>
@@ -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++);
   }
index c507c7d501a8514e3774601123d6948bd7797101..637fcfa31904ed3ff378e1c2f113f4ac2c5f4e6e 100644 (file)
@@ -37,6 +37,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 #include <math.h>
 
@@ -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++);
   }
index efc09092acf21eee33242bd10659d3541a7c11ae..7a21c667a38a5e1ddc6792734ef6db1a7df68b4c 100644 (file)
@@ -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++);
   }
index 1fe9334eb920d96d20141daa984895f1880b8597..144e57ef23e9a5b8fc389f6a3ff9d6855f78c44a 100644 (file)
@@ -24,6 +24,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAlgoAPI_MakeShapeList.h>
 #include <GeomAlgoAPI_PointBuilder.h>
@@ -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++);
   }
index 73cbd10bcb5cae7869880abcacd36228723c3d13..6c92629c8d09df873234d844fc71f4a791291c66 100644 (file)
@@ -32,6 +32,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 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++);
   }
index e877c4016b7f709a7db6a82c3cd2cacfd2b0f57a..d007306fcff36dd4b16670945f5039ba6c788168 100644 (file)
@@ -41,6 +41,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 #include <FeaturesPlugin_Tools.h>
 
@@ -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++);
 }
index 9a36609a4e5d6c07188af5c03bd88270d749f566..a6dc9169fed7462c4eea49cbf2b24425ddab0ae9 100644 (file)
 
 #include <GeomValidators_ShapeType.h>
 
-//==================================================================================================
-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<ResultBaseAlgo>& theResultBaseAlgoList,
-  const ListOfShape& theTools,
-  const GeomShapePtr theResultShapesCompound)
-{
-  for (std::vector<ResultBaseAlgo>::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,
index c9a138a37d53f2d67a8d8649e0957cdd801d09b6..92cfe2f47e811dae19f97836aa9e737ba7308241 100644 (file)
 
 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<ResultBaseAlgo>& theResultBaseAlgoList,
-                                const ListOfShape& theTools,
-                                const GeomShapePtr theResultShapesCompound);
-
   /// Obtain shapes from the selection list attribute.
   static bool getShape(const std::shared_ptr<ModelAPI_AttributeSelectionList> theSelectionList,
                        const bool theShareTopology,
index 11a0dca227d1fd8d0981685f7ffba80578603d4d..ca8039765473a21a2035af356ffbd2a69bbfa3cf 100644 (file)
@@ -26,6 +26,7 @@
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
 #include <ModelAPI_Session.h>
+#include <ModelAPI_Tools.h>
 
 #include <GeomAPI_Ax1.h>
 #include <GeomAPI_Edge.h>
@@ -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++);
   }
index ad7a638de10fa2e6effa1ff9bb2e8f63a78fbc58..8120f025dbb4a4176e7820d6355daec0055dea31 100644 (file)
@@ -62,7 +62,7 @@ void FeaturesPlugin_Union::execute()
 
   std::string anError;
   int aResultIndex = 0;
-  std::vector<FeaturesPlugin_Tools::ResultBaseAlgo> aResultBaseAlgoList;
+  std::vector<ModelAPI_Tools::ResultBaseAlgo> aResultBaseAlgoList;
   ListOfShape aResultShapesList;
 
   GeomShapePtr aResultCompound = GeomAlgoAPI_CompoundBuilder::compound(ListOfShape());
@@ -93,7 +93,7 @@ void FeaturesPlugin_Union::execute()
   }
 
   std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
-  for (std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>::iterator
+  for (std::vector<ModelAPI_Tools::ResultBaseAlgo>::iterator
        aRBAIt = aResultBaseAlgoList.begin();
        aRBAIt != aResultBaseAlgoList.end(); ++aRBAIt) {
     aMakeShapeList->appendAlgo(aRBAIt->makeShape);
index 50dd45bcbcc5a26f4fdc4a123bbd7af1f98dd4c1..d2fe447f336e40d9477c5c830b4a84cb61f2db24 100644 (file)
@@ -123,7 +123,7 @@ bool FeaturesPlugin_VersionedBoolean::processObject(
     const ListOfShape& theTools,
     const ListOfShape& thePlanes,
     int& theResultIndex,
-    std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+    std::vector<ModelAPI_Tools::ResultBaseAlgo>& 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<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+    std::vector<ModelAPI_Tools::ResultBaseAlgo>& 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<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+    std::vector<ModelAPI_Tools::ResultBaseAlgo>& 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;
index f244542b9200a0142eb11735abf10a425cbb5090..62fecd361af3ec187f92bb2802fd66cf004fd018 100644 (file)
@@ -27,6 +27,7 @@
 #include <GeomAlgoAPI_Tools.h>
 
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_Tools.h>
 
 class ModelAPI_Attribute;
 class ModelAPI_Result;
@@ -70,7 +71,7 @@ protected:
                      const ListOfShape& theTools,
                      const ListOfShape& thePlanes,
                      int& theResultIndex,
-                     std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+                     std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
                      ListOfShape& theResultShapesList,
                      GeomShapePtr theResulCompound = GeomShapePtr());
 
@@ -84,7 +85,7 @@ protected:
                         const ListOfShape& theTools,
                         const ListOfShape& thePlanes,
                         int& theResultIndex,
-                        std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+                        std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
                         ListOfShape& theResultShapesList,
                         GeomShapePtr theResulCompound = GeomShapePtr());
 
@@ -97,7 +98,7 @@ protected:
                        const GeomShapePtr& theCompound,
                        const ListOfShape& theTools,
                        int& theResultIndex,
-                       std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+                       std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
                        ListOfShape& theResultShapesList,
                        GeomShapePtr theResulCompound = GeomShapePtr());
 
index 7417bf570c64986fbd01f2722bb007217c0b8fa4..0239b2221ad1863d1b1fc3339dc903f420211965 100644 (file)
@@ -18,7 +18,6 @@
 //
 
 #include "FeaturesPlugin_VersionedChFi.h"
-#include "FeaturesPlugin_Tools.h"
 
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Tools.h>
@@ -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);
index c8b558e375705d666043ae49df1cb9bae4929984..f928eedda2c0dcdc0889473c57dcf9000ba442bb 100644 (file)
@@ -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);
index f78af49b85c0662f91547e2c0f48426ea0ec6c29..5db4588bbc9c4f8bed20a6cb8b81cf701567d112 100644 (file)
@@ -39,6 +39,7 @@
 #include <Events_Loop.h>
 #include <Locale_Convert.h>
 
+#include <GeomAlgoAPI_MakeShape.h>
 #include <GeomAPI_ShapeHierarchy.h>
 #include <GeomAPI_ShapeIterator.h>
 
@@ -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<ResultBaseAlgo>& theResultBaseAlgoList,
+                        const ListOfShape& theTools,
+                        const GeomShapePtr theResultShapesCompound)
+{
+  for (std::vector<ResultBaseAlgo>::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)
 {
index 79d4f4a8b65d3909761cf3e031ff65bfcec5d1aa..29f6554845cfe8a9b6bda6dea97a4756d95992d2 100644 (file)
@@ -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<GeomAPI_Shape> shape(
  */
 MODELAPI_EXPORT std::string getFeatureError(const std::shared_ptr<ModelAPI_Feature>& theFeature);
 
+MODELAPI_EXPORT struct ResultBaseAlgo {
+  std::shared_ptr<ModelAPI_ResultBody> resultBody;
+  std::shared_ptr<GeomAPI_Shape> baseShape;
+  std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape;
+};
+
+MODELAPI_EXPORT void loadModifiedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+  const std::list<std::shared_ptr<GeomAPI_Shape>>& theBaseShapes,
+  const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
+  const std::shared_ptr<GeomAPI_Shape> theResultShape,
+  const std::string& theNamePrefix = "");
+
+MODELAPI_EXPORT void loadModifiedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+  const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
+  const std::string theName);
+/// Stores deleted shapes.
+MODELAPI_EXPORT void loadDeletedShapes(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+  const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+  const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
+  const std::shared_ptr<GeomAPI_Shape> theResultShapesCompound);
+
+/// Stores deleted shapes.
+MODELAPI_EXPORT void loadDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
+  const std::list<std::shared_ptr<GeomAPI_Shape>>& theTools,
+  const std::shared_ptr<GeomAPI_Shape> theResultShapesCompound);
+
 /*!
  * Searches for variable with name \param theName in \param theDocument.
  * If found, set it value in the \param outValue and returns true.