Salome HOME
Code clean up
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Translation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        FeaturesPlugin_Translation.h
4 // Created:     8 June 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesPlugin_Translation_H_
8 #define FeaturesPlugin_Translation_H_
9
10 #include <FeaturesPlugin.h>
11
12 #include <ModelAPI_Feature.h>
13
14 #include <GeomAlgoAPI_Translation.h>
15
16 /** \class FeaturesPlugin_Translation
17  *  \ingroup Plugins
18  *  \brief Feature for movement objects along the axis.
19  */
20 class FeaturesPlugin_Translation : public ModelAPI_Feature
21 {
22  public:
23   /// Movement kind.
24   inline static const std::string& ID()
25   {
26     static const std::string MY_MOVEMENT_ID("Translation");
27     return MY_MOVEMENT_ID;
28   }
29
30   /// Attribute name of referenced objects.
31   inline static const std::string& OBJECTS_LIST_ID()
32   {
33     static const std::string MY_OBJECTS_LIST_ID("main_objects");
34     return MY_OBJECTS_LIST_ID;
35   }
36
37   /// Attribute name of an axis.
38   inline static const std::string& AXIS_OBJECT_ID()
39   {
40     static const std::string MY_AXIS_OBJECT_ID("axis_object");
41     return MY_AXIS_OBJECT_ID;
42   }
43
44   /// Attribute name of distance.
45   inline static const std::string& DISTANCE_ID()
46   {
47     static const std::string MY_DISTANCE_ID("distance");
48     return MY_DISTANCE_ID;
49   }
50
51   /// \return the kind of a feature.
52   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
53   {
54     static std::string MY_KIND = FeaturesPlugin_Translation::ID();
55     return MY_KIND;
56   }
57
58   /// Creates a new part document if needed.
59   FEATURESPLUGIN_EXPORT virtual void execute();
60
61   /// Request for initialization of data model of the feature: adding all attributes.
62   FEATURESPLUGIN_EXPORT virtual void initAttributes();
63
64   /// Use plugin manager for features creation.
65   FeaturesPlugin_Translation();
66
67 private:
68   void LoadNamingDS(const GeomAlgoAPI_Translation& theMovementAlgo,
69                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
70                     std::shared_ptr<GeomAPI_Shape> theBaseShape);
71 };
72
73 #endif