Salome HOME
f9db7e535c3ca6bf2a3ecef18b4ac4d39a73a84a
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_ExtrusionSketch.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_ExtrusionSketch.h
4 // Created:     11 September 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_ExtrusionSketch_H_
8 #define FeaturesPlugin_ExtrusionSketch_H_
9
10 #include <FeaturesPlugin_CompositeSketch.h>
11
12 /** \class FeaturesPlugin_ExtrusionSketch
13  *  \ingroup Plugins
14  */
15 class FeaturesPlugin_ExtrusionSketch : public FeaturesPlugin_CompositeSketch
16 {
17  public:
18   /// Feature kind.
19   inline static const std::string& ID()
20   {
21     static const std::string MY_EXTRUSION_ID("ExtrusionSketch");
22     return MY_EXTRUSION_ID;
23   }
24
25   /// \return the kind of a feature
26   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
27   {
28     static std::string MY_KIND = FeaturesPlugin_ExtrusionSketch::ID();
29     return MY_KIND;
30   }
31
32   /// attribute name for creation method
33   inline static const std::string& CREATION_METHOD()
34   {
35     static const std::string METHOD_ATTR("CreationMethod");
36     return METHOD_ATTR;
37   }
38
39   /// attribute name of extrusion size
40   inline static const std::string& TO_SIZE_ID()
41   {
42     static const std::string MY_TO_SIZE_ID("to_size");
43     return MY_TO_SIZE_ID;
44   }
45
46   /// attribute name of extrusion size
47   inline static const std::string& FROM_SIZE_ID()
48   {
49     static const std::string MY_FROM_SIZE_ID("from_size");
50     return MY_FROM_SIZE_ID;
51   }
52
53   /// attribute name of an object to which the extrusion grows.
54   inline static const std::string& TO_OBJECT_ID()
55   {
56     static const std::string MY_TO_OBJECT_ID("to_object");
57     return MY_TO_OBJECT_ID;
58   }
59
60   /// attribute name of extrusion offset
61   inline static const std::string& TO_OFFSET_ID()
62   {
63     static const std::string MY_TO_OFFSET_ID("to_offset");
64     return MY_TO_OFFSET_ID;
65   }
66
67   /// Attribute name of an object from which the extrusion grows.
68   inline static const std::string& FROM_OBJECT_ID()
69   {
70     static const std::string MY_FROM_OBJECT_ID("from_object");
71     return MY_FROM_OBJECT_ID;
72   }
73
74   /// attribute name of extrusion offset
75   inline static const std::string& FROM_OFFSET_ID()
76   {
77     static const std::string MY_FROM_OFFSET_ID("from_offset");
78     return MY_FROM_OFFSET_ID;
79   }
80
81 protected:
82   /// Init attributes for extrusion.
83   virtual void initMakeSolidsAttributes();
84
85   /// Create solid from face with extrusion.
86   virtual void makeSolid(const std::shared_ptr<GeomAPI_Shape> theFace,
87                          std::shared_ptr<GeomAPI_Shape>& theResult,
88                          ListOfShape& theFromFaces,
89                          ListOfShape& theToFaces,
90                          std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
91                          std::shared_ptr<GeomAPI_DataMapOfShapeShape>& theDataMap);
92
93 public:
94   /// Use plugin manager for features creation.
95   FeaturesPlugin_ExtrusionSketch();
96 };
97
98 #endif