Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_RevolutionBoolean.h
1 // Copyright (C) 2014-2023  CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef FeaturesAPI_RevolutionBoolean_H_
21 #define FeaturesAPI_RevolutionBoolean_H_
22
23 #include "FeaturesAPI.h"
24
25 #include <FeaturesPlugin_CompositeBoolean.h>
26 #include <FeaturesPlugin_RevolutionCut.h>
27 #include <FeaturesPlugin_RevolutionFuse.h>
28
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31
32 class ModelHighAPI_Double;
33 class ModelHighAPI_Dumper;
34 class ModelHighAPI_Reference;
35 class ModelHighAPI_Selection;
36
37 /// \class FeaturesAPI_RevolutionBoolean
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for RevolutionBoolean feature.
40 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
41 {
42 public:
43   /// Destructor.
44   FEATURESAPI_EXPORT
45   virtual ~FeaturesAPI_RevolutionBoolean();
46
47   INTERFACE_11("",
48                sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
49                ModelAPI_AttributeReference, /** Sketch launcher */,
50                baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
51                ModelAPI_AttributeSelectionList, /** Base objects */,
52                axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
53                ModelAPI_AttributeSelection, /** Axis */,
54                creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
55                ModelAPI_AttributeString, /** Creation method */,
56                toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
57                ModelAPI_AttributeDouble, /** To angle */,
58                fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
59                ModelAPI_AttributeDouble, /** From angle */,
60                toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
61                ModelAPI_AttributeSelection, /** To object */,
62                toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
63                ModelAPI_AttributeDouble, /** To offset */,
64                fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
65                ModelAPI_AttributeSelection, /** From object */,
66                fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
67                ModelAPI_AttributeDouble, /** From offset */,
68                booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
69                ModelAPI_AttributeSelectionList, /** Boolean objects */)
70
71   /// Modify base attribute of the feature.
72   FEATURESAPI_EXPORT
73   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
74
75   /// Modify base attribute of the feature.
76   FEATURESAPI_EXPORT
77   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
78
79   /// Modify axis_object attribute of the feature.
80   FEATURESAPI_EXPORT
81   void setAxis(const ModelHighAPI_Selection& theAxis);
82
83   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
84   FEATURESAPI_EXPORT
85   void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
86
87   /// Modify creation_method, to_angle, from_angle attributes of the feature.
88   FEATURESAPI_EXPORT
89   void setAngle(const ModelHighAPI_Double& theAngle);
90
91   /// Modify creation_method, to_object, to_offset, from_object,
92   /// from_offset attributes of the feature.
93   FEATURESAPI_EXPORT
94   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
95                            const ModelHighAPI_Double& theToOffset,
96                            const ModelHighAPI_Selection& theFromObject,
97                            const ModelHighAPI_Double& theFromOffset);
98
99   /// Modiyfy main_objects attribute of the feature.
100   FEATURESAPI_EXPORT
101   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
102
103   /// Dump wrapped feature
104   FEATURESAPI_EXPORT
105   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106
107 protected:
108   /// Constructor without values.
109   FEATURESAPI_EXPORT
110   explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
111
112 private:
113   void execIfBaseNotEmpty();
114 };
115
116 /// \class FeaturesAPI_RevolutionCut
117 /// \ingroup CPPHighAPI
118 /// \brief Interface for RevolutionCut feature.
119 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
120 {
121 public:
122
123   static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
124   virtual std::string getID() { return ID(); }
125
126   /// Constructor without values.
127   FEATURESAPI_EXPORT
128   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
129
130   /// Constructor with values.
131   FEATURESAPI_EXPORT
132   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
133                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
134                                      const ModelHighAPI_Selection& theAxis,
135                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
136
137   /// Constructor with values.
138   FEATURESAPI_EXPORT
139   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
140                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
141                                      const ModelHighAPI_Selection& theAxis,
142                                      const ModelHighAPI_Double& theAngle,
143                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
144
145   /// Constructor with values.
146   FEATURESAPI_EXPORT
147   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
148                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
149                                      const ModelHighAPI_Selection& theAxis,
150                                      const ModelHighAPI_Double& theToAngle,
151                                      const ModelHighAPI_Double& theFromAngle,
152                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
153
154   /// Constructor with values.
155   FEATURESAPI_EXPORT
156   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
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);
164 };
165
166 /// Pointer on RevolutionCut object.
167 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
168
169 /// \ingroup CPPHighAPI
170 /// \brief Create RevolutionCut feature.
171 FEATURESAPI_EXPORT
172 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
173                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
174                                   const ModelHighAPI_Selection& theAxis,
175                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
176
177 /// \ingroup CPPHighAPI
178 /// \brief Create RevolutionCut feature.
179 FEATURESAPI_EXPORT
180 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
181                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
182                                   const ModelHighAPI_Selection& theAxis,
183                                   const ModelHighAPI_Double& theAngle,
184                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
185
186 /// \ingroup CPPHighAPI
187 /// \brief Create RevolutionCut feature.
188 FEATURESAPI_EXPORT
189 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
190                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
191                                   const ModelHighAPI_Selection& theAxis,
192                                   const ModelHighAPI_Double& theToAngle,
193                                   const ModelHighAPI_Double& theFromAngle,
194                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
195
196 /// \ingroup CPPHighAPI
197 /// \brief Create RevolutionCut feature.
198 FEATURESAPI_EXPORT
199 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
200                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
201                                   const ModelHighAPI_Selection& theAxis,
202                                   const ModelHighAPI_Selection& theToObject,
203                                   const ModelHighAPI_Double& theToOffset,
204                                   const ModelHighAPI_Selection& theFromObject,
205                                   const ModelHighAPI_Double& theFromOffset,
206                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
207
208 /// \class FeaturesAPI_RevolutionFuse
209 /// \ingroup CPPHighAPI
210 /// \brief Interface for RevolutionFuse feature.
211 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
212 {
213 public:
214
215   static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
216   virtual std::string getID() { return ID(); }
217
218   /// Constructor without values.
219   FEATURESAPI_EXPORT
220   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
221
222   /// Constructor with values.
223   FEATURESAPI_EXPORT
224   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
225                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
226                                       const ModelHighAPI_Selection& theAxis,
227                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
228
229   /// Constructor with values.
230   FEATURESAPI_EXPORT
231   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
232                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
233                                       const ModelHighAPI_Selection& theAxis,
234                                       const ModelHighAPI_Double& theAngle,
235                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
236
237   /// Constructor with values.
238   FEATURESAPI_EXPORT
239   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
240                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
241                                       const ModelHighAPI_Selection& theAxis,
242                                       const ModelHighAPI_Double& theToAngle,
243                                       const ModelHighAPI_Double& theFromAngle,
244                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
245
246   /// Constructor with values.
247   FEATURESAPI_EXPORT
248   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
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);
256 };
257
258 /// Pointer on RevolutionFuse object.
259 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
260
261 /// \ingroup CPPHighAPI
262 /// \brief Create RevolutionFuse feature.
263 FEATURESAPI_EXPORT
264 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
265                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
266                                     const ModelHighAPI_Selection& theAxis,
267                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
268
269 /// \ingroup CPPHighAPI
270 /// \brief Create RevolutionFuse feature.
271 FEATURESAPI_EXPORT
272 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
273                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
274                                     const ModelHighAPI_Selection& theAxis,
275                                     const ModelHighAPI_Double& theAngle,
276                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
277
278 /// \ingroup CPPHighAPI
279 /// \brief Create RevolutionFuse feature.
280 FEATURESAPI_EXPORT
281 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
282                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
283                                     const ModelHighAPI_Selection& theAxis,
284                                     const ModelHighAPI_Double& theToAngle,
285                                     const ModelHighAPI_Double& theFromAngle,
286                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
287
288 /// \ingroup CPPHighAPI
289 /// \brief Create RevolutionFuse feature.
290 FEATURESAPI_EXPORT
291 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
292                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
293                                     const ModelHighAPI_Selection& theAxis,
294                                     const ModelHighAPI_Selection& theToObject,
295                                     const ModelHighAPI_Double& theToOffset,
296                                     const ModelHighAPI_Selection& theFromObject,
297                                     const ModelHighAPI_Double& theFromOffset,
298                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
299
300 #endif // FeaturesAPI_RevolutionBoolean_H_