Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[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 /**\class ConstructionPlugin_Axis
15  * \ingroup Plugins
16  * \brief Feature for creation of the new axis in PartSet.
17  */
18 class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomPrs
19 {
20  public:
21   /// Returns the kind of a feature
22   CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
23   {
24     static std::string MY_KIND = ConstructionPlugin_Axis::ID();
25     return MY_KIND;
26   }
27
28   /// Axis kind
29   inline static const std::string& ID()
30   {
31     static const std::string CONSTRUCTION_AXIS_KIND("Axis");
32     return CONSTRUCTION_AXIS_KIND;
33   }
34   /// attribute name for first point
35   inline static const std::string& POINT_FIRST()
36   {
37     static const std::string POINT_ATTR_FIRST("firstPoint");
38     return POINT_ATTR_FIRST;
39   }
40   /// attribute name for second point
41   inline static const std::string& POINT_SECOND()
42   {
43     static const std::string POINT_ATTR_SECOND("secondPoint");
44     return POINT_ATTR_SECOND;
45   }
46   /// default color for an axis
47   inline static const std::string& DEFAULT_COLOR()
48   {
49     static const std::string CONSTRUCTION_AXIS_COLOR("#000000");
50     return CONSTRUCTION_AXIS_COLOR;
51   }
52
53   inline static const double MINIMAL_LENGTH() { return 1.e-5; }
54
55   /// Creates a new part document if needed
56   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
57
58   /// Request for initialization of data model of the feature: adding all attributes
59   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
60
61   /// Construction result is allways recomuted on the fly
62   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
63
64   /// Use plugin manager for features creation
65   ConstructionPlugin_Axis();
66
67   /// Customize presentation of the feature
68   virtual void customisePresentation(AISObjectPtr thePrs);
69 };
70
71
72 #endif