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>
16 /**\class GeomAPI_Circ2d
21 class GeomAPI_Circ2d : public GeomAPI_Interface
24 /// Creation of circle defined by center point and circle radius
26 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
27 const std::shared_ptr<GeomAPI_Pnt2d>& theCirclePoint);
29 /// Creation of circle defined by center point, direction and circle radius
31 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
32 const std::shared_ptr<GeomAPI_Dir2d>& theDir, double theRadius);
34 /// Return center of the circle
36 const std::shared_ptr<GeomAPI_Pnt2d> center() const;
38 /// Return radius of the circle
40 double radius() const;
42 /// Project point on line
44 const std::shared_ptr<GeomAPI_Pnt2d> project(
45 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
47 /** \brief Computes the parameter of a given point on a circle. The point must be
48 * located either on the circle itself or relatively to the latter
49 * at a distance less than the tolerance value. Return FALSE if the point
50 * is beyond the tolerance limit or if computation fails.
51 * Max Tolerance value is currently limited to 1.e-4
52 * \param[in] thePoint point of origin.
53 * \param[in] theTolerance tolerance of computation.
54 * \param[out] theParameter resulting parameter.
56 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt2d> thePoint,
57 const double theTolerance,
58 double& theParameter) const;
60 /** \brief Returns in thePoint the point of parameter theU.
61 * P = C + R * Cos (U) * XDir + R * Sin (U) * YDir where C is the center of the circle,
62 * XDir the XDirection and YDir the YDirection of the circle's local coordinate system.
63 * \param[in] theU parameter.
64 * \param[out] thePoint resulting point.
66 GEOMAPI_EXPORT void D0(const double theU, std::shared_ptr<GeomAPI_Pnt2d>& thePoint);