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,
27 std::string& theError) const;
30 /**\class SketchPlugin_TangentAttrValidator
32 * \brief Validator for the tangent constraint input.
34 * It just checks that distance is greater than zero.
36 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
39 //! returns true if attribute is valid
40 //! \param theAttribute the checked attribute
41 //! \param theArguments arguments of the attribute
42 virtual bool isValid(const AttributePtr& theAttribute,
43 const std::list<std::string>& theArguments,
44 std::string& theError) const;
48 /**\class SketchPlugin_NotFixed
50 * \brief Validator for the rigid constraint input.
52 * It just checks there is no rigid constraint for the current feature.
54 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
57 //! returns true if attribute is not used in another rigid constraint
58 //! \param theAttribute the checked attribute
59 //! \param theArguments arguments of the attribute
60 virtual bool isValid(const AttributePtr& theAttribute,
61 const std::list<std::string>& theArguments,
62 std::string& theError) const;
65 /**\class SketchPlugin_EqualAttrValidator
67 * \brief Validator for the equal constraint input.
69 * It checks that attributes of the Equal constraint are correct.
71 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
74 //! returns true if attribute is valid
75 //! \param theAttribute the checked attribute
76 //! \param theArguments arguments of the attribute
77 virtual bool isValid(const AttributePtr& theAttribute,
78 const std::list<std::string>& theArguments,
79 std::string& theError) const;
82 /**\class SketchPlugin_MirrorAttrValidator
84 * \brief Validator for the mirror constraint input.
86 * It checks that attributes of the Mirror constraint are correct.
88 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
91 //! returns true if attribute is valid
92 //! \param theAttribute the checked attribute
93 //! \param theArguments arguments of the attribute (not used)
94 virtual bool isValid(const AttributePtr& theAttribute,
95 const std::list<std::string>& theArguments,
96 std::string& theError) const;
100 /**\class SketchPlugin_CoincidenceAttrValidator
101 * \ingroup Validators
102 * \brief Validator for the coincidence constraint input.
104 * It checks that attributes of the Coincidence constraint are correct.
106 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
109 //! returns true if attribute is valid
110 //! \param theAttribute the checked attribute
111 //! \param theArguments arguments of the attribute (not used)
112 virtual bool isValid(const AttributePtr& theAttribute,
113 const std::list<std::string>& theArguments,
114 std::string& theError) const;
118 /**\class SketchPlugin_CopyValidator
119 * \ingroup Validators
120 * \brief Validator for the constraints which create features.
122 * Applicable only for features, which creates another features. It verifies the produced
123 * features of current constraint don't become into the list of initial features
125 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
128 //! returns true if attribute is valid
129 //! \param theAttribute the checked attribute
130 //! \param theArguments arguments of the attribute (not used)
131 virtual bool isValid(const AttributePtr& theAttribute,
132 const std::list<std::string>& theArguments,
133 std::string& theError) const;