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_Selection;
22 /// \class FeaturesAPI_RevolutionBoolean
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for RevolutionBoolean feature.
25 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
30 virtual ~FeaturesAPI_RevolutionBoolean();
33 sketchLauncher, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
34 baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
35 axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
36 creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
37 toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
38 fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
39 toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
40 toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
41 fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
42 fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
43 booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
45 /// Modify base attribute of the feature.
47 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
49 /// Modify axis_object attribute of the feature.
51 void setAxis(const ModelHighAPI_Selection& theAxis);
53 /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
55 void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
57 /// Modify creation_method, to_angle, from_angle attributes of the feature.
59 void setAngle(const ModelHighAPI_Double& theAngle);
61 /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
63 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
64 const ModelHighAPI_Double& theToOffset,
65 const ModelHighAPI_Selection& theFromObject,
66 const ModelHighAPI_Double& theFromOffset);
68 /// Modiyfy main_objects attribute of the feature.
70 void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
73 /// Constructor without values.
75 explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
78 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
82 virtual std::string getID() {
83 return FeaturesPlugin_RevolutionCut::ID();
86 /// Constructor without values.
88 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
90 /// Constructor with values.
92 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
93 const std::list<ModelHighAPI_Selection>& theBaseObjects,
94 const ModelHighAPI_Selection& theAxis,
95 const ModelHighAPI_Double& theAngle,
96 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
98 /// Constructor with values.
100 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
101 const std::list<ModelHighAPI_Selection>& theBaseObjects,
102 const ModelHighAPI_Selection& theAxis,
103 const ModelHighAPI_Double& theToAngle,
104 const ModelHighAPI_Double& theFromAngle,
105 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
107 /// Constructor with values.
109 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
110 const std::list<ModelHighAPI_Selection>& theBaseObjects,
111 const ModelHighAPI_Selection& theAxis,
112 const ModelHighAPI_Selection& theToObject,
113 const ModelHighAPI_Double& theToOffset,
114 const ModelHighAPI_Selection& theFromObject,
115 const ModelHighAPI_Double& theFromOffset,
116 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
119 /// Pointer on RevolutionCut object.
120 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
122 /// \ingroup CPPHighAPI
123 /// \brief Create RevolutionCut feature.
125 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
126 const std::list<ModelHighAPI_Selection>& theBaseObjects,
127 const ModelHighAPI_Selection& theAxis,
128 const ModelHighAPI_Double& theAngle,
129 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
131 /// \ingroup CPPHighAPI
132 /// \brief Create RevolutionCut feature.
134 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
135 const std::list<ModelHighAPI_Selection>& theBaseObjects,
136 const ModelHighAPI_Selection& theAxis,
137 const ModelHighAPI_Double& theToAngle,
138 const ModelHighAPI_Double& theFromAngle,
139 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
141 /// \ingroup CPPHighAPI
142 /// \brief Create RevolutionCut feature.
144 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
145 const std::list<ModelHighAPI_Selection>& theBaseObjects,
146 const ModelHighAPI_Selection& theAxis,
147 const ModelHighAPI_Selection& theToObject,
148 const ModelHighAPI_Double& theToOffset,
149 const ModelHighAPI_Selection& theFromObject,
150 const ModelHighAPI_Double& theFromOffset,
151 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
153 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
157 virtual std::string getID() {
158 return FeaturesPlugin_RevolutionFuse::ID();
161 /// Constructor without values.
163 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
165 /// Constructor with values.
167 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
168 const std::list<ModelHighAPI_Selection>& theBaseObjects,
169 const ModelHighAPI_Selection& theAxis,
170 const ModelHighAPI_Double& theAngle,
171 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
173 /// Constructor with values.
175 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
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 /// 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_Selection& theToObject,
188 const ModelHighAPI_Double& theToOffset,
189 const ModelHighAPI_Selection& theFromObject,
190 const ModelHighAPI_Double& theFromOffset,
191 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
194 /// Pointer on RevolutionFuse object.
195 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
197 /// \ingroup CPPHighAPI
198 /// \brief Create RevolutionFuse feature.
200 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
201 const std::list<ModelHighAPI_Selection>& theBaseObjects,
202 const ModelHighAPI_Selection& theAxis,
203 const ModelHighAPI_Double& theAngle,
204 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
206 /// \ingroup CPPHighAPI
207 /// \brief Create RevolutionFuse feature.
209 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
210 const std::list<ModelHighAPI_Selection>& theBaseObjects,
211 const ModelHighAPI_Selection& theAxis,
212 const ModelHighAPI_Double& theToAngle,
213 const ModelHighAPI_Double& theFromAngle,
214 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
216 /// \ingroup CPPHighAPI
217 /// \brief Create RevolutionFuse feature.
219 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
220 const std::list<ModelHighAPI_Selection>& theBaseObjects,
221 const ModelHighAPI_Selection& theAxis,
222 const ModelHighAPI_Selection& theToObject,
223 const ModelHighAPI_Double& theToOffset,
224 const ModelHighAPI_Selection& theFromObject,
225 const ModelHighAPI_Double& theFromOffset,
226 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
228 #endif // FeaturesAPI_RevolutionBoolean_H_