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