#include <GeomAPI_Trsf.h>
#include <GeomAlgoAPI_PointBuilder.h>
+#include <GeomAlgoAPI_Tools.h>
#include <FeaturesPlugin_Tools.h>
double aDistance = real(FeaturesPlugin_Translation::DISTANCE_ID())->value();
// Moving each object.
+ std::string anError;
int aResultIndex = 0;
std::list<ResultPtr>::iterator aContext = aContextes.begin();
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
aTranslationAlgo->build();
// Checking that the algorithm worked properly.
- if(!aTranslationAlgo->isDone()) {
- static const std::string aFeatureError = "Error: Translation algorithm failed.";
- setError(aFeatureError);
- break;
- }
- if(aTranslationAlgo->shape()->isNull()) {
- static const std::string aShapeError = "Error: Resulting shape is Null.";
- setError(aShapeError);
- break;
- }
- if(!aTranslationAlgo->isValid()) {
- std::string aFeatureError = "Error: Resulting shape is not valid.";
- setError(aFeatureError);
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+ setError(anError);
break;
}
double aDZ = real(FeaturesPlugin_Translation::DZ_ID())->value();
// Moving each object.
+ std::string anError;
int aResultIndex = 0;
std::list<ResultPtr>::iterator aContext = aContextes.begin();
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
aTranslationAlgo->build();
// Checking that the algorithm worked properly.
- if(!aTranslationAlgo->isDone()) {
- static const std::string aFeatureError = "Error: Translation algorithm failed.";
- setError(aFeatureError);
- break;
- }
- if(aTranslationAlgo->shape()->isNull()) {
- static const std::string aShapeError = "Error: Resulting shape is Null.";
- setError(aShapeError);
- break;
- }
- if(!aTranslationAlgo->isValid()) {
- std::string aFeatureError = "Error: Resulting shape is not valid.";
- setError(aFeatureError);
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+ setError(anError);
break;
}
}
// Moving each object.
+ std::string anError;
int aResultIndex = 0;
std::list<ResultPtr>::iterator aContext = aContextes.begin();
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
aTranslationAlgo->build();
// Checking that the algorithm worked properly.
- if(!aTranslationAlgo->isDone()) {
- static const std::string aFeatureError = "Error: Translation algorithm failed.";
- setError(aFeatureError);
- break;
- }
- if(aTranslationAlgo->shape()->isNull()) {
- static const std::string aShapeError = "Error: Resulting shape is Null.";
- setError(aShapeError);
- break;
- }
- if(!aTranslationAlgo->isValid()) {
- std::string aFeatureError = "Error: Resulting shape is not valid.";
- setError(aFeatureError);
+ if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgo, getKind(), anError)) {
+ setError(anError);
break;
}