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);
46 /// Constructor with values.
47 CONSTRUCTIONAPI_EXPORT
48 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 const ModelHighAPI_Selection& theObject1,
50 const ModelHighAPI_Selection& theObject2);
53 CONSTRUCTIONAPI_EXPORT
54 virtual ~ConstructionAPI_Point();
56 INTERFACE_10(ConstructionPlugin_Point::ID(),
57 creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
58 x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
59 y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
60 z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
61 edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
62 distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
63 distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
64 reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */,
65 point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */,
66 plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */
70 CONSTRUCTIONAPI_EXPORT
71 void setByXYZ(const ModelHighAPI_Double & theX,
72 const ModelHighAPI_Double & theY,
73 const ModelHighAPI_Double & theZ);
75 /// Set edge and distance on it for point.
76 CONSTRUCTIONAPI_EXPORT
77 void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
78 const ModelHighAPI_Double& theDistanceValue,
79 const bool theDistancePercent = false,
80 const bool theReverse = false);
82 /// Set point and plane for projection.
83 CONSTRUCTIONAPI_EXPORT
84 void setByProjection(const ModelHighAPI_Selection& theVertex,
85 const ModelHighAPI_Selection& thePlane);
88 /// Pointer on Point object.
89 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
91 /// \ingroup CPPHighAPI
92 /// \brief Create Point feature
93 CONSTRUCTIONAPI_EXPORT
94 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
95 const ModelHighAPI_Double & theX,
96 const ModelHighAPI_Double & theY,
97 const ModelHighAPI_Double & theZ);
99 /// \ingroup CPPHighAPI
100 /// \brief Create Point feature
101 CONSTRUCTIONAPI_EXPORT
102 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
103 const ModelHighAPI_Selection& theEdge,
104 const ModelHighAPI_Double& theDistanceValue,
105 const bool theDistancePercent = false,
106 const bool theReverse = false);
108 /// \ingroup CPPHighAPI
109 /// \brief Create Point feature
110 CONSTRUCTIONAPI_EXPORT
111 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
112 const ModelHighAPI_Selection& theObject1,
113 const ModelHighAPI_Selection& theObject2);
115 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */