Salome HOME
Documentation update
[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(), 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 */)
46
47   /// Modify base attribute of the feature.
48   FEATURESAPI_EXPORT
49   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
50
51   /// Modify base attribute of the feature.
52   FEATURESAPI_EXPORT
53   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
54
55   /// Modify axis_object attribute of the feature.
56   FEATURESAPI_EXPORT
57   void setAxis(const ModelHighAPI_Selection& theAxis);
58
59   /// Modify CreationMethod, to_angle, from_angle attributes of the feature.
60   FEATURESAPI_EXPORT
61   void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
62
63   /// Modify creation_method, to_angle, from_angle attributes of the feature.
64   FEATURESAPI_EXPORT
65   void setAngle(const ModelHighAPI_Double& theAngle);
66
67   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
68   FEATURESAPI_EXPORT
69   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
70                            const ModelHighAPI_Double& theToOffset,
71                            const ModelHighAPI_Selection& theFromObject,
72                            const ModelHighAPI_Double& theFromOffset);
73
74   /// Modiyfy main_objects attribute of the feature.
75   FEATURESAPI_EXPORT
76   void setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects);
77
78   /// Dump wrapped feature
79   FEATURESAPI_EXPORT
80   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
81
82 protected:
83   /// Constructor without values.
84   FEATURESAPI_EXPORT
85   explicit FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
86
87 private:
88   void execIfBaseNotEmpty();
89 };
90
91 /// \class FeaturesAPI_RevolutionCut
92 /// \ingroup CPPHighAPI
93 /// \brief Interface for RevolutionCut feature.
94 class FeaturesAPI_RevolutionCut: public FeaturesAPI_RevolutionBoolean
95 {
96 public:
97
98   static std::string ID() { return FeaturesPlugin_RevolutionCut::ID(); }
99   virtual std::string getID() { return ID(); }
100
101   /// Constructor without values.
102   FEATURESAPI_EXPORT
103   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
104
105   /// Constructor with values.
106   FEATURESAPI_EXPORT
107   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
108                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
109                                      const ModelHighAPI_Selection& theAxis,
110                                      const ModelHighAPI_Double& theAngle,
111                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
112
113   /// Constructor with values.
114   FEATURESAPI_EXPORT
115   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
116                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
117                                      const ModelHighAPI_Selection& theAxis,
118                                      const ModelHighAPI_Double& theToAngle,
119                                      const ModelHighAPI_Double& theFromAngle,
120                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
121
122   /// Constructor with values.
123   FEATURESAPI_EXPORT
124   explicit FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
125                                      const std::list<ModelHighAPI_Selection>& theBaseObjects,
126                                      const ModelHighAPI_Selection& theAxis,
127                                      const ModelHighAPI_Selection& theToObject,
128                                      const ModelHighAPI_Double& theToOffset,
129                                      const ModelHighAPI_Selection& theFromObject,
130                                      const ModelHighAPI_Double& theFromOffset,
131                                      const std::list<ModelHighAPI_Selection>& theBooleanObjects);
132 };
133
134 /// Pointer on RevolutionCut object.
135 typedef std::shared_ptr<FeaturesAPI_RevolutionCut> RevolutionCutPtr;
136
137 /// \ingroup CPPHighAPI
138 /// \brief Create RevolutionCut feature.
139 FEATURESAPI_EXPORT
140 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
141                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
142                                   const ModelHighAPI_Selection& theAxis,
143                                   const ModelHighAPI_Double& theAngle,
144                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
145
146 /// \ingroup CPPHighAPI
147 /// \brief Create RevolutionCut feature.
148 FEATURESAPI_EXPORT
149 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
150                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
151                                   const ModelHighAPI_Selection& theAxis,
152                                   const ModelHighAPI_Double& theToAngle,
153                                   const ModelHighAPI_Double& theFromAngle,
154                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
155
156 /// \ingroup CPPHighAPI
157 /// \brief Create RevolutionCut feature.
158 FEATURESAPI_EXPORT
159 RevolutionCutPtr addRevolutionCut(const std::shared_ptr<ModelAPI_Document>& thePart,
160                                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
161                                   const ModelHighAPI_Selection& theAxis,
162                                   const ModelHighAPI_Selection& theToObject,
163                                   const ModelHighAPI_Double& theToOffset,
164                                   const ModelHighAPI_Selection& theFromObject,
165                                   const ModelHighAPI_Double& theFromOffset,
166                                   const std::list<ModelHighAPI_Selection>& theBooleanObjects);
167
168 /// \class FeaturesAPI_RevolutionFuse
169 /// \ingroup CPPHighAPI
170 /// \brief Interface for RevolutionFuse feature.
171 class FeaturesAPI_RevolutionFuse: public FeaturesAPI_RevolutionBoolean
172 {
173 public:
174
175   static std::string ID() { return FeaturesPlugin_RevolutionFuse::ID(); }
176   virtual std::string getID() { return ID(); }
177
178   /// Constructor without values.
179   FEATURESAPI_EXPORT
180   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
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_Double& theAngle,
188                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
189
190   /// Constructor with values.
191   FEATURESAPI_EXPORT
192   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
193                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
194                                       const ModelHighAPI_Selection& theAxis,
195                                       const ModelHighAPI_Double& theToAngle,
196                                       const ModelHighAPI_Double& theFromAngle,
197                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
198
199   /// Constructor with values.
200   FEATURESAPI_EXPORT
201   explicit FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
202                                       const std::list<ModelHighAPI_Selection>& theBaseObjects,
203                                       const ModelHighAPI_Selection& theAxis,
204                                       const ModelHighAPI_Selection& theToObject,
205                                       const ModelHighAPI_Double& theToOffset,
206                                       const ModelHighAPI_Selection& theFromObject,
207                                       const ModelHighAPI_Double& theFromOffset,
208                                       const std::list<ModelHighAPI_Selection>& theBooleanObjects);
209 };
210
211 /// Pointer on RevolutionFuse object.
212 typedef std::shared_ptr<FeaturesAPI_RevolutionFuse> RevolutionFusePtr;
213
214 /// \ingroup CPPHighAPI
215 /// \brief Create RevolutionFuse feature.
216 FEATURESAPI_EXPORT
217 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
218                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
219                                     const ModelHighAPI_Selection& theAxis,
220                                     const ModelHighAPI_Double& theAngle,
221                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
222
223 /// \ingroup CPPHighAPI
224 /// \brief Create RevolutionFuse feature.
225 FEATURESAPI_EXPORT
226 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
227                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
228                                     const ModelHighAPI_Selection& theAxis,
229                                     const ModelHighAPI_Double& theToAngle,
230                                     const ModelHighAPI_Double& theFromAngle,
231                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
232
233 /// \ingroup CPPHighAPI
234 /// \brief Create RevolutionFuse feature.
235 FEATURESAPI_EXPORT
236 RevolutionFusePtr addRevolutionFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
237                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
238                                     const ModelHighAPI_Selection& theAxis,
239                                     const ModelHighAPI_Selection& theToObject,
240                                     const ModelHighAPI_Double& theToOffset,
241                                     const ModelHighAPI_Selection& theFromObject,
242                                     const ModelHighAPI_Double& theFromOffset,
243                                     const std::list<ModelHighAPI_Selection>& theBooleanObjects);
244
245 #endif // FeaturesAPI_RevolutionBoolean_H_