1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Circ2d.h
4 // Created: 29 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAPI_Circ2d_H_
8 #define GeomAPI_Circ2d_H_
10 #include <GeomAPI_Interface.h>
18 /**\class GeomAPI_Circ2d
23 class GeomAPI_Circ2d : public GeomAPI_Interface
26 /// Creation of circle defined by center point and circle radius
28 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
29 const std::shared_ptr<GeomAPI_Pnt2d>& theCirclePoint);
31 /// Creation of circle defined by center point, direction and circle radius
33 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
34 const std::shared_ptr<GeomAPI_Dir2d>& theDir, double theRadius);
36 /// Return center of the circle
38 const std::shared_ptr<GeomAPI_Pnt2d> center() const;
40 /// Return radius of the circle
42 double radius() const;
44 /// Project point on line
46 const std::shared_ptr<GeomAPI_Pnt2d> project(
47 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
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.
58 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt2d> thePoint,
59 const double theTolerance,
60 double& theParameter) const;
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.
68 GEOMAPI_EXPORT void D0(const double theU, std::shared_ptr<GeomAPI_Pnt2d>& thePoint);