Salome HOME
de2f98903498a80650b3988df8350232e3e9a57d
[modules/shaper.git] / src / GeomAPI / GeomAPI_XYZ.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_XYZ.hxx
4 // Created:     23 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomAPI_XYZ_H_
8 #define GeomAPI_XYZ_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 /**\class GeomAPI_XYZ
14  * \ingroup DataModel
15  * \brief 3 coordinates: they may represent vector or point or something else
16  */
17
18 class GeomAPI_XYZ : public GeomAPI_Interface
19 {
20  public:
21   /// Creation by coordinates
22   GEOMAPI_EXPORT
23   GeomAPI_XYZ(const double theX, const double theY, const double theZ);
24
25   /// returns X coordinate
26   GEOMAPI_EXPORT
27   double x() const;
28   /// returns Y coordinate
29   GEOMAPI_EXPORT
30   double y() const;
31   /// returns Z coordinate
32   GEOMAPI_EXPORT
33   double z() const;
34
35   /// sets X coordinate
36   GEOMAPI_EXPORT
37   void setX(const double theX);
38   /// sets Y coordinate
39   GEOMAPI_EXPORT
40   void setY(const double theY);
41   /// sets Z coordinate
42   GEOMAPI_EXPORT
43   void setZ(const double theZ);
44
45   /// result is sum of coordinates of this and the given argument
46   GEOMAPI_EXPORT
47   const std::shared_ptr<GeomAPI_XYZ> added(const std::shared_ptr<GeomAPI_XYZ>& theArg);
48   /// result is difference between coordinates of this and the given argument
49   GEOMAPI_EXPORT
50   const std::shared_ptr<GeomAPI_XYZ> decreased(const std::shared_ptr<GeomAPI_XYZ>& theArg);
51   /// result is coordinates multiplied by the argument
52   GEOMAPI_EXPORT
53   const std::shared_ptr<GeomAPI_XYZ> multiplied(const double theArg);
54
55   /// result is a scalar product of two triplets
56   GEOMAPI_EXPORT
57   double dot(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
58   /// result is a cross product of two triplets
59   GEOMAPI_EXPORT
60   const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
61
62   /// Distance between two triplets
63   GEOMAPI_EXPORT
64   double distance(const std::shared_ptr<GeomAPI_XYZ>& theOther) const;
65 };
66
67 #endif
68