1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Circ.h
4 // Created: 24 Jun 2014
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAPI_Circ_H_
8 #define GeomAPI_Circ_H_
10 #include <GeomAPI_Interface.h>
17 /**\class GeomAPI_Circ
22 class GeomAPI_Circ : public GeomAPI_Interface
26 /** \brief Constructs a circle of radius Radius, where theAx2 locates
27 * the circle and defines its orientation in 3D space such that:\n
28 * - the center of the circle is the origin of theAx2;\n
29 * - the origin, "X Direction" and "Y Direction" of theAx2 define the plane of the circle;\n
30 * - theAx2 is the local coordinate system of the circle.\n
31 * Note: It is possible to create a circle where Radius is equal to 0.0. raised if Radius < 0.
33 GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Ax2> theAx2,
34 const double theRadius);
36 /// Creation of circle defined by center point, direction and circle radius
37 GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Pnt>& theCenter,
38 const std::shared_ptr<GeomAPI_Dir>& theDir, double theRadius);
40 /// Return center of the circle
41 GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> center() const;
43 /// Return radius of the circle
44 GEOMAPI_EXPORT double radius() const;
46 /// Return orthogonal direction to the circle's plane
47 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> normal() const;
49 /// Project point on circle
50 GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
51 const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
53 /** \brief Computes the parameter of a given point on a circle. The point must be
54 * located either on the circle itself or relatively to the latter
55 * at a distance less than the tolerance value. Return FALSE if the point
56 * is beyond the tolerance limit or if computation fails.
57 * Max Tolerance value is currently limited to 1.e-4
58 * \param[in] thePoint point of origin.
59 * \param[in] theTolerance tolerance of computation.
60 * \param[out] theParameter resulting parameter.
62 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
63 const double theTolerance,
64 double& theParameter) const;
67 //! Pointer on the object
68 typedef std::shared_ptr<GeomAPI_Circ> GeomCirclePtr;