Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom 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
35   /// attribute name for first point
36   inline static const std::string& METHOD()
37   {
38     static const std::string METHOD_ATTR("creationMethod");
39     return METHOD_ATTR;
40   }
41   /// attribute name for first point
42   inline static const std::string& POINT_FIRST()
43   {
44     static const std::string POINT_ATTR_FIRST("firstPoint");
45     return POINT_ATTR_FIRST;
46   }
47   /// attribute name for second point
48   inline static const std::string& POINT_SECOND()
49   {
50     static const std::string POINT_ATTR_SECOND("secondPoint");
51     return POINT_ATTR_SECOND;
52   }
53   /// attribute name for second point
54   inline static const std::string& CYLINDRICAL_FACE()
55   {
56     static const std::string CYLINDRICAL_FACE_ATTR("cylindricalFace");
57     return CYLINDRICAL_FACE_ATTR;
58   }
59   /// default color for an axis
60   inline static const std::string& DEFAULT_COLOR()
61   {
62     static const std::string CONSTRUCTION_AXIS_COLOR("#000000");
63     return CONSTRUCTION_AXIS_COLOR;
64   }
65
66   inline static const double MINIMAL_LENGTH() { return 1.e-5; }
67
68   /// Creates a new part document if needed
69   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
70
71   /// Request for initialization of data model of the feature: adding all attributes
72   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
73
74   /// Construction result is allways recomuted on the fly
75   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
76
77   /// Use plugin manager for features creation
78   ConstructionPlugin_Axis();
79
80   /// Customize presentation of the feature
81   virtual void customisePresentation(AISObjectPtr thePrs);
82 };
83
84
85 #endif