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(), ModelAPI_AttributeReference, /** Sketch launcher */,
36 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
37 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
38 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
39 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
40 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
41 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
42 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
43 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
44 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
45 booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
47 /// Modify base attribute of the feature.
49 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
51 /// Modify base attribute of the feature.
53 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
55 /// Modify axis_object attribute of the feature.
57 void setAxis(const ModelHighAPI_Selection& theAxis);
59 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
61 void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
63 /// Modify creation_method, to_angle, from_angle attributes of the feature.
65 void setAngle(const ModelHighAPI_Double& theAngle);
67 /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
69 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
70 const ModelHighAPI_Double& theToOffset,
71 const ModelHighAPI_Selection& theFromObject,
72 const ModelHighAPI_Double& theFromOffset);
74 /// Modiyfy main_objects attribute of the feature.
76 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
78 /// Dump wrapped feature
80 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
83 /// Constructor without values.
85 explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
88 void execIfBaseNotEmpty();
91 /// \class FeaturesAPI_RevolutionCut
92 /// \ingroup CPPHighAPI
93 /// \brief Interface for RevolutionCut feature.
94 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
98 static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
99 virtual std::string getID() { return ID(); }
101 /// Constructor without values.
103 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
105 /// Constructor with values.
107 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
108 const std::list<ModelHighAPI_Selection>& theBaseObjects,
109 const ModelHighAPI_Selection& theAxis,
110 const ModelHighAPI_Double& theAngle,
111 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
113 /// Constructor with values.
115 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
116 const std::list<ModelHighAPI_Selection>& theBaseObjects,
117 const ModelHighAPI_Selection& theAxis,
118 const ModelHighAPI_Double& theToAngle,
119 const ModelHighAPI_Double& theFromAngle,
120 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
122 /// Constructor with values.
124 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
125 const std::list<ModelHighAPI_Selection>& theBaseObjects,
126 const ModelHighAPI_Selection& theAxis,
127 const ModelHighAPI_Selection& theToObject,
128 const ModelHighAPI_Double& theToOffset,
129 const ModelHighAPI_Selection& theFromObject,
130 const ModelHighAPI_Double& theFromOffset,
131 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
134 /// Pointer on RevolutionCut object.
135 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
137 /// \ingroup CPPHighAPI
138 /// \brief Create RevolutionCut feature.
140 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
141 const std::list<ModelHighAPI_Selection>& theBaseObjects,
142 const ModelHighAPI_Selection& theAxis,
143 const ModelHighAPI_Double& theAngle,
144 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
146 /// \ingroup CPPHighAPI
147 /// \brief Create RevolutionCut feature.
149 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
150 const std::list<ModelHighAPI_Selection>& theBaseObjects,
151 const ModelHighAPI_Selection& theAxis,
152 const ModelHighAPI_Double& theToAngle,
153 const ModelHighAPI_Double& theFromAngle,
154 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
156 /// \ingroup CPPHighAPI
157 /// \brief Create RevolutionCut feature.
159 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
160 const std::list<ModelHighAPI_Selection>& theBaseObjects,
161 const ModelHighAPI_Selection& theAxis,
162 const ModelHighAPI_Selection& theToObject,
163 const ModelHighAPI_Double& theToOffset,
164 const ModelHighAPI_Selection& theFromObject,
165 const ModelHighAPI_Double& theFromOffset,
166 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
168 /// \class FeaturesAPI_RevolutionFuse
169 /// \ingroup CPPHighAPI
170 /// \brief Interface for RevolutionFuse feature.
171 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
175 static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
176 virtual std::string getID() { return ID(); }
178 /// Constructor without values.
180 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
182 /// Constructor with values.
184 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
185 const std::list<ModelHighAPI_Selection>& theBaseObjects,
186 const ModelHighAPI_Selection& theAxis,
187 const ModelHighAPI_Double& theAngle,
188 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
190 /// Constructor with values.
192 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
193 const std::list<ModelHighAPI_Selection>& theBaseObjects,
194 const ModelHighAPI_Selection& theAxis,
195 const ModelHighAPI_Double& theToAngle,
196 const ModelHighAPI_Double& theFromAngle,
197 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
199 /// Constructor with values.
201 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
202 const std::list<ModelHighAPI_Selection>& theBaseObjects,
203 const ModelHighAPI_Selection& theAxis,
204 const ModelHighAPI_Selection& theToObject,
205 const ModelHighAPI_Double& theToOffset,
206 const ModelHighAPI_Selection& theFromObject,
207 const ModelHighAPI_Double& theFromOffset,
208 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
211 /// Pointer on RevolutionFuse object.
212 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
214 /// \ingroup CPPHighAPI
215 /// \brief Create RevolutionFuse feature.
217 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
218 const std::list<ModelHighAPI_Selection>& theBaseObjects,
219 const ModelHighAPI_Selection& theAxis,
220 const ModelHighAPI_Double& theAngle,
221 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
223 /// \ingroup CPPHighAPI
224 /// \brief Create RevolutionFuse feature.
226 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
227 const std::list<ModelHighAPI_Selection>& theBaseObjects,
228 const ModelHighAPI_Selection& theAxis,
229 const ModelHighAPI_Double& theToAngle,
230 const ModelHighAPI_Double& theFromAngle,
231 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
233 /// \ingroup CPPHighAPI
234 /// \brief Create RevolutionFuse feature.
236 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
237 const std::list<ModelHighAPI_Selection>& theBaseObjects,
238 const ModelHighAPI_Selection& theAxis,
239 const ModelHighAPI_Selection& theToObject,
240 const ModelHighAPI_Double& theToOffset,
241 const ModelHighAPI_Selection& theFromObject,
242 const ModelHighAPI_Double& theFromOffset,
243 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
245 #endif // FeaturesAPI_RevolutionBoolean_H_