Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Point.h
1 // Name   : ConstructionAPI_Point.h
2 // Purpose: 
3 //
4 // History:
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
9
10 #include "ConstructionAPI.h"
11
12 #include <ConstructionPlugin_Point.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelAPI_AttributeDouble;
18 class ModelAPI_Document;
19 class ModelHighAPI_Double;
20
21 /// \class ConstructionAPI_Point
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Point feature.
24 class ConstructionAPI_Point: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   CONSTRUCTIONAPI_EXPORT
29   explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
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);
37
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);
45
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);*/
51
52   /// Destructor.
53   CONSTRUCTIONAPI_EXPORT
54   virtual ~ConstructionAPI_Point();
55
56   INTERFACE_3(ConstructionPlugin_Point::ID(),
57               x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
58               y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
59               z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */)
60
61   //INTERFACE_14(ConstructionPlugin_Point::ID(),
62   //             creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
63   //             x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
64   //             y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
65   //             z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
66   //             edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
67   //             distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
68   //             distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
69   //             reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */,
70   //             point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */,
71   //             plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */,
72   //             firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */,
73   //             secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */,
74   //             intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */,
75   //             intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */
76   //)
77
78   /// Set point values.
79   CONSTRUCTIONAPI_EXPORT
80   void setByXYZ(const ModelHighAPI_Double & theX,
81                 const ModelHighAPI_Double & theY,
82                 const ModelHighAPI_Double & theZ);
83
84   /*/// Set edge and distance on it for point.
85   CONSTRUCTIONAPI_EXPORT
86   void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
87                            const ModelHighAPI_Double& theDistanceValue,
88                            const bool theDistancePercent = false,
89                            const bool theReverse = false);
90
91   /// Set point and plane for projection.
92   CONSTRUCTIONAPI_EXPORT
93   void setByProjection(const ModelHighAPI_Selection& theVertex,
94                        const ModelHighAPI_Selection& theFace);
95
96   /// Set lines for intersections.
97   CONSTRUCTIONAPI_EXPORT
98   void setByLinesIntersection(const ModelHighAPI_Selection& theEdge1,
99                               const ModelHighAPI_Selection& theEdge2);
100
101   /// Set line and plane for intersections.
102   CONSTRUCTIONAPI_EXPORT
103   void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
104                                      const ModelHighAPI_Selection& theFace);*/
105
106   /// Dump wrapped feature
107   CONSTRUCTIONAPI_EXPORT
108   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
109 };
110
111 /// Pointer on Point object.
112 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
113
114 /// \ingroup CPPHighAPI
115 /// \brief Create Point feature
116 CONSTRUCTIONAPI_EXPORT
117 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
118                   const ModelHighAPI_Double & theX,
119                   const ModelHighAPI_Double & theY,
120                   const ModelHighAPI_Double & theZ);
121
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& theEdge,
127                   const ModelHighAPI_Double& theDistanceValue,
128                   const bool theDistancePercent = false,
129                   const bool theReverse = false);
130
131 /// \ingroup CPPHighAPI
132 /// \brief Create Point feature
133 CONSTRUCTIONAPI_EXPORT
134 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
135                   const ModelHighAPI_Selection& theObject1,
136                   const ModelHighAPI_Selection& theObject2);*/
137
138 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */