Salome HOME
Use GEOMAPI_EXPORT not for the class but for class members.
[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   /// result is a scalar product of directions
45   GEOMAPI_EXPORT 
46   double dot(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
47   /// result is a cross product of two directions
48   GEOMAPI_EXPORT 
49   const std::shared_ptr<GeomAPI_XYZ> cross(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
50
51   /// calculates angle between two directions
52   GEOMAPI_EXPORT 
53   double angle(const std::shared_ptr<GeomAPI_Dir>& theArg) const;
54 };
55
56 #endif
57