Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Point.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ConstructionPlugin_Point.h
4 // Created:     3 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ConstructionPlugin_Point_H_
8 #define ConstructionPlugin_Point_H_
9
10 #include "ConstructionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_ICustomPrs.h>
13
14 /**\class ConstructionPlugin_Point
15  * \ingroup Plugins
16  * \brief Feature for creation of the new part in PartSet.
17  */
18 class ConstructionPlugin_Point : 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   inline static const std::string& ID()
25   {
26     static const std::string CONSTRUCTION_POINT_KIND("Point");
27     return CONSTRUCTION_POINT_KIND;
28   }
29
30   /// default color for a point
31   inline static const std::string& DEFAULT_COLOR()
32   {
33     static const std::string CONSTRUCTION_POINT_COLOR("#ffff00");
34     return CONSTRUCTION_POINT_COLOR;
35   }
36
37   /// attribute name for X coordinate
38   inline static const std::string& X()
39   {
40     static const std::string POINT_ATTR_X("x");
41     return POINT_ATTR_X;
42   }
43   /// attribute name for Y coordinate
44   inline static const std::string& Y()
45   {
46     static const std::string POINT_ATTR_Y("y");
47     return POINT_ATTR_Y;
48   }
49   /// attribute name for Z coordinate
50   inline static const std::string& Z()
51   {
52     static const std::string POINT_ATTR_Z("z");
53     return POINT_ATTR_Z;
54   }
55
56   /// Creates a new part document if needed
57   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
58
59   /// Request for initialization of data model of the feature: adding all attributes
60   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
61
62   /// Construction result is allways recomuted on the fly
63   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
64
65   /// Use plugin manager for features creation
66   ConstructionPlugin_Point();
67
68   /// Modifies the given presentation in the custom way.
69   virtual void customisePresentation(AISObjectPtr thePrs);
70
71 };
72
73 #endif