Salome HOME
Issue #741 fillet is wrong
[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_TangentAttrValidator
30  * \ingroup Validators
31  * \brief Validator for the tangent constraint input.
32  *
33  * It just checks that distance is greater than zero.
34  */
35 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
36 {
37  public:
38   //! returns true if attribute is valid
39   //! \param theAttribute the checked attribute
40   //! \param theArguments arguments of the attribute
41   virtual bool isValid(const AttributePtr& theAttribute,
42                        const std::list<std::string>& theArguments) const;
43 };
44
45
46 /**\class SketchPlugin_NotFixed
47  * \ingroup Validators
48  * \brief Validator for the rigid constraint input.
49  *
50  * It just checks there is no rigid constraint for the current feature.
51  */
52 class SketchPlugin_NotFixedValidator : public ModelAPI_AttributeValidator
53 {
54  public:
55   //! returns true if attribute is not used in another rigid constraint
56   //! \param theAttribute the checked attribute
57   //! \param theArguments arguments of the attribute
58   virtual bool isValid(const AttributePtr& theAttribute,
59                        const std::list<std::string>& theArguments) const;
60 };
61
62 /**\class SketchPlugin_EqualAttrValidator
63  * \ingroup Validators
64  * \brief Validator for the equal constraint input.
65  *
66  * It checks that attributes of the Equal constraint are correct.
67  */
68 class SketchPlugin_EqualAttrValidator : public ModelAPI_AttributeValidator
69 {
70  public:
71   //! returns true if attribute is valid
72   //! \param theAttribute the checked attribute
73   //! \param theArguments arguments of the attribute
74   virtual bool isValid(const AttributePtr& theAttribute,
75                        const std::list<std::string>& theArguments) const;
76 };
77
78 /**\class SketchPlugin_MirrorAttrValidator
79  * \ingroup Validators
80  * \brief Validator for the mirror constraint input.
81  *
82  * It checks that attributes of the Mirror constraint are correct.
83  */
84 class SketchPlugin_MirrorAttrValidator : public ModelAPI_AttributeValidator
85 {
86  public:
87   //! returns true if attribute is valid
88   //! \param theAttribute the checked attribute
89   //! \param theArguments arguments of the attribute (not used)
90   virtual bool isValid(const AttributePtr& theAttribute,
91                        const std::list<std::string>& theArguments) const;
92 };
93
94
95 /**\class SketchPlugin_CoincidenceAttrValidator
96  * \ingroup Validators
97  * \brief Validator for the coincidence constraint input.
98  *
99  * It checks that attributes of the Coincidence constraint are correct.
100  */
101 class SketchPlugin_CoincidenceAttrValidator : public ModelAPI_AttributeValidator
102 {
103  public:
104   //! returns true if attribute is valid
105   //! \param theAttribute the checked attribute
106   //! \param theArguments arguments of the attribute (not used)
107   virtual bool isValid(const AttributePtr& theAttribute,
108                        const std::list<std::string>& theArguments) const;
109 };
110
111
112 /**\class SketchPlugin_CopyValidator
113  * \ingroup Validators
114  * \brief Validator for the constraints which create features.
115  *
116  * Applicable only for features, which creates another features. It verifies the produced
117  * features of current constraint don't become into the list of initial features
118  */
119 class SketchPlugin_CopyValidator : public ModelAPI_AttributeValidator
120 {
121  public:
122   //! returns true if attribute is valid
123   //! \param theAttribute the checked attribute
124   //! \param theArguments arguments of the attribute (not used)
125   virtual bool isValid(const AttributePtr& theAttribute,
126                        const std::list<std::string>& theArguments) const;
127 };
128
129 #endif