1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_RevolutionBoolean.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_RevolutionBoolean_H_
8 #define FeaturesAPI_RevolutionBoolean_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_CompositeBoolean.h>
13 #include <FeaturesPlugin_RevolutionCut.h>
14 #include <FeaturesPlugin_RevolutionFuse.h>
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
19 class ModelHighAPI_Double;
20 class ModelHighAPI_Dumper;
21 class ModelHighAPI_Reference;
22 class ModelHighAPI_Selection;
24 /// \class FeaturesAPI_RevolutionBoolean
25 /// \ingroup CPPHighAPI
26 /// \brief Interface for RevolutionBoolean feature.
27 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
32 virtual ~FeaturesAPI_RevolutionBoolean();
35 sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
36 ModelAPI_AttributeReference, /** Sketch launcher */,
37 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
38 ModelAPI_AttributeSelectionList, /** Base objects */,
39 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
40 ModelAPI_AttributeSelection, /** Axis */,
41 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
42 ModelAPI_AttributeString, /** Creation method */,
43 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
44 ModelAPI_AttributeDouble, /** To angle */,
45 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
46 ModelAPI_AttributeDouble, /** From angle */,
47 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
48 ModelAPI_AttributeSelection, /** To object */,
49 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
50 ModelAPI_AttributeDouble, /** To offset */,
51 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
52 ModelAPI_AttributeSelection, /** From object */,
53 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
54 ModelAPI_AttributeDouble, /** From offset */,
55 booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
56 ModelAPI_AttributeSelectionList, /** Boolean objects */)
58 /// Modify base attribute of the feature.
60 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
62 /// Modify base attribute of the feature.
64 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
66 /// Modify axis_object attribute of the feature.
68 void setAxis(const ModelHighAPI_Selection& theAxis);
70 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
72 void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
74 /// Modify creation_method, to_angle, from_angle attributes of the feature.
76 void setAngle(const ModelHighAPI_Double& theAngle);
78 /// Modify creation_method, to_object, to_offset, from_object,
79 /// from_offset attributes of the feature.
81 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
82 const ModelHighAPI_Double& theToOffset,
83 const ModelHighAPI_Selection& theFromObject,
84 const ModelHighAPI_Double& theFromOffset);
86 /// Modiyfy main_objects attribute of the feature.
88 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
90 /// Dump wrapped feature
92 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95 /// Constructor without values.
97 explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
100 void execIfBaseNotEmpty();
103 /// \class FeaturesAPI_RevolutionCut
104 /// \ingroup CPPHighAPI
105 /// \brief Interface for RevolutionCut feature.
106 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
110 static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
111 virtual std::string getID() { return ID(); }
113 /// Constructor without values.
115 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
117 /// Constructor with values.
119 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
120 const std::list<ModelHighAPI_Selection>& theBaseObjects,
121 const ModelHighAPI_Selection& theAxis,
122 const ModelHighAPI_Double& theAngle,
123 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
125 /// Constructor with values.
127 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
128 const std::list<ModelHighAPI_Selection>& theBaseObjects,
129 const ModelHighAPI_Selection& theAxis,
130 const ModelHighAPI_Double& theToAngle,
131 const ModelHighAPI_Double& theFromAngle,
132 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
134 /// Constructor with values.
136 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
137 const std::list<ModelHighAPI_Selection>& theBaseObjects,
138 const ModelHighAPI_Selection& theAxis,
139 const ModelHighAPI_Selection& theToObject,
140 const ModelHighAPI_Double& theToOffset,
141 const ModelHighAPI_Selection& theFromObject,
142 const ModelHighAPI_Double& theFromOffset,
143 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
146 /// Pointer on RevolutionCut object.
147 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
149 /// \ingroup CPPHighAPI
150 /// \brief Create RevolutionCut feature.
152 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
153 const std::list<ModelHighAPI_Selection>& theBaseObjects,
154 const ModelHighAPI_Selection& theAxis,
155 const ModelHighAPI_Double& theAngle,
156 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
158 /// \ingroup CPPHighAPI
159 /// \brief Create RevolutionCut feature.
161 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
162 const std::list<ModelHighAPI_Selection>& theBaseObjects,
163 const ModelHighAPI_Selection& theAxis,
164 const ModelHighAPI_Double& theToAngle,
165 const ModelHighAPI_Double& theFromAngle,
166 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
168 /// \ingroup CPPHighAPI
169 /// \brief Create RevolutionCut feature.
171 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
172 const std::list<ModelHighAPI_Selection>& theBaseObjects,
173 const ModelHighAPI_Selection& theAxis,
174 const ModelHighAPI_Selection& theToObject,
175 const ModelHighAPI_Double& theToOffset,
176 const ModelHighAPI_Selection& theFromObject,
177 const ModelHighAPI_Double& theFromOffset,
178 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
180 /// \class FeaturesAPI_RevolutionFuse
181 /// \ingroup CPPHighAPI
182 /// \brief Interface for RevolutionFuse feature.
183 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
187 static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
188 virtual std::string getID() { return ID(); }
190 /// Constructor without values.
192 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
194 /// Constructor with values.
196 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
197 const std::list<ModelHighAPI_Selection>& theBaseObjects,
198 const ModelHighAPI_Selection& theAxis,
199 const ModelHighAPI_Double& theAngle,
200 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
202 /// Constructor with values.
204 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
205 const std::list<ModelHighAPI_Selection>& theBaseObjects,
206 const ModelHighAPI_Selection& theAxis,
207 const ModelHighAPI_Double& theToAngle,
208 const ModelHighAPI_Double& theFromAngle,
209 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
211 /// Constructor with values.
213 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
214 const std::list<ModelHighAPI_Selection>& theBaseObjects,
215 const ModelHighAPI_Selection& theAxis,
216 const ModelHighAPI_Selection& theToObject,
217 const ModelHighAPI_Double& theToOffset,
218 const ModelHighAPI_Selection& theFromObject,
219 const ModelHighAPI_Double& theFromOffset,
220 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
223 /// Pointer on RevolutionFuse object.
224 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
226 /// \ingroup CPPHighAPI
227 /// \brief Create RevolutionFuse feature.
229 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
230 const std::list<ModelHighAPI_Selection>& theBaseObjects,
231 const ModelHighAPI_Selection& theAxis,
232 const ModelHighAPI_Double& theAngle,
233 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
235 /// \ingroup CPPHighAPI
236 /// \brief Create RevolutionFuse feature.
238 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
239 const std::list<ModelHighAPI_Selection>& theBaseObjects,
240 const ModelHighAPI_Selection& theAxis,
241 const ModelHighAPI_Double& theToAngle,
242 const ModelHighAPI_Double& theFromAngle,
243 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
245 /// \ingroup CPPHighAPI
246 /// \brief Create RevolutionFuse feature.
248 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
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);
257 #endif // FeaturesAPI_RevolutionBoolean_H_