Salome HOME
Color preferences for the constraints
[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
15 /// Point kind
16 const std::string CONSTRUCTION_POINT_KIND("Point");
17
18 /// attribute name for X coordinate
19 const std::string POINT_ATTR_X = "x";
20 /// attribute name for Y coordinate
21 const std::string POINT_ATTR_Y = "y";
22 /// attribute name for Z coordinate
23 const std::string POINT_ATTR_Z = "z";
24
25 #define CONSTRUCTION_POINT_COLOR "#ffff00"
26
27 /**\class ConstructionPlugin_Point
28  * \ingroup Plugins
29  * \brief Feature for creation of the new part in PartSet.
30  */
31 class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustomPrs
32 {
33  public:
34   /// Returns the kind of a feature
35   CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
36   {
37     static std::string MY_KIND = CONSTRUCTION_POINT_KIND;
38     return MY_KIND;
39   }
40
41   /// Creates a new part document if needed
42   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
43
44   /// Request for initialization of data model of the feature: adding all attributes
45   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
46
47   /// Construction result is allways recomuted on the fly
48   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
49
50   /// Use plugin manager for features creation
51   ConstructionPlugin_Point();
52
53   /// Modifies the given presentation in the custom way.
54   virtual void customisePresentation(AISObjectPtr thePrs);
55
56 };
57
58 #endif