Salome HOME
Issue #1057: Update title of property panel on operation type change
[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  *  \brief This feature allows to create sketch and extrude faces from this sketch
15  *         in a single operation.
16  */
17 class FeaturesPlugin_ExtrusionSketch : public FeaturesPlugin_CompositeSketch
18 {
19  public:
20   /// Feature kind.
21   inline static const std::string& ID()
22   {
23     static const std::string MY_EXTRUSION_ID("ExtrusionSketch");
24     return MY_EXTRUSION_ID;
25   }
26
27   /// \return the kind of a feature
28   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
29   {
30     static std::string MY_KIND = FeaturesPlugin_ExtrusionSketch::ID();
31     return MY_KIND;
32   }
33
34   /// attribute name for creation method
35   inline static const std::string& CREATION_METHOD()
36   {
37     static const std::string METHOD_ATTR("CreationMethod");
38     return METHOD_ATTR;
39   }
40
41   /// attribute name of extrusion size
42   inline static const std::string& TO_SIZE_ID()
43   {
44     static const std::string MY_TO_SIZE_ID("to_size");
45     return MY_TO_SIZE_ID;
46   }
47
48   /// attribute name of extrusion size
49   inline static const std::string& FROM_SIZE_ID()
50   {
51     static const std::string MY_FROM_SIZE_ID("from_size");
52     return MY_FROM_SIZE_ID;
53   }
54
55   /// attribute name of an object to which the extrusion grows.
56   inline static const std::string& TO_OBJECT_ID()
57   {
58     static const std::string MY_TO_OBJECT_ID("to_object");
59     return MY_TO_OBJECT_ID;
60   }
61
62   /// attribute name of extrusion offset
63   inline static const std::string& TO_OFFSET_ID()
64   {
65     static const std::string MY_TO_OFFSET_ID("to_offset");
66     return MY_TO_OFFSET_ID;
67   }
68
69   /// Attribute name of an object from which the extrusion grows.
70   inline static const std::string& FROM_OBJECT_ID()
71   {
72     static const std::string MY_FROM_OBJECT_ID("from_object");
73     return MY_FROM_OBJECT_ID;
74   }
75
76   /// attribute name of extrusion offset
77   inline static const std::string& FROM_OFFSET_ID()
78   {
79     static const std::string MY_FROM_OFFSET_ID("from_offset");
80     return MY_FROM_OFFSET_ID;
81   }
82
83 protected:
84   /// Init attributes for extrusion.
85   virtual void initMakeSolidsAttributes();
86
87   /// Create solid from face with extrusion.
88   virtual void makeSolid(const std::shared_ptr<GeomAPI_Shape> theFace,
89                          std::shared_ptr<GeomAPI_Shape>& theResult,
90                          ListOfShape& theFromFaces,
91                          ListOfShape& theToFaces,
92                          std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape,
93                          std::shared_ptr<GeomAPI_DataMapOfShapeShape>& theDataMap);
94
95 public:
96   /// Use plugin manager for features creation.
97   FeaturesPlugin_ExtrusionSketch();
98 };
99
100 #endif