Salome HOME
Issue #1369: Added "Create Face" feature.
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Validators.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        BuildPlugin_Validators.h
4 // Created:     22 March 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef BuildPlugin_Validators_H_
8 #define BuildPlugin_Validators_H_
9
10 #include <ModelAPI_AttributeValidator.h>
11 #include <ModelAPI_FeatureValidator.h>
12
13 /// \class BuildPlugin_ValidatorBaseForBuild
14 /// \ingroup Validators
15 /// \brief A validator for selection base shapes for build features. Allows to select shapes on sketch and
16 /// whole objects with allowed type.
17 class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator
18 {
19 public:
20   //! Returns true if attribute is ok.
21   //! \param[in] theAttribute the checked attribute.
22   //! \param[in] theArguments arguments of the attribute.
23   //! \param[out] theError error message.
24    virtual bool isValid(const AttributePtr& theAttribute,
25                         const std::list<std::string>& theArguments,
26                         std::string& theError) const;
27 };
28
29 /// \class BuildPlugin_ValidatorBaseForWire
30 /// \ingroup Validators
31 /// \brief A validator for selection base shapes for wire. Allows to select edges on sketch and
32 /// wires objects that are connected to already selected shapes.
33 class BuildPlugin_ValidatorBaseForWire: public ModelAPI_FeatureValidator
34 {
35 public:
36   //! Returns true if attributes is ok.
37   //! \param theFeature the checked feature.
38   //! \param theArguments arguments of the feature.
39   //! \param theError error message.
40   virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                        const std::list<std::string>& theArguments,
42                        std::string& theError) const;
43
44   /// \return true if the attribute in feature is not obligatory for the feature execution
45   virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
46 };
47
48 /// \class BuildPlugin_ValidatorBaseForFace
49 /// \ingroup Validators
50 /// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
51 /// wires objects that lie in the same plane and don't have intersections.
52 class BuildPlugin_ValidatorBaseForFace: public ModelAPI_FeatureValidator
53 {
54 public:
55   //! Returns true if attributes is ok.
56   //! \param theFeature the checked feature.
57   //! \param theArguments arguments of the feature.
58   //! \param theError error message.
59   virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
60                        const std::list<std::string>& theArguments,
61                        std::string& theError) const;
62
63   /// \return true if the attribute in feature is not obligatory for the feature execution
64   virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
65 };
66
67 #endif