Salome HOME
Creating an arc by 3 points and a tangent arc
[modules/shaper.git] / src / GeomAPI / GeomAPI_Dir2d.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Dir2d.hxx
4 // Created:     23 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomAPI_Dir2d_H_
8 #define GeomAPI_Dir2d_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_XY;
14
15 /**\class GeomAPI_Dir2d
16  * \ingroup DataModel
17  * \brief 2D direction defined by three normalized coordinates
18  */
19
20 class GeomAPI_Dir2d : public GeomAPI_Interface
21 {
22  public:
23   /// Creation of direction by coordinates
24   GEOMAPI_EXPORT 
25   GeomAPI_Dir2d(const double theX, const double theY);
26   /// Creation of direction by coordinates
27   GEOMAPI_EXPORT 
28   GeomAPI_Dir2d(const std::shared_ptr<GeomAPI_XY>& 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
37   /// returns coordinates of the direction
38   GEOMAPI_EXPORT 
39   const std::shared_ptr<GeomAPI_XY> xy();
40
41   /// inverses the direction
42   GEOMAPI_EXPORT void reverse();
43
44   /// result is a scalar product of directions
45   GEOMAPI_EXPORT 
46   double dot(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const;
47   /// result is a cross product of two directions
48   GEOMAPI_EXPORT 
49   double cross(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const;
50
51   /// calculates angle between two directions
52   GEOMAPI_EXPORT 
53   double angle(const std::shared_ptr<GeomAPI_Dir2d>& theArg) const;
54 };
55
56 #endif
57