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 FeaturesAPI_RevolutionBoolean_H_
22 #define FeaturesAPI_RevolutionBoolean_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_CompositeBoolean.h>
27 #include <FeaturesPlugin_RevolutionCut.h>
28 #include <FeaturesPlugin_RevolutionFuse.h>
30 #include <ModelHighAPI_Interface.h>
31 #include <ModelHighAPI_Macro.h>
33 class ModelHighAPI_Double;
34 class ModelHighAPI_Dumper;
35 class ModelHighAPI_Reference;
36 class ModelHighAPI_Selection;
38 /// \class FeaturesAPI_RevolutionBoolean
39 /// \ingroup CPPHighAPI
40 /// \brief Interface for RevolutionBoolean feature.
41 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
46 virtual ~FeaturesAPI_RevolutionBoolean();
49 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
50 ModelAPI_AttributeReference, /** Sketch launcher */,
51 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
52 ModelAPI_AttributeSelectionList, /** Base objects */,
53 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
54 ModelAPI_AttributeSelection, /** Axis */,
55 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
56 ModelAPI_AttributeString, /** Creation method */,
57 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
58 ModelAPI_AttributeDouble, /** To angle */,
59 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
60 ModelAPI_AttributeDouble, /** From angle */,
61 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
62 ModelAPI_AttributeSelection, /** To object */,
63 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
64 ModelAPI_AttributeDouble, /** To offset */,
65 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
66 ModelAPI_AttributeSelection, /** From object */,
67 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
68 ModelAPI_AttributeDouble, /** From offset */,
69 booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
70 ModelAPI_AttributeSelectionList, /** Boolean objects */)
72 /// Modify base attribute of the feature.
74 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
76 /// Modify base attribute of the feature.
78 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
80 /// Modify axis_object attribute of the feature.
82 void setAxis(const ModelHighAPI_Selection& theAxis);
84 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
86 void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
88 /// Modify creation_method, to_angle, from_angle attributes of the feature.
90 void setAngle(const ModelHighAPI_Double& theAngle);
92 /// Modify creation_method, to_object, to_offset, from_object,
93 /// from_offset attributes of the feature.
95 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
96 const ModelHighAPI_Double& theToOffset,
97 const ModelHighAPI_Selection& theFromObject,
98 const ModelHighAPI_Double& theFromOffset);
100 /// Modiyfy main_objects attribute of the feature.
102 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
104 /// Dump wrapped feature
106 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
109 /// Constructor without values.
111 explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
114 void execIfBaseNotEmpty();
117 /// \class FeaturesAPI_RevolutionCut
118 /// \ingroup CPPHighAPI
119 /// \brief Interface for RevolutionCut feature.
120 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
124 static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
125 virtual std::string getID() { return ID(); }
127 /// Constructor without values.
129 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
131 /// Constructor with values.
133 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
134 const std::list<ModelHighAPI_Selection>& theBaseObjects,
135 const ModelHighAPI_Selection& theAxis,
136 const ModelHighAPI_Double& theAngle,
137 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
139 /// Constructor with values.
141 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
142 const std::list<ModelHighAPI_Selection>& theBaseObjects,
143 const ModelHighAPI_Selection& theAxis,
144 const ModelHighAPI_Double& theToAngle,
145 const ModelHighAPI_Double& theFromAngle,
146 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
148 /// Constructor with values.
150 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
151 const std::list<ModelHighAPI_Selection>& theBaseObjects,
152 const ModelHighAPI_Selection& theAxis,
153 const ModelHighAPI_Selection& theToObject,
154 const ModelHighAPI_Double& theToOffset,
155 const ModelHighAPI_Selection& theFromObject,
156 const ModelHighAPI_Double& theFromOffset,
157 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
160 /// Pointer on RevolutionCut object.
161 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
163 /// \ingroup CPPHighAPI
164 /// \brief Create RevolutionCut feature.
166 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
167 const std::list<ModelHighAPI_Selection>& theBaseObjects,
168 const ModelHighAPI_Selection& theAxis,
169 const ModelHighAPI_Double& theAngle,
170 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
172 /// \ingroup CPPHighAPI
173 /// \brief Create RevolutionCut feature.
175 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
176 const std::list<ModelHighAPI_Selection>& theBaseObjects,
177 const ModelHighAPI_Selection& theAxis,
178 const ModelHighAPI_Double& theToAngle,
179 const ModelHighAPI_Double& theFromAngle,
180 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
182 /// \ingroup CPPHighAPI
183 /// \brief Create RevolutionCut feature.
185 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
186 const std::list<ModelHighAPI_Selection>& theBaseObjects,
187 const ModelHighAPI_Selection& theAxis,
188 const ModelHighAPI_Selection& theToObject,
189 const ModelHighAPI_Double& theToOffset,
190 const ModelHighAPI_Selection& theFromObject,
191 const ModelHighAPI_Double& theFromOffset,
192 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
194 /// \class FeaturesAPI_RevolutionFuse
195 /// \ingroup CPPHighAPI
196 /// \brief Interface for RevolutionFuse feature.
197 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
201 static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
202 virtual std::string getID() { return ID(); }
204 /// Constructor without values.
206 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
208 /// Constructor with values.
210 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
211 const std::list<ModelHighAPI_Selection>& theBaseObjects,
212 const ModelHighAPI_Selection& theAxis,
213 const ModelHighAPI_Double& theAngle,
214 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
216 /// Constructor with values.
218 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
219 const std::list<ModelHighAPI_Selection>& theBaseObjects,
220 const ModelHighAPI_Selection& theAxis,
221 const ModelHighAPI_Double& theToAngle,
222 const ModelHighAPI_Double& theFromAngle,
223 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
225 /// Constructor with values.
227 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
228 const std::list<ModelHighAPI_Selection>& theBaseObjects,
229 const ModelHighAPI_Selection& theAxis,
230 const ModelHighAPI_Selection& theToObject,
231 const ModelHighAPI_Double& theToOffset,
232 const ModelHighAPI_Selection& theFromObject,
233 const ModelHighAPI_Double& theFromOffset,
234 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
237 /// Pointer on RevolutionFuse object.
238 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
240 /// \ingroup CPPHighAPI
241 /// \brief Create RevolutionFuse feature.
243 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
244 const std::list<ModelHighAPI_Selection>& theBaseObjects,
245 const ModelHighAPI_Selection& theAxis,
246 const ModelHighAPI_Double& theAngle,
247 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
249 /// \ingroup CPPHighAPI
250 /// \brief Create RevolutionFuse feature.
252 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
253 const std::list<ModelHighAPI_Selection>& theBaseObjects,
254 const ModelHighAPI_Selection& theAxis,
255 const ModelHighAPI_Double& theToAngle,
256 const ModelHighAPI_Double& theFromAngle,
257 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
259 /// \ingroup CPPHighAPI
260 /// \brief Create RevolutionFuse feature.
262 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
263 const std::list<ModelHighAPI_Selection>& theBaseObjects,
264 const ModelHighAPI_Selection& theAxis,
265 const ModelHighAPI_Selection& theToObject,
266 const ModelHighAPI_Double& theToOffset,
267 const ModelHighAPI_Selection& theFromObject,
268 const ModelHighAPI_Double& theFromOffset,
269 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
271 #endif // FeaturesAPI_RevolutionBoolean_H_