1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Extrusion.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_Extrusion_H_
8 #define FeaturesAPI_Extrusion_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_Extrusion.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Reference;
19 class ModelHighAPI_Selection;
21 /// \class FeaturesAPI_Extrusion
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Extrusion feature.
24 class FeaturesAPI_Extrusion: public ModelHighAPI_Interface
27 /// Constructor without values.
29 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31 /// Constructor with values.
33 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34 const std::list<ModelHighAPI_Selection>& theBaseObjects,
35 const ModelHighAPI_Double& theSize);
37 /// Constructor with values.
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.
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);
50 /// Constructor with values.
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);
58 /// Constructor with values.
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);
67 /// Constructor with values.
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);
79 virtual ~FeaturesAPI_Extrusion();
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 */)
103 /// Modify base attribute of the feature.
105 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
107 /// Modify base attribute of the feature.
109 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
111 /// Modify direction_object attribute of the feature.
113 void setDirection(const ModelHighAPI_Selection& theDirection);
115 /// Modify CreationMethod, to_size, from_size attributes of the feature.
117 void setSizes(const ModelHighAPI_Double& theToSize,
118 const ModelHighAPI_Double& theFromSize);
120 /// Modify creation_method, to_size, from_size attributes of the feature.
122 void setSize(const ModelHighAPI_Double& theSize);
124 /// Modify creation_method, to_object, to_offset,
125 /// from_object, from_offset attributes of the feature.
127 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
128 const ModelHighAPI_Double& theToOffset,
129 const ModelHighAPI_Selection& theFromObject,
130 const ModelHighAPI_Double& theFromOffset);
132 /// Dump wrapped feature
134 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
137 void execIfBaseNotEmpty();
140 /// Pointer on Extrusion object.
141 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
143 /// \ingroup CPPHighAPI
144 /// \brief Create Extrusion feature.
146 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
147 const std::list<ModelHighAPI_Selection>& theBaseObjects,
148 const ModelHighAPI_Double& theSize);
150 /// \ingroup CPPHighAPI
151 /// \brief Create Extrusion feature.
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);
158 /// \ingroup CPPHighAPI
159 /// \brief Create Extrusion feature.
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);
166 /// \ingroup CPPHighAPI
167 /// \brief Create Extrusion feature.
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);
175 /// \ingroup CPPHighAPI
176 /// \brief Create Extrusion feature.
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);
185 /// \ingroup CPPHighAPI
186 /// \brief Create Extrusion feature.
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);
196 #endif // FeaturesAPI_Extrusion_H_