1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef BuildPlugin_Validators_H_
21 #define BuildPlugin_Validators_H_
23 #include <ModelAPI_AttributeValidator.h>
24 #include <ModelAPI_FeatureValidator.h>
26 /// \class BuildPlugin_ValidatorBaseForBuild
27 /// \ingroup Validators
28 /// \brief A validator for selection base shapes for build features.
29 /// Allows to select shapes on sketch and
30 /// whole objects with allowed type.
31 class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator
34 //! Returns true if attribute is ok.
35 //! \param[in] theAttribute the checked attribute.
36 //! \param[in] theArguments arguments of the attribute.
37 //! \param[out] theError error message.
38 virtual bool isValid(const AttributePtr& theAttribute,
39 const std::list<std::string>& theArguments,
40 Events_InfoMessage& theError) const;
43 /// \class BuildPlugin_ValidatorBaseForWire
44 /// \ingroup Validators
45 /// \brief A validator for selection base shapes for wire. Allows to select edges on sketch and
46 /// wires objects that are connected to already selected shapes.
47 class BuildPlugin_ValidatorBaseForWire: public ModelAPI_FeatureValidator
50 //! Returns true if attributes is ok.
51 //! \param theFeature the checked feature.
52 //! \param theArguments arguments of the feature.
53 //! \param theError error message.
54 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const std::list<std::string>& theArguments,
56 Events_InfoMessage& theError) const;
59 /// \class BuildPlugin_ValidatorBaseForFace
60 /// \ingroup Validators
61 /// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
62 /// wires objects that lie in the same plane and don't have intersections.
63 class BuildPlugin_ValidatorBaseForFace: public ModelAPI_FeatureValidator
66 //! Returns true if attributes is ok.
67 //! \param theFeature the checked feature.
68 //! \param theArguments arguments of the feature.
69 //! \param theError error message.
70 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
71 const std::list<std::string>& theArguments,
72 Events_InfoMessage& theError) const;
75 /// \class BuildPlugin_ValidatorBaseForSolids
76 /// \ingroup Validators
77 /// \brief A validator for selection base shapes for solid. Allows to select faces closed enough
78 /// to create a solid.
79 class BuildPlugin_ValidatorBaseForSolids: public ModelAPI_FeatureValidator
82 //! Returns true if attributes is ok.
83 //! \param theFeature the checked feature.
84 //! \param theArguments arguments of the feature.
85 //! \param theError error message.
86 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
87 const std::list<std::string>& theArguments,
88 Events_InfoMessage& theError) const;
91 /// \class BuildPlugin_ValidatorSubShapesSelection
92 /// \ingroup Validators
93 /// \brief A validator for selection sub-shapes for SubShape feature.
94 class BuildPlugin_ValidatorSubShapesSelection: public ModelAPI_AttributeValidator
97 //! Returns true if attribute is ok.
98 //! \param[in] theAttribute the checked attribute.
99 //! \param[in] theArguments arguments of the attribute.
100 //! \param[out] theError error message.
101 virtual bool isValid(const AttributePtr& theAttribute,
102 const std::list<std::string>& theArguments,
103 Events_InfoMessage& theError) const;
106 /// \class BuildPlugin_ValidatorFillingSelection
107 /// \ingroup Validators
108 /// \brief A validator for selection of Filling feature.
109 class BuildPlugin_ValidatorFillingSelection: public ModelAPI_AttributeValidator
112 //! Returns true if attribute is ok.
113 //! \param[in] theAttribute the checked attribute.
114 //! \param[in] theArguments arguments of the attribute.
115 //! \param[out] theError error message.
116 virtual bool isValid(const AttributePtr& theAttribute,
117 const std::list<std::string>& theArguments,
118 Events_InfoMessage& theError) const;
121 /// \class BuildPlugin_ValidatorBaseForVertex
122 /// \ingroup Validators
123 /// \brief A validator for selection of Vertex feature.
124 class BuildPlugin_ValidatorBaseForVertex: public ModelAPI_AttributeValidator
127 //! Returns true if attribute is ok.
128 //! \param[in] theAttribute the checked attribute.
129 //! \param[in] theArguments arguments of the attribute.
130 //! \param[out] theError error message.
131 virtual bool isValid(const AttributePtr& theAttribute,
132 const std::list<std::string>& theArguments,
133 Events_InfoMessage& theError) const;