X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Ellipse.h;h=9f1be781af3dea9784c609ebe2acef484e164b5e;hb=ea593bc59e7e9461f6c4e2afd3f24d621edb1011;hp=ac63dd97ec3bfb80d8f60cef0af4512d0a53898a;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Ellipse.h b/src/GeomAPI/GeomAPI_Ellipse.h index ac63dd97e..9f1be781a 100644 --- a/src/GeomAPI/GeomAPI_Ellipse.h +++ b/src/GeomAPI/GeomAPI_Ellipse.h @@ -28,6 +28,7 @@ #include class GeomAPI_Ax2; +class GeomAPI_Curve; class GeomAPI_Dir; class GeomAPI_Pnt; @@ -53,6 +54,8 @@ public: GEOMAPI_EXPORT GeomAPI_Ellipse(const std::shared_ptr& theAx2, double theMajorRadius, double theMinorRadius); + GEOMAPI_EXPORT GeomAPI_Ellipse(std::shared_ptr theCurve); + /// Returns center of the ellipse GEOMAPI_EXPORT std::shared_ptr center() const; @@ -71,6 +74,22 @@ public: /// Returns major radius of the ellipse GEOMAPI_EXPORT double majorRadius() const; + /// Project point on ellipse + GEOMAPI_EXPORT const std::shared_ptr project( + const std::shared_ptr& thePoint) const; + + /** \brief Computes the parameter of a given point on an ellipse. The point must be + * located either on the circle itself or relatively to the latter + * at a distance less than the tolerance value. Return FALSE if the point + * is beyond the tolerance limit or if computation fails. + * Max Tolerance value is currently limited to 1.e-4 + * \param[in] thePoint point of origin. + * \param[in] theTolerance tolerance of computation. + * \param[out] theParameter resulting parameter. + */ + GEOMAPI_EXPORT const bool parameter(const std::shared_ptr thePoint, + const double theTolerance, + double& theParameter) const; }; //! Pointer on the object