Salome HOME
#858 'Tangency' constraint doesn't work
[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,
27                        std::string& theError) const;
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,
44                        std::string& theError) const;
45 };
46
47
48 /**\class SketchPlugin_NotFixed
49  * \ingroup Validators
50  * \brief Validator for the rigid constraint input.
51  *
52  * It just checks there is no rigid constraint for the current feature.
53  */
54 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
55 {
56  public:
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;
63 };
64
65 /**\class SketchPlugin_EqualAttrValidator
66  * \ingroup Validators
67  * \brief Validator for the equal constraint input.
68  *
69  * It checks that attributes of the Equal constraint are correct.
70  */
71 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
72 {
73  public:
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;
80 };
81
82 /**\class SketchPlugin_MirrorAttrValidator
83  * \ingroup Validators
84  * \brief Validator for the mirror constraint input.
85  *
86  * It checks that attributes of the Mirror constraint are correct.
87  */
88 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
89 {
90  public:
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;
97 };
98
99
100 /**\class SketchPlugin_CoincidenceAttrValidator
101  * \ingroup Validators
102  * \brief Validator for the coincidence constraint input.
103  *
104  * It checks that attributes of the Coincidence constraint are correct.
105  */
106 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
107 {
108  public:
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;
115 };
116
117
118 /**\class SketchPlugin_CopyValidator
119  * \ingroup Validators
120  * \brief Validator for the constraints which create features.
121  *
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
124  */
125 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
126 {
127  public:
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;
134 };
135
136 #endif