]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/FeaturesPlugin_Revolution.h
Salome HOME
Issue #1343 Improvement of Extrusion and Revolution operations: revolution/revolution...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Revolution.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_Revolution.h
4 // Created:     12 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Revolution_H_
8 #define FeaturesPlugin_Revolution_H_
9
10 #include <FeaturesPlugin.h>
11
12 #include <GeomAlgoAPI_Revolution.h>
13 #include <FeaturesPlugin_CompositeSketch.h>
14
15 class GeomAPI_Shape;
16 class ModelAPI_ResultBody;
17
18 /** \class FeaturesPlugin_Revolution
19  *  \ingroup Plugins
20  *  \brief Feature for creation of revolution from the planar face.
21  *  Revolution creates the lateral faces based on edges of the base face and
22  *  the start and end faces and/or start and end angles.
23  */
24 class FeaturesPlugin_Revolution : public FeaturesPlugin_CompositeSketch
25 {
26  public:
27   /// Revolution kind.
28   inline static const std::string& ID()
29   {
30     static const std::string MY_REVOLUTION_ID("Revolution");
31     return MY_REVOLUTION_ID;
32   }
33
34   /// Attribute name of an revolution axis.
35   inline static const std::string& AXIS_OBJECT_ID()
36   {
37     static const std::string MY_AXIS_ID("axis_object");
38     return MY_AXIS_ID;
39   }
40
41   /// attribute name for creation method
42   inline static const std::string& CREATION_METHOD()
43   {
44     static const std::string METHOD_ATTR("CreationMethod");
45     return METHOD_ATTR;
46   }
47
48   /// Attribute name of revolution angle.
49   inline static const std::string& TO_ANGLE_ID()
50   {
51     static const std::string MY_TO_ANGLE_ID("to_angle");
52     return MY_TO_ANGLE_ID;
53   }
54
55   /// Attribute name of revolution angle.
56   inline static const std::string& FROM_ANGLE_ID()
57   {
58     static const std::string MY_FROM_ANGLE_ID("from_angle");
59     return MY_FROM_ANGLE_ID;
60   }
61
62   /// Attribute name of an object to which the revolution grows.
63   inline static const std::string& TO_OBJECT_ID()
64   {
65     static const std::string MY_TO_OBJECT_ID("to_object");
66     return MY_TO_OBJECT_ID;
67   }
68
69   /// attribute name of extrusion offset.
70   inline static const std::string& TO_OFFSET_ID()
71   {
72     static const std::string MY_TO_OFFSET_ID("to_offset");
73     return MY_TO_OFFSET_ID;
74   }
75
76   /// Attribute name of tool object.
77   inline static const std::string& FROM_OBJECT_ID()
78   {
79     static const std::string MY_FROM_OBJECT_ID("from_object");
80     return MY_FROM_OBJECT_ID;
81   }
82
83   /// attribute name of extrusion offset.
84   inline static const std::string& FROM_OFFSET_ID()
85   {
86     static const std::string MY_FROM_OFFSET_ID("from_offset");
87     return MY_FROM_OFFSET_ID;
88   }
89
90   /// \return the kind of a feature.
91   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
92   {
93     static std::string MY_KIND = FeaturesPlugin_Revolution::ID();
94     return MY_KIND;
95   }
96
97   /// Creates a new part document if needed.
98   FEATURESPLUGIN_EXPORT virtual void execute();
99
100   /// Request for initialization of data model of the feature: adding all attributes.
101   FEATURESPLUGIN_EXPORT virtual void initAttributes();
102
103   /// Use plugin manager for features creation.
104   FeaturesPlugin_Revolution();
105
106 private:
107   /// Load Naming data structure of the feature to the document.
108   void loadNamingDS(GeomAlgoAPI_Revolution& theRevolAlgo,
109                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
110                     std::shared_ptr<GeomAPI_Shape> theBasis);
111 };
112
113 #endif