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_RefAttrValidator.h>
15 #include <ModelAPI_ResultValidator.h>
21 //! \ingroup Validators
22 //! A class to validate a selection for Distance constraint operation
23 class PartSet_DistanceValidator : public ModuleBase_SelectionValidator
26 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
29 //! \ingroup Validators
30 //! A class to validate a selection for Length constraint operation
31 class PartSet_LengthValidator : public ModuleBase_SelectionValidator
34 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
37 //! \ingroup Validators
38 //! A class to validate a selection for Perpendicular constraint operation
39 class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
42 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
45 //! \ingroup Validators
46 //! A class to validate a selection for Perpendicular constraint operation
47 class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
50 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
53 //! \ingroup Validators
54 //! A class to validate a selection for Perpendicular constraint operation
55 class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
58 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
61 //! \ingroup Validators
62 //! A class to validate a selection for Perpendicular constraint operation
63 class PartSet_RigidValidator : public ModuleBase_SelectionValidator
66 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
71 * A validator which checks that objects selected for feature attributes are different (not the same)
73 class PartSet_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
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;
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;
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;
99 * A Validator which validates tha selected object is a Sketch
101 class PartSet_SketchValidator : public ModelAPI_ResultValidator
104 /// Returns True if the given object is a sketch
105 /// \param theObject an object
106 virtual bool isValid(const ObjectPtr theObject) const;