-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <algorithm>
#include <map>
+
+//=================================================================================================
static void performBoolean(const GeomAlgoAPI_Tools::BOPType theBooleanType,
GeomMakeShapePtr& theBooleanAlgo,
const ListOfShape& theObjects,
- const ListOfShape& theTools)
+ const ListOfShape& theTools,
+ const double theFuzzy)
{
if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
theBooleanAlgo.reset(new GeomAlgoAPI_Partition(theObjects, theTools));
ListOfShape anObjects = theObjects;
ListOfShape aTools;
aTools.splice(aTools.begin(), anObjects, anObjects.begin());
- theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(anObjects, aTools, theBooleanType));
+ theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(anObjects, aTools, theBooleanType, theFuzzy));
}
}
else
- theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(theObjects, theTools, theBooleanType));
+ theBooleanAlgo.reset(new GeomAlgoAPI_Boolean(theObjects, theTools, theBooleanType, theFuzzy));
}
}
const GeomShapePtr& theObject,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
- std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+ std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
GeomShapePtr theResultCompound)
{
aToolsWithPlanes.insert(aToolsWithPlanes.end(), aPlanesCopy.begin(), aPlanesCopy.end());
if (theBooleanType == GeomAlgoAPI_Tools::BOOL_PARTITION)
- aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes));
+ aBoolAlgo.reset(new GeomAlgoAPI_Partition(aListWithObject, aToolsWithPlanes, theFuzzy));
else
aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
aToolsWithPlanes,
- theBooleanType));
+ theBooleanType,
+ theFuzzy));
// Checking that the algorithm worked properly.
std::string anError;
ListOfShape aUsedTools = theTools;
aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end());
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+ ModelAPI_Tools::loadModifiedShapes(aResultBody,
aListWithObject,
aUsedTools,
aMakeShapeList,
}
- FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+ ModelAPI_Tools::ResultBaseAlgo aRBA;
aRBA.resultBody = aResultBody;
aRBA.baseShape = theObject;
aRBA.makeShape = aMakeShapeList;
const GeomShapePtr& theCompsolid,
const ListOfShape& theTools,
const ListOfShape& thePlanes,
+ const double theFuzzy,
int& theResultIndex,
- std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+ std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
GeomShapePtr theResultCompound)
{
aToolsWithPlanes.insert(aToolsWithPlanes.end(), aPlanesCopy.begin(), aPlanesCopy.end());
std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
- performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationSolids, aToolsWithPlanes);
+ performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationSolids, aToolsWithPlanes, theFuzzy);
// Checking that the algorithm worked properly.
std::string anError;
ListOfShape aShapesToAdd = aNotUsedSolids;
aShapesToAdd.push_back(aBoolAlgo->shape());
std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
- new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true, theFuzzy));
if (!aFillerAlgo->isDone()) {
std::string aFeatureError = "Error: PaveFiller algorithm failed.";
setError(aFeatureError);
ListOfShape aUsedTools = theTools;
aUsedTools.insert(aUsedTools.end(), thePlanes.begin(), thePlanes.end());
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+ ModelAPI_Tools::loadModifiedShapes(aResultBody,
aCompSolidList,
aUsedTools,
aMakeShapeList,
++theResultIndex;
}
- FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+ ModelAPI_Tools::ResultBaseAlgo aRBA;
aRBA.resultBody = aResultBody;
aRBA.baseShape = theCompsolid;
aRBA.makeShape = aMakeShapeList;
GeomAPI_ShapeHierarchy& theCompoundHierarchy,
const GeomShapePtr& theCompound,
const ListOfShape& theTools,
+ const double theFuzzy,
int& theResultIndex,
- std::vector<FeaturesPlugin_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
+ std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList,
ListOfShape& theResultShapesList,
GeomShapePtr theResultCompound)
{
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
- performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationShapes, theTools);
+ performBoolean(theBooleanType, aBoolAlgo, aUsedInOperationShapes, theTools, theFuzzy);
// Checking that the algorithm worked properly.
std::string anError;
ListOfShape aCompoundList;
aCompoundList.push_back(theCompound);
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody,
+ ModelAPI_Tools::loadModifiedShapes(aResultBody,
aCompoundList,
theTools,
aMakeShapeList,
++theResultIndex;
}
- FeaturesPlugin_Tools::ResultBaseAlgo aRBA;
+ ModelAPI_Tools::ResultBaseAlgo aRBA;
aRBA.resultBody = aResultBody;
aRBA.baseShape = theCompound;
aRBA.makeShape = aMakeShapeList;