SHAPER  9.15.0
FeaturesAPI_RevolutionBoolean.h
1 // Copyright (C) 2014-2025 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 
36 
41 {
42 public:
44  FEATURESAPI_EXPORT
46 
47  INTERFACE_11("",
70 
71 
72  FEATURESAPI_EXPORT
73  void setNestedSketch(const ModelHighAPI_Reference& theSketch);
74 
76  FEATURESAPI_EXPORT
77  void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
78 
80  FEATURESAPI_EXPORT
81  void setAxis(const ModelHighAPI_Selection& theAxis);
82 
84  FEATURESAPI_EXPORT
85  void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
86 
88  FEATURESAPI_EXPORT
89  void setAngle(const ModelHighAPI_Double& theAngle);
90 
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 
100  FEATURESAPI_EXPORT
101  void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
102 
104  FEATURESAPI_EXPORT
105  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106 
107 protected:
109  FEATURESAPI_EXPORT
110  explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
111 
112 private:
113  void execIfBaseNotEmpty();
114 };
115 
120 {
121 public:
122 
123  static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
124  virtual std::string getID() { return ID(); }
125 
127  FEATURESAPI_EXPORT
128  explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
129 
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 
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 
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 
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 
167 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
168 
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 
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 
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 
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 
212 {
213 public:
214 
215  static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
216  virtual std::string getID() { return ID(); }
217 
219  FEATURESAPI_EXPORT
220  explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
221 
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 
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 
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 
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 
259 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
260 
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 
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 
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 
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_
Interface for RevolutionBoolean feature.
Definition: FeaturesAPI_RevolutionBoolean.h:41
void setAngles(const ModelHighAPI_Double &theToAngle, const ModelHighAPI_Double &theFromAngle)
Modify CreationMethod, to_angle, from_angle attributes of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:78
virtual std::shared_ptr< ModelAPI_AttributeSelection > fromObject() const
From object.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > booleanObjects() const
Boolean objects.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual std::shared_ptr< ModelAPI_AttributeDouble > toAngle() const
To angle.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual std::shared_ptr< ModelAPI_AttributeReference > sketch() const
Sketch launcher.
Definition: FeaturesAPI_RevolutionBoolean.h:69
void setAngle(const ModelHighAPI_Double &theAngle)
Modify creation_method, to_angle, from_angle attributes of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:89
void setBooleanObjects(const std::list< ModelHighAPI_Selection > &theBooleanObjects)
Modiyfy main_objects attribute of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:110
virtual std::shared_ptr< ModelAPI_AttributeDouble > toOffset() const
To offset.
Definition: FeaturesAPI_RevolutionBoolean.h:69
void setAxis(const ModelHighAPI_Selection &theAxis)
Modify axis_object attribute of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:70
void setNestedSketch(const ModelHighAPI_Reference &theSketch)
Modify base attribute of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:40
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromOffset() const
From offset.
Definition: FeaturesAPI_RevolutionBoolean.h:69
void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base attribute of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:60
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromAngle() const
From angle.
Definition: FeaturesAPI_RevolutionBoolean.h:69
void setPlanesAndOffsets(const ModelHighAPI_Selection &theToObject, const ModelHighAPI_Double &theToOffset, const ModelHighAPI_Selection &theFromObject, const ModelHighAPI_Double &theFromOffset)
Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:95
virtual ~FeaturesAPI_RevolutionBoolean()
Destructor.
Definition: FeaturesAPI_RevolutionBoolean.cpp:35
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual std::shared_ptr< ModelAPI_AttributeSelection > toObject() const
To object.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:119
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: FeaturesAPI_RevolutionBoolean.h:69
virtual std::shared_ptr< ModelAPI_AttributeSelection > axis() const
Axis.
Definition: FeaturesAPI_RevolutionBoolean.h:69
Interface for RevolutionCut feature.
Definition: FeaturesAPI_RevolutionBoolean.h:120
Interface for RevolutionFuse feature.
Definition: FeaturesAPI_RevolutionBoolean.h:212
static const std::string & OBJECTS_ID()
Attribute name of main objects.
Definition: FeaturesPlugin_CompositeBoolean.h:44
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: FeaturesPlugin_CompositeSketch.h:43
static const std::string & SKETCH_ID()
Attribute name of sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:36
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_RevolutionCut.h:36
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_RevolutionFuse.h:36
static const std::string & TO_ANGLE_ID()
Attribute name of revolution to angle.
Definition: FeaturesPlugin_Revolution.h:80
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Revolution.h:45
static const std::string & TO_OBJECT_ID()
Attribute name of an object to which the revolution grows.
Definition: FeaturesPlugin_Revolution.h:94
static const std::string & FROM_ANGLE_ID()
Attribute name of revolution from angle.
Definition: FeaturesPlugin_Revolution.h:87
static const std::string & FROM_OBJECT_ID()
Attribute name of an object from which the revolution grows.
Definition: FeaturesPlugin_Revolution.h:108
static const std::string & TO_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:101
static const std::string & FROM_OFFSET_ID()
Attribute name of revolution offset.
Definition: FeaturesPlugin_Revolution.h:115
static const std::string & AXIS_OBJECT_ID()
Attribute name of an revolution axis.
Definition: FeaturesPlugin_Revolution.h:73
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to feature (located in the same document).
Definition: ModelAPI_AttributeReference.h:32
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
RevolutionCutPtr addRevolutionCut(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const ModelHighAPI_Selection &theAxis, const std::list< ModelHighAPI_Selection > &theBooleanObjects)
Create RevolutionCut feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:268
RevolutionFusePtr addRevolutionFuse(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const ModelHighAPI_Selection &theAxis, const std::list< ModelHighAPI_Selection > &theBooleanObjects)
Create RevolutionFuse feature.
Definition: FeaturesAPI_RevolutionBoolean.cpp:421