1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef BuildPlugin_Validators_H_
22 #define BuildPlugin_Validators_H_
24 #include <ModelAPI_AttributeValidator.h>
25 #include <ModelAPI_FeatureValidator.h>
27 /// \class BuildPlugin_ValidatorBaseForBuild
28 /// \ingroup Validators
29 /// \brief A validator for selection base shapes for build features.
30 /// Allows to select shapes on sketch and
31 /// whole objects with allowed type.
32 class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator
35 //! Returns true if attribute is ok.
36 //! \param[in] theAttribute the checked attribute.
37 //! \param[in] theArguments arguments of the attribute.
38 //! \param[out] theError error message.
39 virtual bool isValid(const AttributePtr& theAttribute,
40 const std::list<std::string>& theArguments,
41 Events_InfoMessage& theError) const;
44 /// \class BuildPlugin_ValidatorBaseForWire
45 /// \ingroup Validators
46 /// \brief A validator for selection base shapes for wire. Allows to select edges on sketch and
47 /// wires objects that are connected to already selected shapes.
48 class BuildPlugin_ValidatorBaseForWire: public ModelAPI_FeatureValidator
51 //! Returns true if attributes is ok.
52 //! \param theFeature the checked feature.
53 //! \param theArguments arguments of the feature.
54 //! \param theError error message.
55 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56 const std::list<std::string>& theArguments,
57 Events_InfoMessage& theError) const;
60 /// \class BuildPlugin_ValidatorBaseForFace
61 /// \ingroup Validators
62 /// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
63 /// wires objects that lie in the same plane and don't have intersections.
64 class BuildPlugin_ValidatorBaseForFace: public ModelAPI_FeatureValidator
67 //! Returns true if attributes is ok.
68 //! \param theFeature the checked feature.
69 //! \param theArguments arguments of the feature.
70 //! \param theError error message.
71 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
72 const std::list<std::string>& theArguments,
73 Events_InfoMessage& theError) const;
76 /// \class BuildPlugin_ValidatorBaseForSolids
77 /// \ingroup Validators
78 /// \brief A validator for selection base shapes for solid. Allows to select faces closed enough
79 /// to create a solid.
80 class BuildPlugin_ValidatorBaseForSolids: public ModelAPI_FeatureValidator
83 //! Returns true if attributes is ok.
84 //! \param theFeature the checked feature.
85 //! \param theArguments arguments of the feature.
86 //! \param theError error message.
87 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
88 const std::list<std::string>& theArguments,
89 Events_InfoMessage& theError) const;
92 /// \class BuildPlugin_ValidatorSubShapesSelection
93 /// \ingroup Validators
94 /// \brief A validator for selection sub-shapes for SubShape feature.
95 class BuildPlugin_ValidatorSubShapesSelection: public ModelAPI_AttributeValidator
98 //! Returns true if attribute is ok.
99 //! \param[in] theAttribute the checked attribute.
100 //! \param[in] theArguments arguments of the attribute.
101 //! \param[out] theError error message.
102 virtual bool isValid(const AttributePtr& theAttribute,
103 const std::list<std::string>& theArguments,
104 Events_InfoMessage& theError) const;
107 /// \class BuildPlugin_ValidatorFillingSelection
108 /// \ingroup Validators
109 /// \brief A validator for selection of Filling feature.
110 class BuildPlugin_ValidatorFillingSelection: public ModelAPI_AttributeValidator
113 //! Returns true if attribute is ok.
114 //! \param[in] theAttribute the checked attribute.
115 //! \param[in] theArguments arguments of the attribute.
116 //! \param[out] theError error message.
117 virtual bool isValid(const AttributePtr& theAttribute,
118 const std::list<std::string>& theArguments,
119 Events_InfoMessage& theError) const;