20 #ifndef ModelAPI_Validator_H_
21 #define ModelAPI_Validator_H_
24 #include <ModelAPI_Feature.h>
51 typedef std::shared_ptr<ModelAPI_Validator> ValidatorPtr;
74 virtual void assignValidator(
const std::string& theID,
const std::string& theFeatureID) = 0;
78 const std::string& theFeatureID,
79 const std::list<std::string>& theArguments) = 0;
82 virtual void assignValidator(
const std::string& theID,
const std::string& theFeatureID,
83 const std::string& theAttrID,
84 const std::list<std::string>& theArguments) = 0;
87 typedef std::list<std::pair<std::string, std::list<std::string> > >
Validators;
92 virtual void validators(
const std::string& theFeatureID,
const std::string& theAttrID,
99 virtual bool validate(
const std::shared_ptr<ModelAPI_Feature>& theFeature)
const = 0;
102 virtual bool validate(
const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
117 virtual bool isConcealed(std::string theFeature, std::string theAttribute) = 0;
123 virtual bool isMainArgument(std::string theFeature, std::string theAttribute) = 0;
126 virtual void registerCase(std::string theFeature, std::string theAttribute,
127 const std::list<std::pair<std::string, std::string> >& theCases) = 0;
130 virtual bool isCase(FeaturePtr theFeature, std::string theAttribute) = 0;
An event message for sending a string message which has to be translated.
Definition: Events_InfoMessage.h:35
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39
Allows to validate the attribute value of a feature or the whole feature.
Definition: ModelAPI_Validator.h:43
Manages the registered validators.
Definition: ModelAPI_Validator.h:66
virtual void registerGeometricalSelection(std::string theFeature, std::string theAttribute)=0
Register the selection attribute as geometrical selection.
virtual const ModelAPI_Validator * validator(const std::string &theID) const =0
Returns registered validator by its Id.
virtual void assignValidator(const std::string &theID, const std::string &theFeatureID, const std::list< std::string > &theArguments)=0
Assigns validator to the feature with arguments of the validator.
virtual void registerConcealment(std::string theFeature, std::string theAttribute)=0
register that this attribute conceals in the object browser all referenced features after execution
virtual bool isMainArgument(std::string theFeature, std::string theAttribute)=0
Returns true is the attribute is a main argument of the feature.
virtual void registerMainArgument(std::string theFeature, std::string theAttribute)=0
Register the attribute as a main argument of the feature.
virtual bool isNotObligatory(std::string theFeature, std::string theAttribute)=0
Returns true if the attribute in feature is not obligatory for the feature execution.
virtual void registerValidator(const std::string &theID, ModelAPI_Validator *theValidator)=0
Registers the instance of the validator by the ID.
ModelAPI_ValidatorsFactory()
Get instance from Session.
Definition: ModelAPI_Validator.h:140
virtual void assignValidator(const std::string &theID, const std::string &theFeatureID, const std::string &theAttrID, const std::list< std::string > &theArguments)=0
Assigns validator to the attribute of the feature.
virtual void assignValidator(const std::string &theID, const std::string &theFeatureID)=0
Assigns validator to the feature.
virtual bool isCase(FeaturePtr theFeature, std::string theAttribute)=0
Returns true if the attribute must be checked (the case is selected)
virtual bool isConcealed(std::string theFeature, std::string theAttribute)=0
Returns true that it was registered that attribute conceals the referenced result.
virtual void registerNotObligatory(std::string theFeature, std::string theAttribute)=0
register that this attribute in feature is not obligatory for the feature execution so,...
virtual bool validate(const std::shared_ptr< ModelAPI_Attribute > &theAttribute, std::string &theValidator, Events_InfoMessage &theError) const =0
Returns true if the attribute is valid.
std::list< std::pair< std::string, std::list< std::string > > > Validators
Validators is a list of pairs <Validator, list of arguments>
Definition: ModelAPI_Validator.h:87
virtual void registerCase(std::string theFeature, std::string theAttribute, const std::list< std::pair< std::string, std::string > > &theCases)=0
Register the case-attribute: this attribute is checked only if its case is selected.
virtual void validators(const std::string &theFeatureID, const std::string &theAttrID, Validators &theResult) const =0
Provides a validator for the attribute, returns NULL if no validator.
virtual bool isGeometricalSelection(std::string theFeature, std::string theAttribute)=0
Returns true if the attribute is a geometrical selection.
virtual bool validate(const std::shared_ptr< ModelAPI_Feature > &theFeature) const =0
Returns true if feature and all its attributes are valid.
virtual void validators(const std::string &theFeatureID, Validators &theResult) const =0
Provides a validator for the feature, returns NULL if no validator.