Salome HOME
Issue #700 Fillet for edges with not shared point question
[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 /**\class SketchPlugin_CoincidentAttr
30  * \ingroup Validators
31  * \brief Validator to check whether there is a coincident constraint between
32  * the attribute and attribute of argument.
33  */
34 class SketchPlugin_CoincidentAttr : public ModelAPI_AttributeValidator
35 {
36  public:
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;
42 };
43
44 /**\class SketchPlugin_TangentAttrValidator
45  * \ingroup Validators
46  * \brief Validator for the tangent constraint input.
47  *
48  * It just checks that distance is greater than zero.
49  */
50 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
51 {
52  public:
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;
58 };
59
60
61 /**\class SketchPlugin_NotFixed
62  * \ingroup Validators
63  * \brief Validator for the rigid constraint input.
64  *
65  * It just checks there is no rigid constraint for the current feature.
66  */
67 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
68 {
69  public:
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;
75 };
76
77 /**\class SketchPlugin_EqualAttrValidator
78  * \ingroup Validators
79  * \brief Validator for the equal constraint input.
80  *
81  * It checks that attributes of the Equal constraint are correct.
82  */
83 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
84 {
85  public:
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;
91 };
92
93 /**\class SketchPlugin_MirrorAttrValidator
94  * \ingroup Validators
95  * \brief Validator for the mirror constraint input.
96  *
97  * It checks that attributes of the Mirror constraint are correct.
98  */
99 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
100 {
101  public:
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;
107 };
108
109
110 /**\class SketchPlugin_CoincidenceAttrValidator
111  * \ingroup Validators
112  * \brief Validator for the coincidence constraint input.
113  *
114  * It checks that attributes of the Coincidence constraint are correct.
115  */
116 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
117 {
118  public:
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;
124 };
125
126
127 /**\class SketchPlugin_CopyValidator
128  * \ingroup Validators
129  * \brief Validator for the constraints which create features.
130  *
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
133  */
134 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
135 {
136  public:
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;
142 };
143
144 #endif