Salome HOME
8e0f0fcda6f74a4b959fdbbe664db39ab332ed0a
[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   inline static const std::string& ID()
26   {
27     static const std::string CONSTRUCTION_POINT_KIND("Point");
28     return CONSTRUCTION_POINT_KIND;
29   }
30
31   /// attribute name for X coordinate
32   inline static const std::string& X()
33   {
34     static const std::string POINT_ATTR_X("x");
35     return POINT_ATTR_X;
36   }
37   /// attribute name for Y coordinate
38   inline static const std::string& Y()
39   {
40     static const std::string POINT_ATTR_Y("y");
41     return POINT_ATTR_Y;
42   }
43   /// attribute name for Z coordinate
44   inline static const std::string& Z()
45   {
46     static const std::string POINT_ATTR_Z("z");
47     return POINT_ATTR_Z;
48   }
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_Point();
61
62   /// Customize presentation of the feature
63   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
64                                      std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
65 };
66
67 #endif