X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Validators.h;h=70120d614a640331a6f65fc1800d725591c2d710;hb=65b511870adccd85f3cf65e1b80466045abc1608;hp=966f33be1bd1533f746c112f85bcec4abd1c5054;hpb=c3ae28ba30027cc4a6a757ef623f40adaae96ead;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Validators.h b/src/SketchPlugin/SketchPlugin_Validators.h index 966f33be1..70120d614 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.h +++ b/src/SketchPlugin/SketchPlugin_Validators.h @@ -26,7 +26,7 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; /**\class SketchPlugin_TangentAttrValidator @@ -44,7 +44,7 @@ class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; @@ -63,7 +63,7 @@ class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; /**\class SketchPlugin_EqualAttrValidator @@ -81,7 +81,7 @@ class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; /**\class SketchPlugin_MirrorAttrValidator @@ -99,7 +99,7 @@ class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; @@ -118,7 +118,7 @@ class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; @@ -138,7 +138,7 @@ class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; }; /**\class SketchPlugin_SolverErrorValidator @@ -156,7 +156,7 @@ class SketchPlugin_SolverErrorValidator : public ModelAPI_FeatureValidator //! \param theError error message virtual bool isValid(const std::shared_ptr& theFeature, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& 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); @@ -169,6 +169,25 @@ class SketchPlugin_SolverErrorValidator : public ModelAPI_FeatureValidator * 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, + Events_InfoMessage& theError) const; +}; + + +/**\class SketchPlugin_MiddlePointAttrValidator + * \ingroup Validators + * \brief Validator for the middle point constraint input. + * + * It checks that attributes of the Middle point constraint are correct. + */ +class SketchPlugin_MiddlePointAttrValidator : public ModelAPI_AttributeValidator { public: //! returns true if attribute is valid @@ -177,7 +196,79 @@ class SketchPlugin_FilletVertexValidator : public ModelAPI_AttributeValidator //! \param theError error message virtual bool isValid(const AttributePtr& theAttribute, const std::list& theArguments, - std::string& theError) const; + Events_InfoMessage& theError) const; +}; + + +/**\class SketchPlugin_ArcTangentPointValidator + * \ingroup Validators + * \brief Validator for the point where the tangent arc is building. + * + * Checks that the point is a start or end point just on line or arc. + */ +class SketchPlugin_ArcTangentPointValidator : public ModelAPI_AttributeValidator +{ + public: + //! 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, + Events_InfoMessage& theError) const; +}; + +/**\class SketchPlugin_SplitValidator + * \ingroup Validators + * \brief Validator for the entity of the following type: + * - Linear segment with point(s) coinident to this line + * - Arc with point(s) coincident to the arc + * - Circle with at least 2 split-points on this circle + * + * Checks that there are coincident point on selected feature. + */ +class SketchPlugin_SplitValidator : public ModelAPI_AttributeValidator +{ + public: + //! 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, + Events_InfoMessage& theError) const; +}; + +/**\class SketchPlugin_IntersectionValidator + * \ingroup Validators + * \brief Validator for the attribute to be intersected with the sketch plane. + */ +class SketchPlugin_IntersectionValidator : public ModelAPI_AttributeValidator +{ + public: + //! 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, + Events_InfoMessage& theError) const; +}; + +/**\class SketchPlugin_ProjectionValidator + * \ingroup Validators + * \brief Validator for the attribute to be projected onto the sketch plane. + */ +class SketchPlugin_ProjectionValidator : public ModelAPI_AttributeValidator +{ + public: + //! 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, + Events_InfoMessage& theError) const; }; #endif