Salome HOME
Make plane as close as possible to selected shape by its size
[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 class GeomAPI_Pln;
17
18 /**\class GeomAPI_Pnt
19  * \ingroup DataModel
20  * \brief 3D point defined by three coordinates
21  */
22
23 class GEOMAPI_EXPORT GeomAPI_Pnt : public GeomAPI_Interface
24 {
25  public:
26   /// Creation of point by coordinates
27   GeomAPI_Pnt(const double theX, const double theY, const double theZ);
28   /// Creation of point by coordinates
29   GeomAPI_Pnt(const std::shared_ptr<GeomAPI_XYZ>& theCoords);
30
31   /// returns X coordinate
32   double x() const;
33   /// returns Y coordinate
34   double y() const;
35   /// returns Z coordinate
36   double z() const;
37
38   /// sets X coordinate
39   void setX(const double theX);
40   /// sets Y coordinate
41   void setY(const double theY);
42   /// sets Z coordinate
43   void setZ(const double theZ);
44
45   /// returns coordinates of the point
46   const std::shared_ptr<GeomAPI_XYZ> xyz();
47
48   /// Distance between two points
49   double distance(const std::shared_ptr<GeomAPI_Pnt>& theOther) const;
50
51   /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane
52   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
53                                         const std::shared_ptr<GeomAPI_Dir>& theDirX,
54                                         const std::shared_ptr<GeomAPI_Dir>& theDirY);
55
56   /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane
57   std::shared_ptr<GeomAPI_Pnt2d> to2D(const std::shared_ptr<GeomAPI_Pln>& thePln) const;
58
59   /// Translates the point along direction theDir on distance theDist
60   void translate(const std::shared_ptr<GeomAPI_Dir>& theDir, double theDist);
61 };
62
63 #endif