Salome HOME
Update copyrights
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Extrusion.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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_Extrusion_H_
21 #define FeaturesAPI_Extrusion_H_
22
23 #include "FeaturesAPI.h"
24
25 #include <FeaturesPlugin_Extrusion.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Reference;
32 class ModelHighAPI_Selection;
33
34 /// \class FeaturesAPI_Extrusion
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Extrusion feature.
37 class FeaturesAPI_Extrusion: public ModelHighAPI_Interface
38 {
39 public:
40   /// Constructor without values.
41   FEATURESAPI_EXPORT
42   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
44   /// Constructor with values.
45   FEATURESAPI_EXPORT
46   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
48                                  const ModelHighAPI_Double& theSize);
49
50   /// Constructor with values.
51   FEATURESAPI_EXPORT
52   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
54                                  const ModelHighAPI_Selection& theDirection,
55                                  const ModelHighAPI_Double& theSize);
56   /// Constructor with values.
57   FEATURESAPI_EXPORT
58   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
59                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
60                                  const ModelHighAPI_Double& theToSize,
61                                  const ModelHighAPI_Double& theFromSize);
62
63   /// Constructor with values.
64   FEATURESAPI_EXPORT
65   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
66                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
67                                  const ModelHighAPI_Selection& theDirection,
68                                  const ModelHighAPI_Double& theToSize,
69                                  const ModelHighAPI_Double& theFromSize);
70
71   /// Constructor with values.
72   FEATURESAPI_EXPORT
73   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
74                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
75                                  const ModelHighAPI_Selection& theToObject,
76                                  const ModelHighAPI_Double& theToOffset,
77                                  const ModelHighAPI_Selection& theFromObject,
78                                  const ModelHighAPI_Double& theFromOffset);
79
80   /// Constructor with values.
81   FEATURESAPI_EXPORT
82   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
84                                  const ModelHighAPI_Selection& theDirection,
85                                  const ModelHighAPI_Selection& theToObject,
86                                  const ModelHighAPI_Double& theToOffset,
87                                  const ModelHighAPI_Selection& theFromObject,
88                                  const ModelHighAPI_Double& theFromOffset);
89
90   /// Destructor.
91   FEATURESAPI_EXPORT
92   virtual ~FeaturesAPI_Extrusion();
93
94   INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
95                sketch, FeaturesPlugin_Extrusion::SKETCH_ID(),
96                ModelAPI_AttributeReference, /** Sketch launcher */,
97                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(),
98                ModelAPI_AttributeSelectionList, /** Base objects */,
99                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(),
100                ModelAPI_AttributeSelection, /** Direction */,
101                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(),
102                ModelAPI_AttributeString, /** Creation method */,
103                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(),
104                ModelAPI_AttributeDouble, /** To size */,
105                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(),
106                ModelAPI_AttributeDouble, /** From size */,
107                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(),
108                ModelAPI_AttributeSelection, /** To object */,
109                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(),
110                ModelAPI_AttributeDouble, /** To offset */,
111                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(),
112                ModelAPI_AttributeSelection, /** From object */,
113                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(),
114                ModelAPI_AttributeDouble, /** From offset */)
115
116   /// Modify base attribute of the feature.
117   FEATURESAPI_EXPORT
118   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
119
120   /// Modify base attribute of the feature.
121   FEATURESAPI_EXPORT
122   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
123
124   /// Modify direction_object attribute of the feature.
125   FEATURESAPI_EXPORT
126   void setDirection(const ModelHighAPI_Selection& theDirection);
127
128   /// Modify CreationMethod, to_size, from_size attributes of the feature.
129   FEATURESAPI_EXPORT
130   void setSizes(const ModelHighAPI_Double& theToSize,
131                 const ModelHighAPI_Double& theFromSize);
132
133   /// Modify creation_method, to_size, from_size attributes of the feature.
134   FEATURESAPI_EXPORT
135   void setSize(const ModelHighAPI_Double& theSize);
136
137   /// Modify creation_method, to_object, to_offset,
138   /// from_object, from_offset attributes of the feature.
139   FEATURESAPI_EXPORT
140   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
141                            const ModelHighAPI_Double& theToOffset,
142                            const ModelHighAPI_Selection& theFromObject,
143                            const ModelHighAPI_Double& theFromOffset);
144
145   /// Dump wrapped feature
146   FEATURESAPI_EXPORT
147   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
148
149 private:
150   void execIfBaseNotEmpty();
151 };
152
153 /// Pointer on Extrusion object.
154 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
155
156 /// \ingroup CPPHighAPI
157 /// \brief Create Extrusion feature.
158 FEATURESAPI_EXPORT
159 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
160                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
161                           const ModelHighAPI_Double& theSize);
162
163 /// \ingroup CPPHighAPI
164 /// \brief Create Extrusion feature.
165 FEATURESAPI_EXPORT
166 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
167                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
168                           const ModelHighAPI_Selection& theDirection,
169                           const ModelHighAPI_Double& theSize);
170
171 /// \ingroup CPPHighAPI
172 /// \brief Create Extrusion feature.
173 FEATURESAPI_EXPORT
174 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
175                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
176                           const ModelHighAPI_Double& theToSize,
177                           const ModelHighAPI_Double& theFromSize);
178
179 /// \ingroup CPPHighAPI
180 /// \brief Create Extrusion feature.
181 FEATURESAPI_EXPORT
182 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
183                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
184                           const ModelHighAPI_Selection& theDirection,
185                           const ModelHighAPI_Double& theToSize,
186                           const ModelHighAPI_Double& theFromSize);
187
188 /// \ingroup CPPHighAPI
189 /// \brief Create Extrusion feature.
190 FEATURESAPI_EXPORT
191 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
192                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
193                           const ModelHighAPI_Selection& theToObject,
194                           const ModelHighAPI_Double& theToOffset,
195                           const ModelHighAPI_Selection& theFromObject,
196                           const ModelHighAPI_Double& theFromOffset);
197
198 /// \ingroup CPPHighAPI
199 /// \brief Create Extrusion feature.
200 FEATURESAPI_EXPORT
201 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
202                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
203                           const ModelHighAPI_Selection& theDirection,
204                           const ModelHighAPI_Selection& theToObject,
205                           const ModelHighAPI_Double& theToOffset,
206                           const ModelHighAPI_Selection& theFromObject,
207                           const ModelHighAPI_Double& theFromOffset);
208
209 #endif // FeaturesAPI_Extrusion_H_