1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: BuildPlugin_Validators.h
4 // Created: 22 March 2016
5 // Author: Dmitry Bobylev
7 #ifndef BuildPlugin_Validators_H_
8 #define BuildPlugin_Validators_H_
10 #include <ModelAPI_AttributeValidator.h>
11 #include <ModelAPI_FeatureValidator.h>
13 /// \class BuildPlugin_ValidatorBaseForBuild
14 /// \ingroup Validators
15 /// \brief A validator for selection base shapes for build features.
16 /// Allows to select shapes on sketch and
17 /// whole objects with allowed type.
18 class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator
21 //! Returns true if attribute is ok.
22 //! \param[in] theAttribute the checked attribute.
23 //! \param[in] theArguments arguments of the attribute.
24 //! \param[out] theError error message.
25 virtual bool isValid(const AttributePtr& theAttribute,
26 const std::list<std::string>& theArguments,
27 Events_InfoMessage& theError) const;
30 /// \class BuildPlugin_ValidatorBaseForWire
31 /// \ingroup Validators
32 /// \brief A validator for selection base shapes for wire. Allows to select edges on sketch and
33 /// wires objects that are connected to already selected shapes.
34 class BuildPlugin_ValidatorBaseForWire: public ModelAPI_FeatureValidator
37 //! Returns true if attributes is ok.
38 //! \param theFeature the checked feature.
39 //! \param theArguments arguments of the feature.
40 //! \param theError error message.
41 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
42 const std::list<std::string>& theArguments,
43 Events_InfoMessage& theError) const;
45 /// \return true if the attribute in feature is not obligatory for the feature execution
46 virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
49 /// \class BuildPlugin_ValidatorBaseForFace
50 /// \ingroup Validators
51 /// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
52 /// wires objects that lie in the same plane and don't have intersections.
53 class BuildPlugin_ValidatorBaseForFace: public ModelAPI_FeatureValidator
56 //! Returns true if attributes is ok.
57 //! \param theFeature the checked feature.
58 //! \param theArguments arguments of the feature.
59 //! \param theError error message.
60 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61 const std::list<std::string>& theArguments,
62 Events_InfoMessage& theError) const;
64 /// \return true if the attribute in feature is not obligatory for the feature execution
65 virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
68 /// \class BuildPlugin_ValidatorSubShapesSelection
69 /// \ingroup Validators
70 /// \brief A validator for selection sub-shapes for SubShape feature.
71 class BuildPlugin_ValidatorSubShapesSelection: public ModelAPI_AttributeValidator
74 //! Returns true if attribute is ok.
75 //! \param[in] theAttribute the checked attribute.
76 //! \param[in] theArguments arguments of the attribute.
77 //! \param[out] theError error message.
78 virtual bool isValid(const AttributePtr& theAttribute,
79 const std::list<std::string>& theArguments,
80 Events_InfoMessage& theError) const;