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_14(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 */,
67 firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */,
68 secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */,
69 intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */,
70 intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */
74 CONSTRUCTIONAPI_EXPORT
75 void setByXYZ(const ModelHighAPI_Double & theX,
76 const ModelHighAPI_Double & theY,
77 const ModelHighAPI_Double & theZ);
79 /// Set edge and distance on it for point.
80 CONSTRUCTIONAPI_EXPORT
81 void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
82 const ModelHighAPI_Double& theDistanceValue,
83 const bool theDistancePercent = false,
84 const bool theReverse = false);
86 /// Set point and plane for projection.
87 CONSTRUCTIONAPI_EXPORT
88 void setByProjection(const ModelHighAPI_Selection& theVertex,
89 const ModelHighAPI_Selection& theFace);
91 /// Set lines for intersections.
92 CONSTRUCTIONAPI_EXPORT
93 void setByLinesIntersection(const ModelHighAPI_Selection& theEdge1,
94 const ModelHighAPI_Selection& theEdge2);
96 /// Set line and plane for intersections.
97 CONSTRUCTIONAPI_EXPORT
98 void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
99 const ModelHighAPI_Selection& theFace);
102 /// Pointer on Point object.
103 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
105 /// \ingroup CPPHighAPI
106 /// \brief Create Point feature
107 CONSTRUCTIONAPI_EXPORT
108 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
109 const ModelHighAPI_Double & theX,
110 const ModelHighAPI_Double & theY,
111 const ModelHighAPI_Double & theZ);
113 /// \ingroup CPPHighAPI
114 /// \brief Create Point feature
115 CONSTRUCTIONAPI_EXPORT
116 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
117 const ModelHighAPI_Selection& theEdge,
118 const ModelHighAPI_Double& theDistanceValue,
119 const bool theDistancePercent = false,
120 const bool theReverse = false);
122 /// \ingroup CPPHighAPI
123 /// \brief Create Point feature
124 CONSTRUCTIONAPI_EXPORT
125 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
126 const ModelHighAPI_Selection& theObject1,
127 const ModelHighAPI_Selection& theObject2);
129 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */