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