Salome HOME
Merge remote-tracking branch 'origin/Dev_0.6'
[modules/shaper.git] / src / Model / Model_FeatureValidator.h
1 // File:        ModelAPI_FeatureValidator.h
2 // Created:     8 Jul 2014
3 // Author:      Vitaly SMETANNIKOV
4
5 #ifndef Model_FeatureValidator_H
6 #define Model_FeatureValidator_H
7
8 #include <Model.h>
9 #include <ModelAPI_Feature.h>
10 #include <ModelAPI_FeatureValidator.h>
11
12 #include <memory>
13 #include <set>
14 #include <map>
15
16 class Model_FeatureValidator : public ModelAPI_FeatureValidator
17 {
18   // not obligatory attributes, not checked for initialization
19   std::map<std::string, std::set<std::string> > myNotObligatory;
20  public:
21   /// Returns true if feature and/or attributes are valid
22   /// \param theFeature the validated feature
23   MODEL_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
24     const std::list<std::string>& theArguments) const;
25
26   // sets not obligatory attributes, not checked for initialization
27   virtual void registerNotObligatory(std::string theFeature, std::string theAttribute);
28
29   /// Returns true if the attribute in feature is not obligatory for the feature execution
30   virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
31 };
32
33 #endif