Salome HOME
17797fb8a66efade946f15045dcc2ad4916c10f8
[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 //  virtual bool isValid(const AttributePtr& theAttribute,
29 //                       const std::list<std::string>& theArguments) const;
30 //
31 //  //! Returns true if object is good for the feature attribute
32 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
33 //                       const ObjectPtr& theObject, const GeomShapePtr& theShape) const;
34 //
35 //  //! Returns true if the attribute is good for the feature attribute
36 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
37 //                       const AttributePtr& theAttribute) const;
38 //};
39
40 // commented in v1.0.2, master:
41 /**\class SketchPlugin_DifferentObjectsValidator
42  * \ingroup Validators
43  *
44  * Check that there is no same object was already selected in the feature.
45  * For an example: to avoid perpendicularity on line and the same line.
46  */
47 // Use PartSet_DifferentObjectsValidator instead
48 //class SketchPlugin_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
49 //{
50 // public:
51 //  //! returns true if attribute is valid
52 //  //! \param theAttribute the checked attribute
53 //  //! \param theArguments arguments of the attribute
54 //  virtual bool isValid(
55 //    const AttributePtr& theAttribute, const std::list<std::string>& theArguments) const;
56 //  //! Returns true if object is good for the feature attribute
57 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
58 //                       const ObjectPtr& theObject) const;
59 //  //! Returns true if the attribute is good for the feature attribute
60 //  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
61 //                       const AttributePtr& theAttribute) const;
62 //};
63 // ======= end of todo
64
65
66 /**\class SketchPlugin_TangentAttrValidator
67  * \ingroup Validators
68  * \brief Validator for the tangent constraint input.
69  *
70  * It just checks that distance is greater than zero.
71  */
72 class SketchPlugin_TangentAttrValidator : public ModelAPI_AttributeValidator
73 {
74  public:
75   //! returns true if attribute is valid
76   //! \param theAttribute the checked attribute
77   //! \param theArguments arguments of the attribute
78   virtual bool isValid(const AttributePtr& theAttribute,
79                        const std::list<std::string>& theArguments) const;
80 };
81
82 #endif