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 attribute is good for the feature attribute
77 //! \param theAttribute an attribute
78 //! \param theArguments a list of arguments (names of attributes to check)
79 virtual bool isValid(const AttributePtr& theAttribute,
80 const std::list<std::string>& theArguments) const;
83 //! Casts the attribute to an attribute kind and obtains an object value if it is possible
84 //! \param theAttribute a source attribute to find object
85 //! \return an attribute object or NULL
86 ObjectPtr getObject(const AttributePtr& theAttribute) const;
88 //! Checks whethe other feature attributes has a reference to the given attribute
89 //! \param theAttribute a source attribute to find object
90 //! \return a boolean value
91 bool featureHasReferences(const AttributePtr& theAttribute) const;
96 * A Validator which validates tha selected object is a Sketch
98 class PartSet_SketchValidator : public ModelAPI_ResultValidator
101 /// Returns True if the given object is a sketch
102 /// \param theObject an object
103 virtual bool isValid(const ObjectPtr theObject) const;