Salome HOME
Task "Make the size of the selection area even bigger, especially for points"
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Point.h
index 03f9d3a9f2b5d11bc172aeb99cd34d891c074424..d1f15287f64d62d6e50bc67a555eac16a8e23ee9 100644 (file)
@@ -9,21 +9,9 @@
 
 #include "ConstructionPlugin.h"
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
 #include <GeomAPI_ICustomPrs.h>
 
-
-/// Point kind
-const std::string CONSTRUCTION_POINT_KIND("Point");
-
-/// attribute name for X coordinate
-const std::string POINT_ATTR_X = "x";
-/// attribute name for Y coordinate
-const std::string POINT_ATTR_Y = "y";
-/// attribute name for Z coordinate
-const std::string POINT_ATTR_Z = "z";
-
-#define CONSTRUCTION_POINT_COLOR "#ffff00"
-
 /**\class ConstructionPlugin_Point
  * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
@@ -32,10 +20,32 @@ class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustom
 {
  public:
   /// Returns the kind of a feature
-  CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
+  CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind();
+
+  /// Point kind
+  inline static const std::string& ID()
   {
-    static std::string MY_KIND = CONSTRUCTION_POINT_KIND;
-    return MY_KIND;
+    static const std::string CONSTRUCTION_POINT_KIND("Point");
+    return CONSTRUCTION_POINT_KIND;
+  }
+
+  /// attribute name for X coordinate
+  inline static const std::string& X()
+  {
+    static const std::string POINT_ATTR_X("x");
+    return POINT_ATTR_X;
+  }
+  /// attribute name for Y coordinate
+  inline static const std::string& Y()
+  {
+    static const std::string POINT_ATTR_Y("y");
+    return POINT_ATTR_Y;
+  }
+  /// attribute name for Z coordinate
+  inline static const std::string& Z()
+  {
+    static const std::string POINT_ATTR_Z("z");
+    return POINT_ATTR_Z;
   }
 
   /// Creates a new part document if needed
@@ -50,9 +60,9 @@ class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustom
   /// Use plugin manager for features creation
   ConstructionPlugin_Point();
 
-  /// Modifies the given presentation in the custom way.
-  virtual void customisePresentation(AISObjectPtr thePrs);
-
+  /// Customize presentation of the feature
+  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
 };
 
 #endif