Salome HOME
Calculation of angle between two directions
[modules/shaper.git] / src / GeomAPI / GeomAPI_Dir.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Dir.hxx
4 // Created:     23 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomAPI_Dir_H_
8 #define GeomAPI_Dir_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_XYZ;
14
15 /**\class GeomAPI_Dir
16  * \ingroup DataModel
17  * \brief 3D direction defined by three normalized coordinates
18  */
19
20 class GEOMAPI_EXPORT GeomAPI_Dir : public GeomAPI_Interface
21 {
22  public:
23   /// Creation of direction by coordinates
24   GeomAPI_Dir(const double theX, const double theY, const double theZ);
25   /// Creation of direction by coordinates
26   GeomAPI_Dir(const std::shared_ptr<GeomAPI_XYZ>& theCoords);
27
28   /// returns X coordinate
29   double x() const;
30   /// returns Y coordinate
31   double y() const;
32   /// returns Z coordinate
33   double z() const;
34
35   /// returns coordinates of the direction
36   const std::shared_ptr<GeomAPI_XYZ> xyz();
37
38   /// result is a scalar product of directions
39   double dot(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
40   /// result is a cross product of two directions
41   const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
42
43   /// calculates angle between two directions
44   double angle(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
45 };
46
47 #endif
48