1 // Copyright (C) 2014-2019 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_RevolutionBoolean_H_
21 #define FeaturesAPI_RevolutionBoolean_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_CompositeBoolean.h>
26 #include <FeaturesPlugin_RevolutionCut.h>
27 #include <FeaturesPlugin_RevolutionFuse.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
32 class ModelHighAPI_Double;
33 class ModelHighAPI_Dumper;
34 class ModelHighAPI_Reference;
35 class ModelHighAPI_Selection;
37 /// \class FeaturesAPI_RevolutionBoolean
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for RevolutionBoolean feature.
40 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
45 virtual ~FeaturesAPI_RevolutionBoolean();
48 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
49 ModelAPI_AttributeReference, /** Sketch launcher */,
50 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
51 ModelAPI_AttributeSelectionList, /** Base objects */,
52 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
53 ModelAPI_AttributeSelection, /** Axis */,
54 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
55 ModelAPI_AttributeString, /** Creation method */,
56 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
57 ModelAPI_AttributeDouble, /** To angle */,
58 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
59 ModelAPI_AttributeDouble, /** From angle */,
60 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
61 ModelAPI_AttributeSelection, /** To object */,
62 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
63 ModelAPI_AttributeDouble, /** To offset */,
64 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
65 ModelAPI_AttributeSelection, /** From object */,
66 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
67 ModelAPI_AttributeDouble, /** From offset */,
68 booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
69 ModelAPI_AttributeSelectionList, /** Boolean objects */)
71 /// Modify base attribute of the feature.
73 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
75 /// Modify base attribute of the feature.
77 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
79 /// Modify axis_object attribute of the feature.
81 void setAxis(const ModelHighAPI_Selection& theAxis);
83 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
85 void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
87 /// Modify creation_method, to_angle, from_angle attributes of the feature.
89 void setAngle(const ModelHighAPI_Double& theAngle);
91 /// Modify creation_method, to_object, to_offset, from_object,
92 /// from_offset attributes of the feature.
94 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
95 const ModelHighAPI_Double& theToOffset,
96 const ModelHighAPI_Selection& theFromObject,
97 const ModelHighAPI_Double& theFromOffset);
99 /// Modiyfy main_objects attribute of the feature.
101 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
103 /// Dump wrapped feature
105 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
108 /// Constructor without values.
110 explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
113 void execIfBaseNotEmpty();
116 /// \class FeaturesAPI_RevolutionCut
117 /// \ingroup CPPHighAPI
118 /// \brief Interface for RevolutionCut feature.
119 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
123 static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
124 virtual std::string getID() { return ID(); }
126 /// Constructor without values.
128 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
130 /// Constructor with values.
132 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
133 const std::list<ModelHighAPI_Selection>& theBaseObjects,
134 const ModelHighAPI_Selection& theAxis,
135 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
137 /// Constructor with values.
139 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
140 const std::list<ModelHighAPI_Selection>& theBaseObjects,
141 const ModelHighAPI_Selection& theAxis,
142 const ModelHighAPI_Double& theAngle,
143 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
145 /// Constructor with values.
147 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
148 const std::list<ModelHighAPI_Selection>& theBaseObjects,
149 const ModelHighAPI_Selection& theAxis,
150 const ModelHighAPI_Double& theToAngle,
151 const ModelHighAPI_Double& theFromAngle,
152 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
154 /// Constructor with values.
156 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
157 const std::list<ModelHighAPI_Selection>& theBaseObjects,
158 const ModelHighAPI_Selection& theAxis,
159 const ModelHighAPI_Selection& theToObject,
160 const ModelHighAPI_Double& theToOffset,
161 const ModelHighAPI_Selection& theFromObject,
162 const ModelHighAPI_Double& theFromOffset,
163 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
166 /// Pointer on RevolutionCut object.
167 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
169 /// \ingroup CPPHighAPI
170 /// \brief Create RevolutionCut feature.
172 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
173 const std::list<ModelHighAPI_Selection>& theBaseObjects,
174 const ModelHighAPI_Selection& theAxis,
175 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
177 /// \ingroup CPPHighAPI
178 /// \brief Create RevolutionCut feature.
180 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
181 const std::list<ModelHighAPI_Selection>& theBaseObjects,
182 const ModelHighAPI_Selection& theAxis,
183 const ModelHighAPI_Double& theAngle,
184 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
186 /// \ingroup CPPHighAPI
187 /// \brief Create RevolutionCut feature.
189 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
190 const std::list<ModelHighAPI_Selection>& theBaseObjects,
191 const ModelHighAPI_Selection& theAxis,
192 const ModelHighAPI_Double& theToAngle,
193 const ModelHighAPI_Double& theFromAngle,
194 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
196 /// \ingroup CPPHighAPI
197 /// \brief Create RevolutionCut feature.
199 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
200 const std::list<ModelHighAPI_Selection>& theBaseObjects,
201 const ModelHighAPI_Selection& theAxis,
202 const ModelHighAPI_Selection& theToObject,
203 const ModelHighAPI_Double& theToOffset,
204 const ModelHighAPI_Selection& theFromObject,
205 const ModelHighAPI_Double& theFromOffset,
206 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
208 /// \class FeaturesAPI_RevolutionFuse
209 /// \ingroup CPPHighAPI
210 /// \brief Interface for RevolutionFuse feature.
211 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
215 static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
216 virtual std::string getID() { return ID(); }
218 /// Constructor without values.
220 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
222 /// Constructor with values.
224 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
225 const std::list<ModelHighAPI_Selection>& theBaseObjects,
226 const ModelHighAPI_Selection& theAxis,
227 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
229 /// Constructor with values.
231 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
232 const std::list<ModelHighAPI_Selection>& theBaseObjects,
233 const ModelHighAPI_Selection& theAxis,
234 const ModelHighAPI_Double& theAngle,
235 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
237 /// Constructor with values.
239 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
240 const std::list<ModelHighAPI_Selection>& theBaseObjects,
241 const ModelHighAPI_Selection& theAxis,
242 const ModelHighAPI_Double& theToAngle,
243 const ModelHighAPI_Double& theFromAngle,
244 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
246 /// Constructor with values.
248 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
249 const std::list<ModelHighAPI_Selection>& theBaseObjects,
250 const ModelHighAPI_Selection& theAxis,
251 const ModelHighAPI_Selection& theToObject,
252 const ModelHighAPI_Double& theToOffset,
253 const ModelHighAPI_Selection& theFromObject,
254 const ModelHighAPI_Double& theFromOffset,
255 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
258 /// Pointer on RevolutionFuse object.
259 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
261 /// \ingroup CPPHighAPI
262 /// \brief Create RevolutionFuse feature.
264 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
265 const std::list<ModelHighAPI_Selection>& theBaseObjects,
266 const ModelHighAPI_Selection& theAxis,
267 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
269 /// \ingroup CPPHighAPI
270 /// \brief Create RevolutionFuse feature.
272 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
273 const std::list<ModelHighAPI_Selection>& theBaseObjects,
274 const ModelHighAPI_Selection& theAxis,
275 const ModelHighAPI_Double& theAngle,
276 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
278 /// \ingroup CPPHighAPI
279 /// \brief Create RevolutionFuse feature.
281 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
282 const std::list<ModelHighAPI_Selection>& theBaseObjects,
283 const ModelHighAPI_Selection& theAxis,
284 const ModelHighAPI_Double& theToAngle,
285 const ModelHighAPI_Double& theFromAngle,
286 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
288 /// \ingroup CPPHighAPI
289 /// \brief Create RevolutionFuse feature.
291 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
292 const std::list<ModelHighAPI_Selection>& theBaseObjects,
293 const ModelHighAPI_Selection& theAxis,
294 const ModelHighAPI_Selection& theToObject,
295 const ModelHighAPI_Double& theToOffset,
296 const ModelHighAPI_Selection& theFromObject,
297 const ModelHighAPI_Double& theFromOffset,
298 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
300 #endif // FeaturesAPI_RevolutionBoolean_H_