From: sbh Date: Tue, 2 Sep 2014 14:21:02 +0000 (+0400) Subject: Treat "Model_FeatureValidator" as default validator (no need to declare it in an... X-Git-Tag: V_0.4.4~95 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2bdf4440c6079f4637edf1b9816cd08390ab9ce3;p=modules%2Fshaper.git Treat "Model_FeatureValidator" as default validator (no need to declare it in an XML) --- diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 90a281c86..eaab5d3c3 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -64,6 +64,7 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, } } } + addDefaultValidators(theResult); } void Model_ValidatorsFactory::validators(const std::string& theFeatureID, @@ -108,3 +109,12 @@ const ModelAPI_Validator* Model_ValidatorsFactory::validator(const std::string& } return NULL; } + +void Model_ValidatorsFactory::addDefaultValidators(std::list& theValidators) const +{ + std::string anId = "Model_FeatureValidator"; + std::map::const_iterator it = myIDs.find(anId); + if(it == myIDs.end()) + return; + theValidators.push_back(it->second); +} diff --git a/src/Model/Model_Validator.h b/src/Model/Model_Validator.h index 0be3d21c8..56d65d181 100644 --- a/src/Model/Model_Validator.h +++ b/src/Model/Model_Validator.h @@ -65,6 +65,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory // const boost::shared_ptr& theFeature, const std::string& theAttrID) const; protected: + void addDefaultValidators(std::list& theValidators) const; /// Get instance from PluginManager Model_ValidatorsFactory(); diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index b343b57ca..804f1bb32 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -11,7 +11,6 @@ -