//=================================================================================================
bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
if(theArguments.size() != 3) {
return false;
* \returns true if feature is valid.
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
bool GeomValidators_Different::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
std::map<std::string, std::list<AttributePtr> > anAttributesMap;
// For all attributes referred by theArguments
* \returns true if feature is valid.
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
};
//=================================================================================================
bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
if(theArguments.size() != 8) {
return false;
* \returns true if feature is valid.
*/
GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
/// \return true if the attribute in feature is not obligatory for the feature execution.
GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
#include <memory>
bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const
+ const std::list<std::string>& theArguments,
+ std::string& theError) const
{
static Model_ValidatorsFactory* aValidators =
static_cast<Model_ValidatorsFactory*>(ModelAPI_Session::get()->validators());
/// \param theArguments the arguments in the configuration file for this validator
/// \returns true if feature is valid
MODEL_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments) const;
+ const std::list<std::string>& theArguments,
+ std::string& theError) const;
/// sets not obligatory attributes, not checked for initialization
virtual void registerNotObligatory(std::string theFeature, std::string theAttribute);
/// \param theFeature the validated feature
/// \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) const = 0;
+ const std::list<std::string>& theArguments,
+ std::string& theError = std::string()) 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;