1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ConstructionPlugin_Point.h
5 // Author: Mikhail PONIKAROV
7 #ifndef ConstructionPlugin_Point_H_
8 #define ConstructionPlugin_Point_H_
10 #include "ConstructionPlugin.h"
12 #include <GeomAPI_ICustomPrs.h>
13 #include <ModelAPI_Feature.h>
14 #include <ModelAPI_Result.h>
16 /// \class ConstructionPlugin_Point
18 /// \brief Feature for creation of the new part in PartSet.
19 class ConstructionPlugin_Point: public ModelAPI_Feature, public GeomAPI_ICustomPrs
22 /// Returns the kind of a feature.
23 CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind();
26 inline static const std::string& ID()
28 static const std::string CONSTRUCTION_POINT_KIND("Point");
29 return CONSTRUCTION_POINT_KIND;
32 /// Attribute name for creation method.
33 inline static const std::string& CREATION_METHOD()
35 static const std::string MY_CREATION_METHOD_ID("creation_method");
36 return MY_CREATION_METHOD_ID;
39 /// Attribute name for creation method.
40 inline static const std::string& CREATION_METHOD_BY_XYZ()
42 static const std::string MY_CREATION_METHOD_ID("by_xyz");
43 return MY_CREATION_METHOD_ID;
46 /// Attribute name for creation method.
47 inline static const std::string& CREATION_METHOD_BY_DISTANCE_ON_EDGE()
49 static const std::string MY_CREATION_METHOD_ID("by_distance_on_edge");
50 return MY_CREATION_METHOD_ID;
53 /// Attribute name for X coordinate.
54 inline static const std::string& X()
56 static const std::string POINT_ATTR_X("x");
60 /// Attribute name for Y coordinate.
61 inline static const std::string& Y()
63 static const std::string POINT_ATTR_Y("y");
67 /// Attribute name for Z coordinate.
68 inline static const std::string& Z()
70 static const std::string POINT_ATTR_Z("z");
74 /// Attribute name for seleted edge.
75 inline static const std::string& EDGE()
77 static const std::string ATTR_ID("edge");
81 /// Attribute name for distance.
82 inline static const std::string& DISTANCE_VALUE()
84 static const std::string ATTR_ID("value");
88 /// Attribute name for percent flag.
89 inline static const std::string& DISTANCE_PERCENT()
91 static const std::string ATTR_ID("percent");
95 /// Attribute name for reverse flag.
96 inline static const std::string& REVERSE()
98 static const std::string ATTR_ID("reverse");
102 /// Creates a new part document if needed.
103 CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
105 /// Request for initialization of data model of the feature: adding all attributes.
106 CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
108 /// Construction result is allways recomuted on the fly.
109 CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
111 /// Use plugin manager for features creation
112 ConstructionPlugin_Point();
114 /// Customize presentation of the feature
115 virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
116 std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
119 std::shared_ptr<GeomAPI_Shape> createByXYZ();
120 std::shared_ptr<GeomAPI_Shape> createByDistanceOnEdge();