Salome HOME
679eb58317eddf25f7ce06a3ccf6d9784ff0ec33
[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_Selection;
21
22 /// \class FeaturesAPI_RevolutionBoolean
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for RevolutionBoolean feature.
25 class FeaturesAPI_RevolutionBoolean: public ModelHighAPI_Interface
26 {
27 public:
28   /// Destructor.
29   FEATURESAPI_EXPORT
30   virtual ~FeaturesAPI_RevolutionBoolean();
31
32   INTERFACE_11("",
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 */)
44
45   /// Modify base attribute of the feature.
46   FEATURESAPI_EXPORT
47   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
48
49   /// Modify axis_object attribute of the feature.
50   FEATURESAPI_EXPORT
51   void setAxis(const ModelHighAPI_Selection& theAxis);
52
53   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
54   FEATURESAPI_EXPORT
55   void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
56
57   /// Modify creation_method, to_angle, from_angle attributes of the feature.
58   FEATURESAPI_EXPORT
59   void setAngle(const ModelHighAPI_Double& theAngle);
60
61   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
62   FEATURESAPI_EXPORT
63   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
64                            const ModelHighAPI_Double& theToOffset,
65                            const ModelHighAPI_Selection& theFromObject,
66                            const ModelHighAPI_Double& theFromOffset);
67
68   /// Modiyfy main_objects attribute of the feature.
69   FEATURESAPI_EXPORT
70   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
71
72 protected:
73   /// Constructor without values.
74   FEATURESAPI_EXPORT
75   explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
76 };
77
78 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
79 {
80 public:
81   FEATURESAPI_EXPORT
82   virtual std::string getID() {
83     return FeaturesPlugin_RevolutionCut::ID();
84   }
85
86   /// Constructor without values.
87   FEATURESAPI_EXPORT
88   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
89
90   /// Constructor with values.
91   FEATURESAPI_EXPORT
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);
97
98   /// Constructor with values.
99   FEATURESAPI_EXPORT
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);
106
107   /// Constructor with values.
108   FEATURESAPI_EXPORT
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);
117 };
118
119 /// Pointer on RevolutionCut object.
120 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
121
122 /// \ingroup CPPHighAPI
123 /// \brief Create RevolutionCut feature.
124 FEATURESAPI_EXPORT
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);
130
131 /// \ingroup CPPHighAPI
132 /// \brief Create RevolutionCut feature.
133 FEATURESAPI_EXPORT
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);
140
141 /// \ingroup CPPHighAPI
142 /// \brief Create RevolutionCut feature.
143 FEATURESAPI_EXPORT
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);
152
153 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
154 {
155 public:
156   FEATURESAPI_EXPORT
157   virtual std::string getID() {
158     return FeaturesPlugin_RevolutionFuse::ID();
159   }
160
161   /// Constructor without values.
162   FEATURESAPI_EXPORT
163   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
164
165   /// Constructor with values.
166   FEATURESAPI_EXPORT
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);
172
173   /// Constructor with values.
174   FEATURESAPI_EXPORT
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);
181
182   /// Constructor with values.
183   FEATURESAPI_EXPORT
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);
192 };
193
194 /// Pointer on RevolutionFuse object.
195 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
196
197 /// \ingroup CPPHighAPI
198 /// \brief Create RevolutionFuse feature.
199 FEATURESAPI_EXPORT
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);
205
206 /// \ingroup CPPHighAPI
207 /// \brief Create RevolutionFuse feature.
208 FEATURESAPI_EXPORT
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);
215
216 /// \ingroup CPPHighAPI
217 /// \brief Create RevolutionFuse feature.
218 FEATURESAPI_EXPORT
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);
227
228 #endif // FeaturesAPI_RevolutionBoolean_H_