]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionPlugin/ConstructionPlugin_Axis.h
Salome HOME
"Initialization" plugin: plugin and it's features stubs created
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Axis.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ConstructionPlugin_Axis.h
4 // Created:     12 Dec 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ConstructionPlugin_Axis_H
8 #define ConstructionPlugin_Axis_H
9
10 #include "ConstructionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_ICustomPrs.h>
13
14
15 /**\class ConstructionPlugin_Axis
16  * \ingroup Plugins
17  * \brief Feature for creation of the new axis in PartSet.
18  */
19 class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomPrs
20 {
21  public:
22   /// Returns the kind of a feature
23   CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
24   {
25     static std::string MY_KIND = ConstructionPlugin_Axis::ID();
26     return MY_KIND;
27   }
28
29   /// Axis kind
30   inline static const std::string& ID()
31   {
32     static const std::string CONSTRUCTION_AXIS_KIND("Axis");
33     return CONSTRUCTION_AXIS_KIND;
34   }
35   /// attribute name for first point
36   inline static const std::string& POINT_FIRST()
37   {
38     static const std::string POINT_ATTR_FIRST("firstPoint");
39     return POINT_ATTR_FIRST;
40   }
41   /// attribute name for second point
42   inline static const std::string& POINT_SECOND()
43   {
44     static const std::string POINT_ATTR_SECOND("secondPoint");
45     return POINT_ATTR_SECOND;
46   }
47
48   inline static const double MINIMAL_LENGTH() { return 1.e-5; }
49
50   /// Creates a new part document if needed
51   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
52
53   /// Request for initialization of data model of the feature: adding all attributes
54   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
55
56   /// Construction result is allways recomuted on the fly
57   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
58
59   /// Use plugin manager for features creation
60   ConstructionPlugin_Axis();
61
62   /// Customize presentation of the feature
63   virtual void customisePresentation(AISObjectPtr thePrs);
64 };
65
66
67 #endif