Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pnt.h
1 // File:        GeomAPI_Pnt.hxx
2 // Created:     23 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef GeomAPI_Pnt_H_
6 #define GeomAPI_Pnt_H_
7
8 #include <GeomAPI_Interface.h>
9 #include <memory>
10
11 class GeomAPI_XYZ;
12 class GeomAPI_Pnt2d;
13 class GeomAPI_Dir;
14
15 /**\class GeomAPI_Pnt
16  * \ingroup DataModel
17  * \brief 3D point defined by three coordinates
18  */
19
20 class GEOMAPI_EXPORT GeomAPI_Pnt : public GeomAPI_Interface
21 {
22  public:
23   /// Creation of point by coordinates
24   GeomAPI_Pnt(const double theX, const double theY, const double theZ);
25   /// Creation of point by coordinates
26   GeomAPI_Pnt(const std::shared_ptr<GeomAPI_XYZ>& theCoords);
27
28   /// returns X coordinate
29   double x() const;
30   /// returns Y coordinate
31   double y() const;
32   /// returns Z coordinate
33   double z() const;
34
35   /// sets X coordinate
36   void setX(const double theX);
37   /// sets Y coordinate
38   void setY(const double theY);
39   /// sets Z coordinate
40   void setZ(const double theZ);
41
42   /// returns coordinates of the point
43   const std::shared_ptr<GeomAPI_XYZ> xyz();
44
45   /// Distance between two points
46   double distance(const std::shared_ptr<GeomAPI_Pnt>& theOther) const;
47
48   /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane
49   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
50                                         const std::shared_ptr<GeomAPI_Dir>& theDirX,
51                                         const std::shared_ptr<GeomAPI_Dir>& theDirY);
52 };
53
54 #endif