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