SHAPER  9.12.0
Model_FeatureValidator Class Reference

The geneneric validator for the whole feature. More...

Inheritance diagram for Model_FeatureValidator:
Inheritance graph

Public Member Functions

virtual MODEL_EXPORT bool isValid (const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
 Returns true if feature and/or attributes are valid. More...
 
virtual void registerNotObligatory (std::string theFeature, std::string theAttribute)
 sets not obligatory attributes, not checked for initialization More...
 
virtual bool isNotObligatory (std::string theFeature, std::string theAttribute)
 Returns true if the attribute in feature is not obligatory for the feature execution. More...
 

Detailed Description

The geneneric validator for the whole feature.

Can be redefined for some specific feature, but by default for each feature this validator is used: it checks each argument of the feature and if one of it is not valid (and obligatory), the hole feature is invalid.

Member Function Documentation

◆ isValid()

bool Model_FeatureValidator::isValid ( const std::shared_ptr< ModelAPI_Feature > &  theFeature,
const std::list< std::string > &  theArguments,
Events_InfoMessage theError 
) const
virtual

Returns true if feature and/or attributes are valid.

Parameters
theFeaturethe validated feature
theArgumentsthe arguments in the configuration file for this validator
theErrorerros message produced by validator to the user if it fails
Returns
true if feature is valid

Implements ModelAPI_FeatureValidator.

◆ registerNotObligatory()

void Model_FeatureValidator::registerNotObligatory ( std::string  theFeature,
std::string  theAttribute 
)
virtual

sets not obligatory attributes, not checked for initialization

◆ isNotObligatory()

bool Model_FeatureValidator::isNotObligatory ( std::string  theFeature,
std::string  theAttribute 
)
virtual

Returns true if the attribute in feature is not obligatory for the feature execution.

Reimplemented from ModelAPI_FeatureValidator.