-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "FeaturesPlugin_Boolean.h"
#include <ModelAPI_Tools.h>
#include <GeomAlgoAPI_Boolean.h>
+#include <GeomAlgoAPI_CompoundBuilder.h>
#include <GeomAlgoAPI_MakeShapeCustom.h>
#include <GeomAlgoAPI_MakeShapeList.h>
#include <GeomAlgoAPI_Partition.h>
#include <GeomAlgoAPI_PaveFiller.h>
+#include <GeomAlgoAPI_ShapeBuilder.h>
#include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
#include <GeomAPI_Face.h>
#include <GeomAPI_ShapeExplorer.h>
#include <GeomAPI_ShapeIterator.h>
theResultBody->loadDeletedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE);
}
}
+
+//=================================================================================================
+void FeaturesPlugin_Boolean::storeResult(
+ const ListOfShape& theObjects,
+ const ListOfShape& theTools,
+ const GeomShapePtr theResultShape,
+ int& theResultIndex,
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList,
+ std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList)
+{
+ if (!theResultShape)
+ return;
+
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), theResultIndex);
+
+ FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+ theObjects,
+ theTools,
+ theMakeShapeList,
+ theResultShape);
+ setResult(aResultBody, theResultIndex++);
+
+ // merge algorithms
+ FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+ aRBA.resultBody = aResultBody;
+ aRBA.baseShape = theObjects.front();
+ for (std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>::iterator
+ aRBAIt = theResultBaseAlgoList.begin();
+ aRBAIt != theResultBaseAlgoList.end(); ++aRBAIt) {
+ theMakeShapeList->appendAlgo(aRBAIt->makeShape);
+ }
+ aRBA.makeShape = theMakeShapeList;
+ theResultBaseAlgoList.clear();
+ theResultBaseAlgoList.push_back(aRBA);
+}