1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Validators.h
4 // Created: 01 Aug 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef SketchPlugin_Validators_H
8 #define SketchPlugin_Validators_H
10 #include "SketchPlugin.h"
11 #include <ModelAPI_AttributeValidator.h>
13 /**\class SketchPlugin_DistanceAttrValidator
15 * \brief Validator for the distance input.
17 * It just checks that distance is greater than zero.
19 class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator
22 //! returns true if attribute is valid
23 //! \param theAttribute the checked attribute
24 //! \param theArguments arguments of the attribute
25 virtual bool isValid(const AttributePtr& theAttribute,
26 const std::list<std::string>& theArguments) const;
29 /**\class SketchPlugin_TangentAttrValidator
31 * \brief Validator for the tangent constraint input.
33 * It just checks that distance is greater than zero.
35 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
38 //! returns true if attribute is valid
39 //! \param theAttribute the checked attribute
40 //! \param theArguments arguments of the attribute
41 virtual bool isValid(const AttributePtr& theAttribute,
42 const std::list<std::string>& theArguments) const;
46 /**\class SketchPlugin_NotFixed
48 * \brief Validator for the rigid constraint input.
50 * It just checks there is no rigid constraint for the current feature.
52 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
55 //! returns true if attribute is not used in another rigid constraint
56 //! \param theAttribute the checked attribute
57 //! \param theArguments arguments of the attribute
58 virtual bool isValid(const AttributePtr& theAttribute,
59 const std::list<std::string>& theArguments) const;
62 /**\class SketchPlugin_EqualAttrValidator
64 * \brief Validator for the equal constraint input.
66 * It checks that attributes of the Equal constraint are correct.
68 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
71 //! returns true if attribute is valid
72 //! \param theAttribute the checked attribute
73 //! \param theArguments arguments of the attribute
74 virtual bool isValid(const AttributePtr& theAttribute,
75 const std::list<std::string>& theArguments) const;
78 /**\class SketchPlugin_MirrorAttrValidator
80 * \brief Validator for the mirror constraint input.
82 * It checks that attributes of the Mirror constraint are correct.
84 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
87 //! returns true if attribute is valid
88 //! \param theAttribute the checked attribute
89 //! \param theArguments arguments of the attribute (not used)
90 virtual bool isValid(const AttributePtr& theAttribute,
91 const std::list<std::string>& theArguments) const;
95 /**\class SketchPlugin_CoincidenceAttrValidator
97 * \brief Validator for the coincidence constraint input.
99 * It checks that attributes of the Coincidence constraint are correct.
101 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
104 //! returns true if attribute is valid
105 //! \param theAttribute the checked attribute
106 //! \param theArguments arguments of the attribute (not used)
107 virtual bool isValid(const AttributePtr& theAttribute,
108 const std::list<std::string>& theArguments) const;
112 /**\class SketchPlugin_CopyValidator
113 * \ingroup Validators
114 * \brief Validator for the constraints which create features.
116 * Applicable only for features, which creates another features. It verifies the produced
117 * features of current constraint don't become into the list of initial features
119 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
122 //! returns true if attribute is valid
123 //! \param theAttribute the checked attribute
124 //! \param theArguments arguments of the attribute (not used)
125 virtual bool isValid(const AttributePtr& theAttribute,
126 const std::list<std::string>& theArguments) const;