1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_Validators.h
4 // Created: 09 July 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef PartSet_Validators_H
8 #define PartSet_Validators_H
12 #include <ModuleBase_SelectionValidator.h>
13 #include <ModuleBase_ISelection.h>
14 #include <ModelAPI_AttributeValidator.h>
20 //! \ingroup Validators
21 //! A class to validate a selection for Distance constraint operation
22 class PartSet_DistanceValidator : public ModuleBase_SelectionValidator
25 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
28 //! \ingroup Validators
29 //! A class to validate a selection for Length constraint operation
30 class PartSet_LengthValidator : public ModuleBase_SelectionValidator
33 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
36 //! \ingroup Validators
37 //! A class to validate a selection for Perpendicular constraint operation
38 class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
41 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
44 //! \ingroup Validators
45 //! A class to validate a selection for Perpendicular constraint operation
46 class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
49 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
52 //! \ingroup Validators
53 //! A class to validate a selection for Perpendicular constraint operation
54 class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
57 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
60 //! \ingroup Validators
61 //! A class to validate a selection for Perpendicular constraint operation
62 class PartSet_RigidValidator : public ModuleBase_SelectionValidator
65 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
70 * A validator which checks that objects selected for feature attributes are different (not the same)
72 class PartSet_DifferentObjectsValidator : public ModelAPI_AttributeValidator
75 // TODO(nds) v1.0.2 master
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 // /// \param theShape a selected sub-shape
81 // virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
82 // const ObjectPtr& theObject, const GeomShapePtr& theShape) const;
84 // //! Returns true if the attribute is good for the feature attribute
85 // //! \param theFeature a feature to check
86 // //! \param theArguments a list of arguments (names of attributes to check)
87 // //! \param theAttribute an attribute
88 // virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
89 // const AttributePtr& theAttribute) const;
90 // ======= end of todo
91 //! Returns true if the attribute is good for the feature attribute
92 //! \param theAttribute an attribute
93 //! \param theArguments a list of arguments (names of attributes to check)
94 virtual bool isValid(const AttributePtr& theAttribute,
95 const std::list<std::string>& theArguments) const;
98 //! Casts the attribute to an attribute kind and obtains an object value if it is possible
99 //! \param theAttribute a source attribute to find object
100 //! \return an attribute object or NULL
101 ObjectPtr getObject(const AttributePtr& theAttribute) const;
103 //! Checks whethe other feature attributes has a reference to the given attribute
104 //! \param theAttribute a source attribute to find object
105 //! \return a boolean value
106 bool featureHasReferences(const AttributePtr& theAttribute) const;
110 * \ingroup Validators
111 * A validator which checks that objects selected for feature attributes are different (not the same)
113 class PartSet_SketchEntityValidator : public ModelAPI_AttributeValidator
116 //! Returns true if the attribute is good for the feature attribute
117 //! \param theAttribute an attribute
118 //! \param theArguments a list of arguments (names of attributes to check)
119 virtual bool isValid(const AttributePtr& theAttribute,
120 const std::list<std::string>& theArguments) const;