Salome HOME
456da2c044457ea3fe4a4af850ae1358a0631f1f
[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_Selection;
19
20 /// \class FeaturesAPI_Extrusion
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Extrusion feature.
23 class FeaturesAPI_Extrusion: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   FEATURESAPI_EXPORT
28   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   FEATURESAPI_EXPORT
32   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
34                                  const ModelHighAPI_Double& theSize);
35
36   /// Constructor with values.
37   FEATURESAPI_EXPORT
38   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
39                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
40                                  const ModelHighAPI_Selection& theDirection,
41                                  const ModelHighAPI_Double& theSize);
42   /// Constructor with values.
43   FEATURESAPI_EXPORT
44   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
45                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
46                                  const ModelHighAPI_Double& theToSize,
47                                  const ModelHighAPI_Double& theFromSize);
48
49   /// Constructor with values.
50   FEATURESAPI_EXPORT
51   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
53                                  const ModelHighAPI_Selection& theDirection,
54                                  const ModelHighAPI_Double& theToSize,
55                                  const ModelHighAPI_Double& theFromSize);
56
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_Selection& theToObject,
62                                  const ModelHighAPI_Double& theToOffset,
63                                  const ModelHighAPI_Selection& theFromObject,
64                                  const ModelHighAPI_Double& theFromOffset);
65
66   /// Constructor with values.
67   FEATURESAPI_EXPORT
68   explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
69                                  const std::list<ModelHighAPI_Selection>& theBaseObjects,
70                                  const ModelHighAPI_Selection& theDirection,
71                                  const ModelHighAPI_Selection& theToObject,
72                                  const ModelHighAPI_Double& theToOffset,
73                                  const ModelHighAPI_Selection& theFromObject,
74                                  const ModelHighAPI_Double& theFromOffset);
75
76   /// Destructor.
77   FEATURESAPI_EXPORT
78   virtual ~FeaturesAPI_Extrusion();
79
80   INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
81                baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
82                creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
83                toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
84                fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
85                toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
86                toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
87                fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
88                fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
89                direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
90                sketchLauncher, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */)
91
92   /// Modify base attribute of the feature.
93   FEATURESAPI_EXPORT
94   void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
95
96   /// Modify direction_object attribute of the feature.
97   FEATURESAPI_EXPORT
98   void setDirection(const ModelHighAPI_Selection& theDirection);
99
100   /// Modify CreationMethod, to_size, from_size attributes of the feature.
101   FEATURESAPI_EXPORT
102   void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
103
104   /// Modify creation_method, to_size, from_size attributes of the feature.
105   FEATURESAPI_EXPORT
106   void setSize(const ModelHighAPI_Double& theSize);
107
108   /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
109   FEATURESAPI_EXPORT
110   void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
111                            const ModelHighAPI_Double& theToOffset,
112                            const ModelHighAPI_Selection& theFromObject,
113                            const ModelHighAPI_Double& theFromOffset);
114
115   /// Dump wrapped feature
116   FEATURESAPI_EXPORT
117   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
118 };
119
120 /// Pointer on Extrusion object.
121 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
122
123 /// \ingroup CPPHighAPI
124 /// \brief Create Extrusion feature.
125 FEATURESAPI_EXPORT
126 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
127                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
128                           const ModelHighAPI_Double& theSize);
129
130 /// \ingroup CPPHighAPI
131 /// \brief Create Extrusion feature.
132 FEATURESAPI_EXPORT
133 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
134                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
135                           const ModelHighAPI_Selection& theDirection,
136                           const ModelHighAPI_Double& theSize);
137
138 /// \ingroup CPPHighAPI
139 /// \brief Create Extrusion feature.
140 FEATURESAPI_EXPORT
141 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
142                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
143                           const ModelHighAPI_Double& theToSize,
144                           const ModelHighAPI_Double& theFromSize);
145
146 /// \ingroup CPPHighAPI
147 /// \brief Create Extrusion feature.
148 FEATURESAPI_EXPORT
149 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
150                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
151                           const ModelHighAPI_Selection& theDirection,
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& theToObject,
161                           const ModelHighAPI_Double& theToOffset,
162                           const ModelHighAPI_Selection& theFromObject,
163                           const ModelHighAPI_Double& theFromOffset);
164
165 /// \ingroup CPPHighAPI
166 /// \brief Create Extrusion feature.
167 FEATURESAPI_EXPORT
168 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
169                           const std::list<ModelHighAPI_Selection>& theBaseObjects,
170                           const ModelHighAPI_Selection& theDirection,
171                           const ModelHighAPI_Selection& theToObject,
172                           const ModelHighAPI_Double& theToOffset,
173                           const ModelHighAPI_Selection& theFromObject,
174                           const ModelHighAPI_Double& theFromOffset);
175
176 #endif // FeaturesAPI_Extrusion_H_