1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Extrusion.h
4 // Created: 30 May 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef FeaturesPlugin_Extrusion_H_
8 #define FeaturesPlugin_Extrusion_H_
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <ModelAPI_ResultBody.h>
13 #include <GeomAlgoAPI_Extrusion.h>
14 #include <GeomAPI_Shape.h>
16 /**\class FeaturesPlugin_Extrusion
18 * \brief Feature for creation of extrusion from the planar face.
20 * Extrusion creates the lateral faces based on edges of the base face and
21 * the top face equal to the base face. Direction of extrusion is taken from the face
22 * plane, but can be corrected by the "reverse" flag.
24 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
28 inline static const std::string& ID()
30 static const std::string MY_EXTRUSION_ID("Extrusion");
31 return MY_EXTRUSION_ID;
33 /// attribute name of references sketch entities list, it should contain a sketch result or
34 /// a pair a sketch result to sketch face
35 inline static const std::string& LIST_ID()
37 static const std::string MY_GROUP_LIST_ID("base");
38 return MY_GROUP_LIST_ID;
41 /// attribute name of extrusion size
42 inline static const std::string& SIZE_ID()
44 static const std::string MY_SIZE_ID("size");
47 /// attribute name of reverse direction
48 inline static const std::string& REVERSE_ID()
50 static const std::string MY_REVERSE_ID("reverse");
54 /// Returns the kind of a feature
55 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
57 static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
61 /// Creates a new part document if needed
62 FEATURESPLUGIN_EXPORT virtual void execute();
64 /// Request for initialization of data model of the feature: adding all attributes
65 FEATURESPLUGIN_EXPORT virtual void initAttributes();
67 /// Use plugin manager for features creation
68 FeaturesPlugin_Extrusion();
70 /// Load Naming data structure of the feature to the document
71 void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
72 std::shared_ptr<GeomAPI_Shape> theBasis,
73 std::shared_ptr<GeomAPI_Shape> theContext);
75 /// Set an empty shape to the result of extrusion