X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Validators.h;h=966f33be1bd1533f746c112f85bcec4abd1c5054;hb=752c9e02e6aa8ced24e9b53097cb42540d5e6a08;hp=f9f45506feacef5e948913c7df791698db821abf;hpb=4ca3fd41634c37f840d0cbb3f896fa97c2d3c457;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Validators.h b/src/SketchPlugin/SketchPlugin_Validators.h index f9f45506f..966f33be1 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.h +++ b/src/SketchPlugin/SketchPlugin_Validators.h @@ -9,6 +9,7 @@ #include "SketchPlugin.h" #include +#include /**\class SketchPlugin_DistanceAttrValidator * \ingroup Validators @@ -22,6 +23,7 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; @@ -39,13 +41,14 @@ class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; }; -/**\class SketchPlugin_NotFixed +/**\class SketchPlugin_NotFixedValidator * \ingroup Validators * \brief Validator for the rigid constraint input. * @@ -57,6 +60,7 @@ class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator //! returns true if attribute is not used in another rigid constraint //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; @@ -74,6 +78,7 @@ class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; @@ -91,6 +96,7 @@ class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute (not used) + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; @@ -109,6 +115,7 @@ class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute (not used) + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const; @@ -128,6 +135,46 @@ class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator //! returns true if attribute is valid //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute (not used) + //! \param theError error message + virtual bool isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + std::string& theError) const; +}; + +/**\class SketchPlugin_SolverErrorValidator + * \ingroup Validators + * \brief Validator for the solver error. + * + * Simply checks that solver error attribute is empty. Returns the attribute value as an error. + */ +class SketchPlugin_SolverErrorValidator : public ModelAPI_FeatureValidator +{ + public: + //! returns true if there are no solver errors + //! \param theFeature the checked feature + //! \param theArguments arguments of the feature (not used) + //! \param theError error message + virtual bool isValid(const std::shared_ptr& theFeature, + const std::list& theArguments, + std::string& theError) const; + + /// Returns true if the attribute in feature is not obligatory for the feature execution + virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); +}; + +/**\class SketchPlugin_FilletVertexValidator + * \ingroup Validators + * \brief Validator for the point for fillet creation. + * + * Checks that selected point have exactly two coincident lines. + */ +class SketchPlugin_FilletVertexValidator : public ModelAPI_AttributeValidator +{ + public: + //! returns true if attribute is valid + //! \param theAttribute the checked attribute + //! \param theArguments arguments of the attribute (not used) + //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, std::string& theError) const;