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_CoincidentAttr
31 * \brief Validator to check whether there is a coincident constraint between
32 * the attribute and attribute of argument.
34 class SketchPlugin_CoincidentAttr : public ModelAPI_AttributeValidator
37 //! returns true if attribute is valid
38 //! \param theAttribute the checked attribute
39 //! \param theArguments arguments of the attribute
40 virtual bool isValid(const AttributePtr& theAttribute,
41 const std::list<std::string>& theArguments) const;
44 /**\class SketchPlugin_TangentAttrValidator
46 * \brief Validator for the tangent constraint input.
48 * It just checks that distance is greater than zero.
50 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
53 //! returns true if attribute is valid
54 //! \param theAttribute the checked attribute
55 //! \param theArguments arguments of the attribute
56 virtual bool isValid(const AttributePtr& theAttribute,
57 const std::list<std::string>& theArguments) const;
61 /**\class SketchPlugin_NotFixed
63 * \brief Validator for the rigid constraint input.
65 * It just checks there is no rigid constraint for the current feature.
67 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
70 //! returns true if attribute is not used in another rigid constraint
71 //! \param theAttribute the checked attribute
72 //! \param theArguments arguments of the attribute
73 virtual bool isValid(const AttributePtr& theAttribute,
74 const std::list<std::string>& theArguments) const;
77 /**\class SketchPlugin_EqualAttrValidator
79 * \brief Validator for the equal constraint input.
81 * It checks that attributes of the Equal constraint are correct.
83 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
86 //! returns true if attribute is valid
87 //! \param theAttribute the checked attribute
88 //! \param theArguments arguments of the attribute
89 virtual bool isValid(const AttributePtr& theAttribute,
90 const std::list<std::string>& theArguments) const;
93 /**\class SketchPlugin_MirrorAttrValidator
95 * \brief Validator for the mirror constraint input.
97 * It checks that attributes of the Mirror constraint are correct.
99 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
102 //! returns true if attribute is valid
103 //! \param theAttribute the checked attribute
104 //! \param theArguments arguments of the attribute (not used)
105 virtual bool isValid(const AttributePtr& theAttribute,
106 const std::list<std::string>& theArguments) const;
110 /**\class SketchPlugin_CoincidenceAttrValidator
111 * \ingroup Validators
112 * \brief Validator for the coincidence constraint input.
114 * It checks that attributes of the Coincidence constraint are correct.
116 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
119 //! returns true if attribute is valid
120 //! \param theAttribute the checked attribute
121 //! \param theArguments arguments of the attribute (not used)
122 virtual bool isValid(const AttributePtr& theAttribute,
123 const std::list<std::string>& theArguments) const;
127 /**\class SketchPlugin_CopyValidator
128 * \ingroup Validators
129 * \brief Validator for the constraints which create features.
131 * Applicable only for features, which creates another features. It verifies the produced
132 * features of current constraint don't become into the list of initial features
134 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
137 //! returns true if attribute is valid
138 //! \param theAttribute the checked attribute
139 //! \param theArguments arguments of the attribute (not used)
140 virtual bool isValid(const AttributePtr& theAttribute,
141 const std::list<std::string>& theArguments) const;