//! \param theArguments arguments of the attribute
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
- std::string& theError = std::string()) const = 0;
+ std::string& theError) const = 0;
MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
};
/// \param theArguments list of string, feature attribute names: dependent attributes
virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<std::string>& theArguments,
- std::string& theError = std::string()) const = 0;
+ std::string& theError) const = 0;
/// Returns true if the attribute in feature is not obligatory for the feature execution
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute) = 0;
dynamic_cast<const GeomValidators_ShapeType*>(aFactory->validator("GeomValidators_ShapeType"));
std::list<std::string> anArguments;
anArguments.push_back("circle");
- bool aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments);
+ std::string aCircleError;
+ bool aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments, aCircleError);
// the circle line is not a valid case
if (aShapeValid)
return false;
anArguments.clear();
anArguments.push_back("line");
- aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments);
+ std::string aLineError;
+ aShapeValid = aShapeValidator->isValid(aRefAttr, anArguments, aLineError);
// if the attribute value is not a line, that means it is a vertex. A vertex is always valid
if (!aShapeValid)
return true;