Salome HOME
Implementation of point-on-line and point-on-circle constraints in terms of Coinciden...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Validators.h
4 // Created:     01 Aug 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef SketchPlugin_Validators_H
8 #define SketchPlugin_Validators_H
9
10 #include "SketchPlugin.h"
11 #include <ModelAPI_AttributeValidator.h>
12
13 /**\class SketchPlugin_DistanceAttrValidator
14  * \ingroup Validators
15  * \brief Validator for the distance input.
16  *
17  * It just checks that distance is greater than zero.
18  */
19 class SketchPlugin_DistanceAttrValidator : public ModelAPI_AttributeValidator
20 {
21  public:
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;
27 };
28
29
30 /**\class SketchPlugin_TangentAttrValidator
31  * \ingroup Validators
32  * \brief Validator for the tangent constraint input.
33  *
34  * It just checks that distance is greater than zero.
35  */
36 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
37 {
38  public:
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) const;
44 };
45
46
47 /**\class SketchPlugin_NotFixed
48  * \ingroup Validators
49  * \brief Validator for the rigid constraint input.
50  *
51  * It just checks there is no rigid constraint for the current feature.
52  */
53 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
54 {
55  public:
56   //! returns true if attribute is not used in another rigid constraint
57   //! \param theAttribute the checked attribute
58   //! \param theArguments arguments of the attribute
59   virtual bool isValid(const AttributePtr& theAttribute,
60                        const std::list<std::string>& theArguments) const;
61 };
62
63 /**\class SketchPlugin_EqualAttrValidator
64  * \ingroup Validators
65  * \brief Validator for the equal constraint input.
66  *
67  * It checks that attributes of the Equal constraint are correct.
68  */
69 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
70 {
71  public:
72   //! returns true if attribute is valid
73   //! \param theAttribute the checked attribute
74   //! \param theArguments arguments of the attribute
75   virtual bool isValid(const AttributePtr& theAttribute,
76                        const std::list<std::string>& theArguments) const;
77 };
78
79 /**\class SketchPlugin_MirrorAttrValidator
80  * \ingroup Validators
81  * \brief Validator for the mirror constraint input.
82  *
83  * It checks that attributes of the Mirror constraint are correct.
84  */
85 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
86 {
87  public:
88   //! returns true if attribute is valid
89   //! \param theAttribute the checked attribute
90   //! \param theArguments arguments of the attribute (not used)
91   virtual bool isValid(const AttributePtr& theAttribute,
92                        const std::list<std::string>& theArguments) const;
93 };
94
95
96 /**\class SketchPlugin_CoincidenceAttrValidator
97  * \ingroup Validators
98  * \brief Validator for the coincidence constraint input.
99  *
100  * It checks that attributes of the Coincidence constraint are correct.
101  */
102 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
103 {
104  public:
105   //! returns true if attribute is valid
106   //! \param theAttribute the checked attribute
107   //! \param theArguments arguments of the attribute (not used)
108   virtual bool isValid(const AttributePtr& theAttribute,
109                        const std::list<std::string>& theArguments) const;
110 };
111
112 #endif