Salome HOME
Task 2.12. New entities: ellipses and arcs of ellipses (issue #3003)
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ellipse.cpp
index 243be630e507b5ae4ff99c22285dd24a06983e79..86a0391cb87990d1406ba34be886cb46b8666644 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <Geom_Ellipse.hxx>
 #include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <GeomLib_Tool.hxx>
 #include <gp_Elips.hxx>
 
 #define MY_ELIPS implPtr<gp_Elips>()
@@ -101,3 +102,12 @@ const std::shared_ptr<GeomAPI_Pnt> GeomAPI_Ellipse::project(
   }
   return aResult;
 }
+
+const bool GeomAPI_Ellipse::parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
+                                      const double theTolerance,
+                                      double& theParameter) const
+{
+  Handle(Geom_Ellipse) aCurve = new Geom_Ellipse(*MY_ELIPS);
+  return GeomLib_Tool::Parameter(aCurve, thePoint->impl<gp_Pnt>(),
+                                 theTolerance, theParameter) == Standard_True;
+}