Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[modules/shaper.git] / src / PartSet / PartSet_Validators.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_Validators.h
4 // Created:     09 July 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef PartSet_Validators_H
8 #define PartSet_Validators_H
9
10 #include "PartSet.h"
11
12 #include <ModuleBase_SelectionValidator.h>
13 #include <ModuleBase_ISelection.h>
14 #include <ModelAPI_RefAttrValidator.h>
15 #include <ModelAPI_ResultValidator.h>
16
17 /*
18  * Selector validators
19  */
20
21 //! \ingroup Validators
22 //! A class to validate a selection for Distance constraint operation
23 class PartSet_DistanceValidator : public ModuleBase_SelectionValidator
24 {
25  public:
26   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
27 };
28
29 //! \ingroup Validators
30 //! A class to validate a selection for Length constraint operation
31 class PartSet_LengthValidator : public ModuleBase_SelectionValidator
32 {
33  public:
34   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
35 };
36
37 //! \ingroup Validators
38 //! A class to validate a selection for Perpendicular constraint operation
39 class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
40 {
41  public:
42   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
43 };
44
45 //! \ingroup Validators
46 //! A class to validate a selection for Perpendicular constraint operation
47 class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
48 {
49  public:
50   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
51 };
52
53 //! \ingroup Validators
54 //! A class to validate a selection for Perpendicular constraint operation
55 class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
56 {
57  public:
58   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
59 };
60
61 //! \ingroup Validators
62 //! A class to validate a selection for Perpendicular constraint operation
63 class PartSet_RigidValidator : public ModuleBase_SelectionValidator
64 {
65  public:
66   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
67 };
68
69 /**
70 * \ingroup Validators
71 * A validator which checks that objects selected for feature attributes are different (not the same)
72 */
73 class PartSet_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
74 {
75  public:
76    /// Returns True if the feature is valid
77    /// \param theFeature a feature to check
78    /// \param theArguments a list of arguments (names of attributes to check)
79    /// \param theObject a selected object
80   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
81                        const ObjectPtr& theObject) const;
82
83   //! Returns true if the attribute is good for the feature attribute
84   //! \param theFeature a feature to check
85   //! \param theArguments a list of arguments (names of attributes to check)
86   //! \param theAttribute an attribute
87   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
88                        const AttributePtr& theAttribute) const;
89
90   //! Returns true if the attribute is good for the feature attribute
91   //! \param theAttribute an attribute
92   //! \param theArguments a list of arguments (names of attributes to check)
93   virtual bool isValid(const AttributePtr& theAttribute,
94                        const std::list<std::string>& theArguments) const;
95 };
96
97 /**
98 * \ingroup Validators
99 * A Validator which validates tha selected object is a Sketch
100 */
101 class PartSet_SketchValidator : public ModelAPI_ResultValidator
102 {
103  public:
104    /// Returns True if the given object is a sketch
105    /// \param theObject an object
106   virtual bool isValid(const ObjectPtr theObject) const;
107 };
108
109
110 #endif