Salome HOME
GeomAlgoAPI_Rotation now derived from GeomAlgoAPI_MakeShape
[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 #include <GeomAlgoAPI_Rotation.h>
15
16 /// \class FeaturesPlugin_Rotation
17 /// \ingroup Plugins
18 /// \brief Feature for rotation objects around the axis.
19 class FeaturesPlugin_Rotation : public ModelAPI_Feature
20 {
21  public:
22   /// Rotation kind.
23   inline static const std::string& ID()
24   {
25     static const std::string MY_ROTATION_ID("Rotation");
26     return MY_ROTATION_ID;
27   }
28
29   /// Attribute name of referenced objects.
30   inline static const std::string& OBJECTS_LIST_ID()
31   {
32     static const std::string MY_OBJECTS_LIST_ID("main_objects");
33     return MY_OBJECTS_LIST_ID;
34   }
35
36   /// Attribute name of an axis.
37   inline static const std::string& AXIS_OBJECT_ID()
38   {
39     static const std::string MY_AXIS_OBJECT_ID("axis_object");
40     return MY_AXIS_OBJECT_ID;
41   }
42
43   /// Attribute name of angle.
44   inline static const std::string& ANGLE_ID()
45   {
46     static const std::string MY_ANGLE_ID("angle");
47     return MY_ANGLE_ID;
48   }
49
50   /// \return the kind of a feature.
51   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
52   {
53     static std::string MY_KIND = FeaturesPlugin_Rotation::ID();
54     return MY_KIND;
55   }
56
57   /// Creates a new part document if needed.
58   FEATURESPLUGIN_EXPORT virtual void execute();
59
60   /// Request for initialization of data model of the feature: adding all attributes.
61   FEATURESPLUGIN_EXPORT virtual void initAttributes();
62
63   /// Use plugin manager for features creation.
64   FeaturesPlugin_Rotation();
65
66 private:
67   void loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
68                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
69                     std::shared_ptr<GeomAPI_Shape> theBaseShape);
70 };
71
72 #endif