Salome HOME
Use GEOMAPI_EXPORT not for the class but for class members.
[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_XY : public GeomAPI_Interface
19 {
20  public:
21   /// Creation by coordinates
22   GEOMAPI_EXPORT 
23   GeomAPI_XY(const double theX, const double theY);
24
25   /// returns X coordinate
26   GEOMAPI_EXPORT 
27   double x() const;
28   /// returns Y coordinate
29   GEOMAPI_EXPORT 
30   double y() const;
31
32   /// sets X coordinate
33   GEOMAPI_EXPORT 
34   void setX(const double theX);
35   /// sets Y coordinate
36   GEOMAPI_EXPORT 
37   void setY(const double theY);
38
39   /// result is sum of coordinates of this and the given argument
40   GEOMAPI_EXPORT 
41   const std::shared_ptr<GeomAPI_XY> added(const std::shared_ptr<GeomAPI_XY>& theArg);
42   /// result is difference between coordinates of this and the given argument
43   GEOMAPI_EXPORT 
44   const std::shared_ptr<GeomAPI_XY> decreased(const std::shared_ptr<GeomAPI_XY>& theArg);
45   /// result is coordinates multiplied by the argument
46   GEOMAPI_EXPORT 
47   const std::shared_ptr<GeomAPI_XY> multiplied(const double theArg);
48
49   /// result is a scalar product of two triplets
50   GEOMAPI_EXPORT 
51   double dot(const std::shared_ptr<GeomAPI_XY>& theArg) const;
52   /// result is a cross product of two triplets
53   GEOMAPI_EXPORT 
54   double cross(const std::shared_ptr<GeomAPI_XY>& theArg) const;
55
56   /// Distance between two pairs
57   GEOMAPI_EXPORT 
58   double distance(const std::shared_ptr<GeomAPI_XY>& theOther) const;
59 };
60
61 #endif
62