Salome HOME
Issue #2068: change of arc is by jump even due to smooth mouse movement
[modules/shaper.git] / src / GeomAPI / GeomAPI_Circ2d.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Circ2d.h
4 // Created:     29 May 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Circ2d_H_
8 #define GeomAPI_Circ2d_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_Ax3;
14 class GeomAPI_Pnt2d;
15 class GeomAPI_Dir2d;
16 class GeomAPI_Shape;
17
18 /**\class GeomAPI_Circ2d
19  * \ingroup DataModel
20  * \brief Circle in 2D
21  */
22
23 class GeomAPI_Circ2d : public GeomAPI_Interface
24 {
25  public:
26   /// Creation of circle defined by center point and circle radius
27   GEOMAPI_EXPORT
28   GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
29                  const std::shared_ptr<GeomAPI_Pnt2d>& theCirclePoint);
30
31   /// Creation of circle defined by center point, direction and circle radius
32   GEOMAPI_EXPORT
33   GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
34                  const std::shared_ptr<GeomAPI_Dir2d>& theDir, double theRadius);
35
36   /// Return center of the circle
37   GEOMAPI_EXPORT
38   const std::shared_ptr<GeomAPI_Pnt2d> center() const;
39
40   /// Return radius of the circle
41   GEOMAPI_EXPORT
42   double radius() const;
43
44   /// Project point on line
45   GEOMAPI_EXPORT
46   const std::shared_ptr<GeomAPI_Pnt2d> project(
47       const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
48
49   /** \brief Computes the parameter of a given point on a circle. The point must be
50    *         located either on the circle itself or relatively to the latter
51    *         at a distance less than the tolerance value. Return FALSE if the point
52    *         is beyond the tolerance limit or if computation fails.
53    *         Max Tolerance value is currently limited to 1.e-4
54    *  \param[in] thePoint point of origin.
55    *  \param[in] theTolerance tolerance of computation.
56    *  \param[out] theParameter resulting parameter.
57    */
58   GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt2d> thePoint,
59                                       const double theTolerance,
60                                       double& theParameter) const;
61
62   /** \brief Returns in thePoint the point of parameter theU.
63    *  P = C + R * Cos (U) * XDir + R * Sin (U) * YDir where C is the center of the circle,
64    *  XDir the XDirection and YDir the YDirection of the circle's local coordinate system.
65    *  \param[in] theU parameter.
66    *  \param[out] thePoint resulting point.
67    */
68   GEOMAPI_EXPORT void D0(const double theU, std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
69 };
70
71 #endif
72