]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Validator.cpp
Salome HOME
Task #267: initial implementation of errors management
[modules/shaper.git] / src / Model / Model_Validator.cpp
index cc3a612a50d19752eae437181a03df9d3122bf75..501b91b2f1072b47e1775a12cb0d331606c8b6c1 100644 (file)
@@ -224,6 +224,19 @@ void Model_ValidatorsFactory::registerNotObligatory(std::string theFeature, std:
   }
 }
 
+bool Model_ValidatorsFactory::isNotObligatory(std::string theFeature, std::string theAttribute)
+{
+  const static std::string kDefaultId = "Model_FeatureValidator";
+  std::map<std::string, ModelAPI_Validator*>::const_iterator it = myIDs.find(kDefaultId);
+  if (it != myIDs.end()) {
+    Model_FeatureValidator* aValidator = dynamic_cast<Model_FeatureValidator*>(it->second);
+    if (aValidator) {
+      return aValidator->isNotObligatory(theFeature, theAttribute);
+    }
+  }
+  return false; // default
+}
+
 void Model_ValidatorsFactory::registerConcealment(std::string theFeature, std::string theAttribute)
 {
   std::map<std::string, std::set<std::string> >::iterator aFind = myConcealed.find(theFeature);