#include <GeomAlgoAPI_MakeShapeList.h>
#include <GeomAlgoAPI_Partition.h>
#include <GeomAlgoAPI_ShapeTools.h>
+#include <GeomAlgoAPI_Tools.h>
#include <GeomAPI_Face.h>
#include <GeomAPI_ShapeExplorer.h>
std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
std::string& theError);
-static bool isAlgoFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
- std::string& theError);
-
//=================================================================================================
FeaturesPlugin_Partition::FeaturesPlugin_Partition()
new GeomAlgoAPI_Partition(aTargetObjects, aPlanes));
// Checking that the algorithm worked properly.
- if (isAlgoFailed(aPartitionAlgo, aError)) {
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPartitionAlgo, getKind(), aError)) {
setError(aError);
return;
}
aPartitionAlgo.reset(new GeomAlgoAPI_Partition(aTargetObjects, ListOfShape()));
// Checking that the algorithm worked properly.
- if (isAlgoFailed(aPartitionAlgo, aError)) {
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aPartitionAlgo, getKind(), aError)) {
setError(aError);
return;
}
// cut from current list of solids
aCutAlgo.reset(
new GeomAlgoAPI_Boolean(aUIt->second, theTools, GeomAlgoAPI_Boolean::BOOL_CUT));
- if (isAlgoFailed(aCutAlgo, theError))
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aCutAlgo, "", theError))
return false;
theMakeShapeList->appendAlgo(aCutAlgo);
return cutSubs(aFirstArgument, theObjects, aToolsForUsed, theMakeShapeList, theError)
&& cutSubs(aFirstArgument, theNotUsed, aToolsForUnused, theMakeShapeList, theError);
}
-
-bool isAlgoFailed(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo, std::string& theError)
-{
- if (!theAlgo->isDone()) {
- theError = "Error: Partition algorithm failed.";
- return true;
- }
- if (theAlgo->shape()->isNull()) {
- theError = "Error: Resulting shape is Null.";
- return true;
- }
- if (!theAlgo->isValid()) {
- theError = "Error: Resulting shape is not valid.";
- return true;
- }
-
- theError.clear();
- return false;
-}