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