1 // Copyright (C) 2017-2021 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 FeaturesAPI_Fillet_H_
21 #define FeaturesAPI_Fillet_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_Fillet.h>
26 #include <FeaturesPlugin_Fillet1D.h>
28 #include <ModelHighAPI_Double.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
32 class ModelHighAPI_Selection;
34 /// \class FeaturesAPI_Fillet
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Fillet feature.
37 class FeaturesAPI_Fillet: public ModelHighAPI_Interface
41 virtual ~FeaturesAPI_Fillet() {}
43 virtual std::shared_ptr<ModelAPI_AttributeDouble> radius() const = 0;
45 /// Modify base objects of the fillet.
46 virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects) = 0;
48 /// Modify fillet to have fixed radius
49 virtual void setRadius(const ModelHighAPI_Double& theRadius) = 0;
52 FeaturesAPI_Fillet(const std::shared_ptr<ModelAPI_Feature>& theFeature);
55 /// Pointer on the fillet object.
56 typedef std::shared_ptr<FeaturesAPI_Fillet> FilletPtr;
59 /// \class FeaturesAPI_Fillet1D
60 /// \ingroup CPPHighAPI
61 /// \brief Interface for Fillet1D feature - fillet on vertices of a wire.
62 class FeaturesAPI_Fillet1D : public FeaturesAPI_Fillet
65 /// Constructor without values.
67 explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature);
69 /// Constructor with values.
71 explicit FeaturesAPI_Fillet1D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
72 const std::list<ModelHighAPI_Selection>& theBaseObjects,
73 const ModelHighAPI_Double& theRadius);
77 virtual ~FeaturesAPI_Fillet1D();
79 INTERFACE_4(FeaturesPlugin_Fillet1D::ID(),
80 creationMethod, FeaturesPlugin_Fillet1D::CREATION_METHOD(),
81 ModelAPI_AttributeString,
82 /** Creation method */,
83 baseWires, FeaturesPlugin_Fillet1D::WIRE_LIST_ID(),
84 ModelAPI_AttributeSelectionList,
86 baseVertices, FeaturesPlugin_Fillet1D::VERTEX_LIST_ID(),
87 ModelAPI_AttributeSelectionList,
89 radius, FeaturesPlugin_Fillet1D::RADIUS_ID(),
90 ModelAPI_AttributeDouble,
91 /** Value of the fixed radius fillet */)
93 /// Modify base objects of the fillet.
95 virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
97 /// Modify fillet to have fixed radius
99 virtual void setRadius(const ModelHighAPI_Double& theRadius);
101 /// Dump wrapped feature
103 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106 void execIfBaseNotEmpty();
110 /// \class FeaturesAPI_Fillet2D
111 /// \ingroup CPPHighAPI
112 /// \brief Interface for Fillet feature - fillet edges on a solid.
113 class FeaturesAPI_Fillet2D : public FeaturesAPI_Fillet
116 /// Constructor without values.
118 explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature);
120 /// Constructor with values.
122 explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
123 const std::list<ModelHighAPI_Selection>& theBaseObjects,
124 const ModelHighAPI_Double& theRadius);
126 /// Constructor with values.
128 explicit FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Feature>& theFeature,
129 const std::list<ModelHighAPI_Selection>& theBaseObjects,
130 const ModelHighAPI_Double& theRadius1,
131 const ModelHighAPI_Double& theRadius2);
135 virtual ~FeaturesAPI_Fillet2D();
137 INTERFACE_5(FeaturesPlugin_Fillet::ID(),
138 creationMethod, FeaturesPlugin_Fillet::CREATION_METHOD(),
139 ModelAPI_AttributeString,
140 /** Creation method */,
141 baseObjects, FeaturesPlugin_Fillet::OBJECT_LIST_ID(),
142 ModelAPI_AttributeSelectionList,
144 radius, FeaturesPlugin_Fillet::RADIUS_ID(),
145 ModelAPI_AttributeDouble,
146 /** Value of the fixed radius fillet */,
147 startRadius, FeaturesPlugin_Fillet::START_RADIUS_ID(),
148 ModelAPI_AttributeDouble,
149 /** Start radius of the varying radius fillet */,
150 endRadius, FeaturesPlugin_Fillet::END_RADIUS_ID(),
151 ModelAPI_AttributeDouble,
152 /** End radius of the varying radius fillet */)
154 /// Modify base objects of the fillet.
156 virtual void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
158 /// Modify fillet to have fixed radius
160 virtual void setRadius(const ModelHighAPI_Double& theRadius);
162 /// Modify fillet to have varying radius
164 void setRadius(const ModelHighAPI_Double& theRadius1, const ModelHighAPI_Double& theRadius2);
166 /// Dump wrapped feature
168 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
171 void execIfBaseNotEmpty();
175 /// \ingroup CPPHighAPI
176 /// \brief Create Fillet feature.
178 FilletPtr addFillet(const std::shared_ptr<ModelAPI_Document>& thePart,
179 const std::list<ModelHighAPI_Selection>& theBaseObjects,
180 const ModelHighAPI_Double& theRadius1,
181 const ModelHighAPI_Double& theRadius2 = ModelHighAPI_Double(-1.0),
182 const bool keepSubResults = false);
184 #endif // FeaturesAPI_Fillet_H_