1 // Name : ConstructionAPI_Point.h
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
10 #include "ConstructionAPI.h"
12 #include <ConstructionPlugin_Point.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelAPI_AttributeDouble;
18 class ModelAPI_Document;
19 class ModelHighAPI_Double;
21 /// \class ConstructionAPI_Point
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Point feature
24 class ConstructionAPI_Point: public ModelHighAPI_Interface
27 /// Constructor without values
28 CONSTRUCTIONAPI_EXPORT
29 explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31 /// Constructor with values
32 CONSTRUCTIONAPI_EXPORT
33 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34 const ModelHighAPI_Double& theX,
35 const ModelHighAPI_Double& theY,
36 const ModelHighAPI_Double& theZ);
38 /// Constructor with values
39 CONSTRUCTIONAPI_EXPORT
40 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41 const ModelHighAPI_Selection& theEdge,
42 const ModelHighAPI_Double& theDistanceValue,
43 const bool theDistancePercent = false,
44 const bool theReverse = false);
47 CONSTRUCTIONAPI_EXPORT
48 virtual ~ConstructionAPI_Point();
50 INTERFACE_8(ConstructionPlugin_Point::ID(),
51 creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
52 x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
53 y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
54 z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
55 edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
56 distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
57 distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
58 reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */
62 CONSTRUCTIONAPI_EXPORT
63 void setByXYZ(const ModelHighAPI_Double & theX,
64 const ModelHighAPI_Double & theY,
65 const ModelHighAPI_Double & theZ);
67 /// Set edge and distance on it for point
68 CONSTRUCTIONAPI_EXPORT
69 void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
70 const ModelHighAPI_Double& theDistanceValue,
71 const bool theDistancePercent = false,
72 const bool theReverse = false);
75 /// Pointer on Point object
76 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
78 /// \ingroup CPPHighAPI
79 /// \brief Create Point feature
80 CONSTRUCTIONAPI_EXPORT
81 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
82 const ModelHighAPI_Double & theX,
83 const ModelHighAPI_Double & theY,
84 const ModelHighAPI_Double & theZ);
86 /// \ingroup CPPHighAPI
87 /// \brief Create Point feature
88 CONSTRUCTIONAPI_EXPORT
89 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
90 const ModelHighAPI_Selection& theEdge,
91 const ModelHighAPI_Double& theDistanceValue,
92 const bool theDistancePercent = false,
93 const bool theReverse = false);
95 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */