Salome HOME
d1f15287f64d62d6e50bc67a555eac16a8e23ee9
[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 <ModelAPI_Result.h>
13 #include <GeomAPI_ICustomPrs.h>
14
15 /**\class ConstructionPlugin_Point
16  * \ingroup Plugins
17  * \brief Feature for creation of the new part in PartSet.
18  */
19 class ConstructionPlugin_Point : 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   /// Point kind
26   inline static const std::string& ID()
27   {
28     static const std::string CONSTRUCTION_POINT_KIND("Point");
29     return CONSTRUCTION_POINT_KIND;
30   }
31
32   /// attribute name for X coordinate
33   inline static const std::string& X()
34   {
35     static const std::string POINT_ATTR_X("x");
36     return POINT_ATTR_X;
37   }
38   /// attribute name for Y coordinate
39   inline static const std::string& Y()
40   {
41     static const std::string POINT_ATTR_Y("y");
42     return POINT_ATTR_Y;
43   }
44   /// attribute name for Z coordinate
45   inline static const std::string& Z()
46   {
47     static const std::string POINT_ATTR_Z("z");
48     return POINT_ATTR_Z;
49   }
50
51   /// Creates a new part document if needed
52   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
53
54   /// Request for initialization of data model of the feature: adding all attributes
55   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
56
57   /// Construction result is allways recomuted on the fly
58   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
59
60   /// Use plugin manager for features creation
61   ConstructionPlugin_Point();
62
63   /// Customize presentation of the feature
64   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
65                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
66 };
67
68 #endif