]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Error management -- Feature validator returns an error.
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 29 Jul 2015 10:55:13 +0000 (13:55 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 5 Aug 2015 14:34:00 +0000 (17:34 +0300)
src/GeomValidators/GeomValidators_BooleanArguments.cpp
src/GeomValidators/GeomValidators_BooleanArguments.h
src/GeomValidators/GeomValidators_Different.cpp
src/GeomValidators/GeomValidators_Different.h
src/GeomValidators/GeomValidators_ZeroOffset.cpp
src/GeomValidators/GeomValidators_ZeroOffset.h
src/Model/Model_FeatureValidator.cpp
src/Model/Model_FeatureValidator.h
src/ModelAPI/ModelAPI_FeatureValidator.h

index cfd5620ead293b3ac532d81687169e3e10dad4d4..a5caa03fa019bcbe5e039ae1941b88981989e30e 100644 (file)
@@ -11,7 +11,8 @@
 
 //=================================================================================================
 bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                              const std::list<std::string>& theArguments) const
+                                              const std::list<std::string>& theArguments,
+                                              std::string& theError) const
 {
   if(theArguments.size() != 3) {
     return false;
index c7134745fbb4bcad25f5aec9779ea3c2c8792348..d5c9031118d29f0013a20f9d4be9239160eab7bf 100644 (file)
@@ -24,7 +24,8 @@ public:
    *  \returns true if feature is valid.
    */
   GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                             const std::list<std::string>& theArguments) const;
+                                             const std::list<std::string>& theArguments,
+                                             std::string& theError) const;
 
   /// \return true if the attribute in feature is not obligatory for the feature execution.
   GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
index 65b834d3af46624a5e0da5791b1e705581659e56..dcad93164ad65ecc2a69534b01aaf1b44aef0fd8 100644 (file)
@@ -45,7 +45,8 @@ public:
 };
 
 bool GeomValidators_Different::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                       const std::list<std::string>& theArguments) const
+                                       const std::list<std::string>& theArguments,
+                                       std::string& theError) const
 {
   std::map<std::string, std::list<AttributePtr> > anAttributesMap;
   // For all attributes referred by theArguments 
index 14380dd3e8c031459137f7c1e4dbcaf7e0aa0c8a..28cc2c58fe314b476e1ca8060fc2dbbdf1ed6abf 100644 (file)
@@ -24,7 +24,8 @@ public:
    *  \returns true if feature is valid.
    */
   GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                             const std::list<std::string>& theArguments) const;
+                                             const std::list<std::string>& theArguments,
+                                             std::string& theError) const;
 
   GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
 };
index 4bfe414a19f16627ee8e428ef33b5a6362ecc764..63e6d5f89a8f49a27b7f21ab8524db6dbcc02f50 100644 (file)
@@ -13,7 +13,8 @@
 
 //=================================================================================================
 bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                        const std::list<std::string>& theArguments) const
+                                        const std::list<std::string>& theArguments,
+                                        std::string& theError) const
 {
   if(theArguments.size() != 8) {
     return false;
index d9f7f07afa62012609b8c86cf2bf946a09373304..e6897060a084b0602e41db2d62e16bdb035dc10d 100644 (file)
@@ -24,7 +24,8 @@ public:
    *  \returns true if feature is valid.
    */
   GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                             const std::list<std::string>& theArguments) const;
+                                             const std::list<std::string>& theArguments,
+                                             std::string& theError) const;
 
   /// \return true if the attribute in feature is not obligatory for the feature execution.
   GEOMVALIDATORS_EXPORT virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
index 8cec7f4b7849ef1cf6edccede77472c3a3b9c03a..99fc08fe733470d57f2a35afedcc34d5b5938a6d 100644 (file)
@@ -16,7 +16,8 @@
 #include <memory>
 
 bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-  const std::list<std::string>& theArguments) const
+                                     const std::list<std::string>& theArguments,
+                                     std::string& theError) const
 {
   static Model_ValidatorsFactory* aValidators = 
     static_cast<Model_ValidatorsFactory*>(ModelAPI_Session::get()->validators());
index e412301fec5dfbad8cda15b775f6c0f397eb7632..c35acc8e10fdd5fb5d6cad160be8ca494b578307 100644 (file)
@@ -33,7 +33,8 @@ public:
   /// \param theArguments the arguments in the configuration file for this validator
   /// \returns true if feature is valid
   MODEL_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-    const std::list<std::string>& theArguments) const;
+                                    const std::list<std::string>& theArguments,
+                                    std::string& theError) const;
 
   /// sets not obligatory attributes, not checked for initialization
   virtual void registerNotObligatory(std::string theFeature, std::string theAttribute);
index 5d6eb3b1c49d35733171e12671e2053047943460..9b529e9db9567d3e0e4ad423555fe6b5037a79d0 100644 (file)
@@ -30,7 +30,8 @@ class MODELAPI_EXPORT ModelAPI_FeatureValidator : public ModelAPI_Validator
   /// \param theFeature the validated feature
   /// \param theArguments list of string, feature attribute names: dependent attributes
   virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-    const std::list<std::string>& theArguments) const = 0;
+                       const std::list<std::string>& theArguments,
+                       std::string& theError = std::string()) 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;