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 /// Creation of a circle with given radius passing through or tangent to two entities.
57 /// Supported items are GeomAPI_Pnt2d or GeomAPI_Shape
59 GeomAPI_Circ2d(const std::shared_ptr<GeomAPI_Interface>& theEntity1,
60 const std::shared_ptr<GeomAPI_Interface>& theEntity2,
61 const double theRadius,
62 const std::shared_ptr<GeomAPI_Ax3>& thePlane);
64 /// Return center of the circle
66 const std::shared_ptr<GeomAPI_Pnt2d> center() const;
68 /// Return radius of the circle
70 double radius() const;
72 /// Project point on line
74 const std::shared_ptr<GeomAPI_Pnt2d> project(
75 const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) const;
77 /** \brief Computes the parameter of a given point on a circle. The point must be
78 * located either on the circle itself or relatively to the latter
79 * at a distance less than the tolerance value. Return FALSE if the point
80 * is beyond the tolerance limit or if computation fails.
81 * Max Tolerance value is currently limited to 1.e-4
82 * \param[in] thePoint point of origin.
83 * \param[in] theTolerance tolerance of computation.
84 * \param[out] theParameter resulting parameter.
86 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt2d> thePoint,
87 const double theTolerance,
88 double& theParameter) const;
90 /** \brief Returns in thePoint the point of parameter theU.
91 * P = C + R * Cos (U) * XDir + R * Sin (U) * YDir where C is the center of the circle,
92 * XDir the XDirection and YDir the YDirection of the circle's local coordinate system.
93 * \param[in] theU parameter.
94 * \param[out] thePoint resulting point.
96 GEOMAPI_EXPORT void D0(const double theU, std::shared_ptr<GeomAPI_Pnt2d>& thePoint);