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: public FeaturesAPI_RevolutionBoolean
95 static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
96 virtual std::string getID() { return ID(); }
98 /// Constructor without values.
100 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
102 /// Constructor with values.
104 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
105 const std::list<ModelHighAPI_Selection>& theBaseObjects,
106 const ModelHighAPI_Selection& theAxis,
107 const ModelHighAPI_Double& theAngle,
108 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
110 /// Constructor with values.
112 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
113 const std::list<ModelHighAPI_Selection>& theBaseObjects,
114 const ModelHighAPI_Selection& theAxis,
115 const ModelHighAPI_Double& theToAngle,
116 const ModelHighAPI_Double& theFromAngle,
117 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
119 /// Constructor with values.
121 explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
122 const std::list<ModelHighAPI_Selection>& theBaseObjects,
123 const ModelHighAPI_Selection& theAxis,
124 const ModelHighAPI_Selection& theToObject,
125 const ModelHighAPI_Double& theToOffset,
126 const ModelHighAPI_Selection& theFromObject,
127 const ModelHighAPI_Double& theFromOffset,
128 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
131 /// Pointer on RevolutionCut object.
132 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
134 /// \ingroup CPPHighAPI
135 /// \brief Create RevolutionCut feature.
137 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
138 const std::list<ModelHighAPI_Selection>& theBaseObjects,
139 const ModelHighAPI_Selection& theAxis,
140 const ModelHighAPI_Double& theAngle,
141 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
143 /// \ingroup CPPHighAPI
144 /// \brief Create RevolutionCut feature.
146 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
147 const std::list<ModelHighAPI_Selection>& theBaseObjects,
148 const ModelHighAPI_Selection& theAxis,
149 const ModelHighAPI_Double& theToAngle,
150 const ModelHighAPI_Double& theFromAngle,
151 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
153 /// \ingroup CPPHighAPI
154 /// \brief Create RevolutionCut feature.
156 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
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);
165 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
169 static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
170 virtual std::string getID() { return ID(); }
172 /// Constructor without values.
174 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
176 /// Constructor with values.
178 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
179 const std::list<ModelHighAPI_Selection>& theBaseObjects,
180 const ModelHighAPI_Selection& theAxis,
181 const ModelHighAPI_Double& theAngle,
182 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
184 /// Constructor with values.
186 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
187 const std::list<ModelHighAPI_Selection>& theBaseObjects,
188 const ModelHighAPI_Selection& theAxis,
189 const ModelHighAPI_Double& theToAngle,
190 const ModelHighAPI_Double& theFromAngle,
191 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
193 /// Constructor with values.
195 explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
196 const std::list<ModelHighAPI_Selection>& theBaseObjects,
197 const ModelHighAPI_Selection& theAxis,
198 const ModelHighAPI_Selection& theToObject,
199 const ModelHighAPI_Double& theToOffset,
200 const ModelHighAPI_Selection& theFromObject,
201 const ModelHighAPI_Double& theFromOffset,
202 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
205 /// Pointer on RevolutionFuse object.
206 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
208 /// \ingroup CPPHighAPI
209 /// \brief Create RevolutionFuse feature.
211 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
212 const std::list<ModelHighAPI_Selection>& theBaseObjects,
213 const ModelHighAPI_Selection& theAxis,
214 const ModelHighAPI_Double& theAngle,
215 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
217 /// \ingroup CPPHighAPI
218 /// \brief Create RevolutionFuse feature.
220 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
221 const std::list<ModelHighAPI_Selection>& theBaseObjects,
222 const ModelHighAPI_Selection& theAxis,
223 const ModelHighAPI_Double& theToAngle,
224 const ModelHighAPI_Double& theFromAngle,
225 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
227 /// \ingroup CPPHighAPI
228 /// \brief Create RevolutionFuse feature.
230 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
231 const std::list<ModelHighAPI_Selection>& theBaseObjects,
232 const ModelHighAPI_Selection& theAxis,
233 const ModelHighAPI_Selection& theToObject,
234 const ModelHighAPI_Double& theToOffset,
235 const ModelHighAPI_Selection& theFromObject,
236 const ModelHighAPI_Double& theFromOffset,
237 const std::list<ModelHighAPI_Selection>& theBooleanObjects);
239 #endif // FeaturesAPI_RevolutionBoolean_H_