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;
59 /// \return true if the attribute in feature is not obligatory for the feature execution
60 virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
63 /// \class BuildPlugin_ValidatorBaseForFace
64 /// \ingroup Validators
65 /// \brief A validator for selection base shapes for face. Allows to select sketch edges, edges and
66 /// wires objects that lie in the same plane and don't have intersections.
67 class BuildPlugin_ValidatorBaseForFace: public ModelAPI_FeatureValidator
70 //! Returns true if attributes is ok.
71 //! \param theFeature the checked feature.
72 //! \param theArguments arguments of the feature.
73 //! \param theError error message.
74 virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
75 const std::list<std::string>& theArguments,
76 Events_InfoMessage& theError) const;
78 /// \return true if the attribute in feature is not obligatory for the feature execution
79 virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
82 /// \class BuildPlugin_ValidatorSubShapesSelection
83 /// \ingroup Validators
84 /// \brief A validator for selection sub-shapes for SubShape feature.
85 class BuildPlugin_ValidatorSubShapesSelection: public ModelAPI_AttributeValidator
88 //! Returns true if attribute is ok.
89 //! \param[in] theAttribute the checked attribute.
90 //! \param[in] theArguments arguments of the attribute.
91 //! \param[out] theError error message.
92 virtual bool isValid(const AttributePtr& theAttribute,
93 const std::list<std::string>& theArguments,
94 Events_InfoMessage& theError) const;
97 /// \class BuildPlugin_ValidatorFillingSelection
98 /// \ingroup Validators
99 /// \brief A validator for selection of Filling feature.
100 class BuildPlugin_ValidatorFillingSelection: public ModelAPI_AttributeValidator
103 //! Returns true if attribute is ok.
104 //! \param[in] theAttribute the checked attribute.
105 //! \param[in] theArguments arguments of the attribute.
106 //! \param[out] theError error message.
107 virtual bool isValid(const AttributePtr& theAttribute,
108 const std::list<std::string>& theArguments,
109 Events_InfoMessage& theError) const;