X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Validators.h;h=f9f45506feacef5e948913c7df791698db821abf;hb=74e9ba33303efc2282db1261706e904efa36b255;hp=21ad277f77c251619a740d6ce6a80292934ef86c;hpb=643eedadb4ba0c91fe67878be0bb94d1bcca922c;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Validators.h b/src/SketchPlugin/SketchPlugin_Validators.h index 21ad277f7..f9f45506f 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.h +++ b/src/SketchPlugin/SketchPlugin_Validators.h @@ -23,10 +23,10 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute virtual bool isValid(const AttributePtr& theAttribute, - const std::list& theArguments) const; + const std::list& theArguments, + std::string& theError) const; }; - /**\class SketchPlugin_TangentAttrValidator * \ingroup Validators * \brief Validator for the tangent constraint input. @@ -40,7 +40,8 @@ class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute virtual bool isValid(const AttributePtr& theAttribute, - const std::list& theArguments) const; + const std::list& theArguments, + std::string& theError) const; }; @@ -57,8 +58,79 @@ class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator //! \param theAttribute the checked attribute //! \param theArguments arguments of the attribute virtual bool isValid(const AttributePtr& theAttribute, - const std::list& theArguments) const; + const std::list& theArguments, + std::string& theError) const; +}; + +/**\class SketchPlugin_EqualAttrValidator + * \ingroup Validators + * \brief Validator for the equal constraint input. + * + * It checks that attributes of the Equal constraint are correct. + */ +class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator +{ + public: + //! returns true if attribute is valid + //! \param theAttribute the checked attribute + //! \param theArguments arguments of the attribute + virtual bool isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + std::string& theError) const; +}; + +/**\class SketchPlugin_MirrorAttrValidator + * \ingroup Validators + * \brief Validator for the mirror constraint input. + * + * It checks that attributes of the Mirror constraint are correct. + */ +class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator +{ + public: + //! returns true if attribute is valid + //! \param theAttribute the checked attribute + //! \param theArguments arguments of the attribute (not used) + virtual bool isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + std::string& theError) const; }; +/**\class SketchPlugin_CoincidenceAttrValidator + * \ingroup Validators + * \brief Validator for the coincidence constraint input. + * + * It checks that attributes of the Coincidence constraint are correct. + */ +class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator +{ + public: + //! returns true if attribute is valid + //! \param theAttribute the checked attribute + //! \param theArguments arguments of the attribute (not used) + virtual bool isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + std::string& theError) const; +}; + + +/**\class SketchPlugin_CopyValidator + * \ingroup Validators + * \brief Validator for the constraints which create features. + * + * Applicable only for features, which creates another features. It verifies the produced + * features of current constraint don't become into the list of initial features + */ +class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator +{ + public: + //! returns true if attribute is valid + //! \param theAttribute the checked attribute + //! \param theArguments arguments of the attribute (not used) + virtual bool isValid(const AttributePtr& theAttribute, + const std::list& theArguments, + std::string& theError) const; +}; + #endif