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