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 /// Creation of circle defined by three points lying on it
38 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
39 const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint,
40 const std::shared_ptr<GeomAPI_Pnt2d>& theThirdPoint);
42 /// Creation of a circle defined by center and a tangent curve on the given plane
44 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
45 const std::shared_ptr<GeomAPI_Shape>& theTangent,
46 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
48 /// Creation of a circle passing through or tangent to given entities.
49 /// Supported items are GeomAPI_Pnt2d or GeomAPI_Shape
51 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Interface>& theEntity1,
52 const std::shared_ptr<GeomAPI_Interface>& theEntity2,
53 const std::shared_ptr<GeomAPI_Interface>& theEntity3,
54 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
56 /// Return center of the circle
58 const std::shared_ptr<GeomAPI_Pnt2d> center() const;
60 /// Return radius of the circle
62 double radius() const;
64 /// Project point on line
66 const std::shared_ptr<GeomAPI_Pnt2d> project(
67 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
69 /** \brief Computes the parameter of a given point on a circle. The point must be
70 * located either on the circle itself or relatively to the latter
71 * at a distance less than the tolerance value. Return FALSE if the point
72 * is beyond the tolerance limit or if computation fails.
73 * Max Tolerance value is currently limited to 1.e-4
74 * \param[in] thePoint point of origin.
75 * \param[in] theTolerance tolerance of computation.
76 * \param[out] theParameter resulting parameter.
78 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt2d> thePoint,
79 const double theTolerance,
80 double& theParameter) const;
82 /** \brief Returns in thePoint the point of parameter theU.
83 * P = C + R * Cos (U) * XDir + R * Sin (U) * YDir where C is the center of the circle,
84 * XDir the XDirection and YDir the YDirection of the circle's local coordinate system.
85 * \param[in] theU parameter.
86 * \param[out] thePoint resulting point.
88 GEOMAPI_EXPORT void D0(const double theU, std::shared_ptr<GeomAPI_Pnt2d>& thePoint);