]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesAPI/FeaturesAPI_Extrusion.h
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
[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_11(FeaturesPlugin_Extrusion::ID(),
82                sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch object */,
83                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
84                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
85                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
86                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
87                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
88                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
89                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
90                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
91                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
92                sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
93
94   /// Modify base attribute of the feature.
95   FEATURESAPI_EXPORT
96   void setNestedSketch(const ModelHighAPI_Reference& theSketch);
97
98   /// Modify base attribute of the feature.
99   FEATURESAPI_EXPORT
100   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
101
102   /// Modify direction_object attribute of the feature.
103   FEATURESAPI_EXPORT
104   void setDirection(const ModelHighAPI_Selection& theDirection);
105
106   /// Modify CreationMethod, to_size, from_size attributes of the feature.
107   FEATURESAPI_EXPORT
108   void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
109
110   /// Modify creation_method, to_size, from_size attributes of the feature.
111   FEATURESAPI_EXPORT
112   void setSize(const ModelHighAPI_Double& theSize);
113
114   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
115   FEATURESAPI_EXPORT
116   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
117                            const ModelHighAPI_Double& theToOffset,
118                            const ModelHighAPI_Selection& theFromObject,
119                            const ModelHighAPI_Double& theFromOffset);
120
121   /// Dump wrapped feature
122   FEATURESAPI_EXPORT
123   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
124
125 private:
126   void execIfBaseNotEmpty();
127 };
128
129 /// Pointer on Extrusion object.
130 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
131
132 /// \ingroup CPPHighAPI
133 /// \brief Create Extrusion feature.
134 FEATURESAPI_EXPORT
135 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
136                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
137                           const ModelHighAPI_Double& theSize);
138
139 /// \ingroup CPPHighAPI
140 /// \brief Create Extrusion feature.
141 FEATURESAPI_EXPORT
142 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
143                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
144                           const ModelHighAPI_Selection& theDirection,
145                           const ModelHighAPI_Double& theSize);
146
147 /// \ingroup CPPHighAPI
148 /// \brief Create Extrusion feature.
149 FEATURESAPI_EXPORT
150 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
151                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
152                           const ModelHighAPI_Double& theToSize,
153                           const ModelHighAPI_Double& theFromSize);
154
155 /// \ingroup CPPHighAPI
156 /// \brief Create Extrusion feature.
157 FEATURESAPI_EXPORT
158 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
159                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
160                           const ModelHighAPI_Selection& theDirection,
161                           const ModelHighAPI_Double& theToSize,
162                           const ModelHighAPI_Double& theFromSize);
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& theToObject,
170                           const ModelHighAPI_Double& theToOffset,
171                           const ModelHighAPI_Selection& theFromObject,
172                           const ModelHighAPI_Double& theFromOffset);
173
174 /// \ingroup CPPHighAPI
175 /// \brief Create Extrusion feature.
176 FEATURESAPI_EXPORT
177 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
178                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
179                           const ModelHighAPI_Selection& theDirection,
180                           const ModelHighAPI_Selection& theToObject,
181                           const ModelHighAPI_Double& theToOffset,
182                           const ModelHighAPI_Selection& theFromObject,
183                           const ModelHighAPI_Double& theFromOffset);
184
185 #endif // FeaturesAPI_Extrusion_H_