Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / GeomAPI / GeomAPI_XY.h
1 // File:        GeomAPI_XY.hxx
2 // Created:     30 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GeomAPI_XY_H_
6 #define GeomAPI_XY_H_
7
8 #include <GeomAPI_Interface.h>
9 #include <memory>
10
11 /**\class GeomAPI_XY
12  * \ingroup DataModel
13  * \brief 2 coordinates: they may represent vector or point or something else
14  */
15
16 class GEOMAPI_EXPORT GeomAPI_XY : public GeomAPI_Interface
17 {
18  public:
19   /// Creation by coordinates
20   GeomAPI_XY(const double theX, const double theY);
21
22   /// returns X coordinate
23   double x() const;
24   /// returns Y coordinate
25   double y() const;
26
27   /// sets X coordinate
28   void setX(const double theX);
29   /// sets Y coordinate
30   void setY(const double theY);
31
32   /// result is sum of coordinates of this and the given argument
33   const std::shared_ptr<GeomAPI_XY> added(const std::shared_ptr<GeomAPI_XY>& theArg);
34   /// result is coordinates multiplied by the argument
35   const std::shared_ptr<GeomAPI_XY> multiplied(const double theArg);
36
37   /// result is a scalar product of two triplets
38   double dot(const std::shared_ptr<GeomAPI_XY>& theArg) const;
39   /// result is a cross product of two triplets
40   double cross(const std::shared_ptr<GeomAPI_XY>& theArg) const;
41
42   /// Distance between two pairs
43   double distance(const std::shared_ptr<GeomAPI_XY>& theOther) const;
44 };
45
46 #endif
47