]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Treat "Model_FeatureValidator" as default validator (no need to declare it in an...
authorsbh <sergey.belash@opencascade.com>
Tue, 2 Sep 2014 14:21:02 +0000 (18:21 +0400)
committersbh <sergey.belash@opencascade.com>
Tue, 2 Sep 2014 14:21:02 +0000 (18:21 +0400)
src/Model/Model_Validator.cpp
src/Model/Model_Validator.h
src/SketchPlugin/plugin-Sketch.xml

index 90a281c865c517afa79d05579ef150dd5a93e2e2..eaab5d3c3323ba145a4d98f081e59300c100ef45 100644 (file)
@@ -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<ModelAPI_Validator*>& theValidators) const
+{
+  std::string anId = "Model_FeatureValidator";
+  std::map<std::string, ModelAPI_Validator*>::const_iterator it = myIDs.find(anId);
+  if(it == myIDs.end())
+    return;
+  theValidators.push_back(it->second);
+}
index 0be3d21c87b12163468bc68f613e19d781144172..56d65d18194d11aa799a9182a607ff4639bb2bdc 100644 (file)
@@ -65,6 +65,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory
   //  const boost::shared_ptr<ModelAPI_Feature>& theFeature, const std::string& theAttrID) const;
 
  protected:
+  void addDefaultValidators(std::list<ModelAPI_Validator*>& theValidators) const;
   /// Get instance from PluginManager
   Model_ValidatorsFactory();
 
index b343b57cadbe90f35a4dc40274b037579d317ee7..804f1bb32609a9d858b818f13d125e28a5a2cf43 100644 (file)
@@ -11,7 +11,6 @@
       <feature id="SketchLine" title="Line" tooltip="Create a new line" icon=":icons/line.png">
         <point_selector id="StartPoint" title="Start point" tooltip="Start point of the line" previous_feature_param="EndPoint"/>
         <point_selector id="EndPoint" title="End point" tooltip="End point of the line"/>
-        <validator id="Model_FeatureValidator" />
       </feature>
       <feature id="SketchCircle" title="Circle" tooltip="Create a new circle" icon=":icons/circle.png">
         <point_selector id="CircleCenter" title="Center" tooltip="Center of the circle"/>