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