Salome HOME
Specification controls
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Rotation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_Rotation.h
4 // Created:     12 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Rotation_H_
8 #define FeaturesPlugin_Rotation_H_
9
10 #include <FeaturesPlugin.h>
11
12 #include <ModelAPI_Feature.h>
13
14 /** \class FeaturesPlugin_Rotation
15  *  \ingroup Plugins
16  *  \brief Feature for creation of revolution from the planar face.
17  *  Revolution creates the lateral faces based on edges of the base face and
18  *  the start and end faces and/or start and end angles.
19  */
20 class FeaturesPlugin_Rotation : public ModelAPI_Feature
21 {
22  public:
23   /// Revolution kind.
24   inline static const std::string& ID()
25   {
26     static const std::string MY_REVOLUTION_ID("Rotation");
27     return MY_REVOLUTION_ID;
28   }
29
30   /// Attribute name of references sketch entities list, it should contain a sketch result or
31   /// a pair a sketch result to sketch face.
32   inline static const std::string& LIST_ID()
33   {
34     static const std::string MY_GROUP_LIST_ID("base");
35     return MY_GROUP_LIST_ID;
36   }
37
38   /// Attribute name of an object to which the extrusion grows.
39   inline static const std::string& AXIS_OBJECT_ID()
40   {
41     static const std::string MY_TO_OBJECT_ID("axis_object");
42     return MY_TO_OBJECT_ID;
43   }
44
45   /// Attribute name of revolution angle.
46   inline static const std::string& ANGLE_ID()
47   {
48     static const std::string MY_TO_ANGLE_ID("angle");
49     return MY_TO_ANGLE_ID;
50   }
51
52   /// \return the kind of a feature.
53   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
54   {
55     static std::string MY_KIND = FeaturesPlugin_Rotation::ID();
56     return MY_KIND;
57   }
58
59   /// Creates a new part document if needed.
60   FEATURESPLUGIN_EXPORT virtual void execute();
61
62   /// Request for initialization of data model of the feature: adding all attributes.
63   FEATURESPLUGIN_EXPORT virtual void initAttributes();
64
65   /// Use plugin manager for features creation.
66   FeaturesPlugin_Rotation();
67 };
68
69 #endif