Salome HOME
Edit arc by dragging
[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_EXPORT GeomAPI_XYZ : public GeomAPI_Interface
19 {
20  public:
21   /// Creation by coordinates
22   GeomAPI_XYZ(const double theX, const double theY, const double theZ);
23
24   /// returns X coordinate
25   double x() const;
26   /// returns Y coordinate
27   double y() const;
28   /// returns Z coordinate
29   double z() const;
30
31   /// sets X coordinate
32   void setX(const double theX);
33   /// sets Y coordinate
34   void setY(const double theY);
35   /// sets Z coordinate
36   void setZ(const double theZ);
37
38   /// result is sum of coordinates of this and the given argument
39   const std::shared_ptr<GeomAPI_XYZ> added(const std::shared_ptr<GeomAPI_XYZ>& theArg);
40   /// result is difference between coordinates of this and the given argument
41   const std::shared_ptr<GeomAPI_XYZ> decreased(const std::shared_ptr<GeomAPI_XYZ>& theArg);
42   /// result is coordinates multiplied by the argument
43   const std::shared_ptr<GeomAPI_XYZ> multiplied(const double theArg);
44
45   /// result is a scalar product of two triplets
46   double dot(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
47   /// result is a cross product of two triplets
48   const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_XYZ>& theArg) const;
49
50   /// Distance between two triplets
51   double distance(const std::shared_ptr<GeomAPI_XYZ>& theOther) const;
52 };
53
54 #endif
55