Salome HOME
Fix for issue #562 : correct update by dependencies in the parameters
[modules/shaper.git] / src / ModelAPI / ModelAPI_FeatureValidator.h
index 2023a66fc77a88ecd3a6166f17471d5e7209909e..59161acbef6b9fdd8b7a208a6f831b25f875979f 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModelAPI_FeatureValidator.h
 // Created:     8 Jul 2014
 // Author:      Vitaly SMETANNIKOV
 #include "ModelAPI.h"
 #include "ModelAPI_Validator.h"
 
-class MODELAPI_EXPORT ModelAPI_FeatureValidator: public ModelAPI_Validator
+/**\class ModelAPI_FeatureValidator
+ * \ingroup DataModel
+ * \brief 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.
+ */
+class ModelAPI_FeatureValidator : public ModelAPI_Validator
 {
-public:
+ public:
   /// Returns true if feature and/or attributes are valid
   /// \param theFeature the validated feature
-  /// \param theAttr the validated attribute ID, empty string of feature is validated
   /// \param theArguments list of string, feature attribute names: dependent attributes
-  virtual bool validate(const boost::shared_ptr<ModelAPI_Feature>& theFeature,
-    const std::string theAttr, std::list<std::string> theArguments) const = 0;
+  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+    const std::list<std::string>& theArguments) 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;
 };
 
 #endif