Salome HOME
Issue #1860: fix end lines with spaces
[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_Dir : public GeomAPI_Interface
21 {
22  public:
23   /// Creation of direction by coordinates
24   GEOMAPI_EXPORT
25   GeomAPI_Dir(const double theX, const double theY, const double theZ);
26   /// Creation of direction by coordinates
27   GEOMAPI_EXPORT
28   GeomAPI_Dir(const std::shared_ptr<GeomAPI_XYZ>& theCoords);
29
30   /// returns X coordinate
31   GEOMAPI_EXPORT
32   double x() const;
33   /// returns Y coordinate
34   GEOMAPI_EXPORT
35   double y() const;
36   /// returns Z coordinate
37   GEOMAPI_EXPORT
38   double z() const;
39
40   /// returns coordinates of the direction
41   GEOMAPI_EXPORT
42   const std::shared_ptr<GeomAPI_XYZ> xyz();
43
44   /// inverses the direction
45   GEOMAPI_EXPORT void reverse();
46
47   /// result is a scalar product of directions
48   GEOMAPI_EXPORT
49   double dot(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
50   /// result is a cross product of two directions
51   GEOMAPI_EXPORT
52   const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
53
54   /// calculates angle between two directions
55   GEOMAPI_EXPORT
56   double angle(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
57
58   /// \return true if the angle between this unit vector and
59   /// theDir unit vector is equal to 0 or to Pi.
60   GEOMAPI_EXPORT
61   bool isParallel(const std::shared_ptr<GeomAPI_Dir> theDir,
62                   const double theTolerance = 1.e-7) const;
63
64
65 };
66
67 #endif
68