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 //! 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 //! A class to validate a selection for Length constraint operation
29 class PartSet_LengthValidator : public ModuleBase_SelectionValidator
32 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
35 //! A class to validate a selection for Perpendicular constraint operation
36 class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
39 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
42 //! A class to validate a selection for Perpendicular constraint operation
43 class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
46 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
49 //! A class to validate a selection for Perpendicular constraint operation
50 class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
53 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
56 //! A class to validate a selection for Perpendicular constraint operation
57 class PartSet_RigidValidator : public ModuleBase_SelectionValidator
60 PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
65 * A validator which checks that objects selected for feature attributes are different (not the same)
67 class PartSet_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
70 /// Returns True if the feature is valid
71 /// \param theFeature a feature to check
72 /// \param theArguments a list of arguments (names of attributes to check)
73 /// \param theObject a selected object
74 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
75 const ObjectPtr& theObject) const;
77 //! Returns true if the attribute is good for the feature attribute
78 //! \param theFeature a feature to check
79 //! \param theArguments a list of arguments (names of attributes to check)
80 //! \param theAttribute an attribute
81 virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
82 const AttributePtr& theAttribute) const;
84 //! Returns true if the attribute is good for the feature attribute
85 //! \param theAttribute an attribute
86 //! \param theArguments a list of arguments (names of attributes to check)
87 virtual bool isValid(const AttributePtr& theAttribute,
88 const std::list<std::string>& theArguments) const;
93 * A Validator which validates tha selected object is a Sketch
95 class PartSet_SketchValidator : public ModelAPI_ResultValidator
98 /// Returns True if the given object is a sketch
99 /// \param theObject an object
100 virtual bool isValid(const ObjectPtr theObject) const;