]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAPI/GeomAPI_Ellipse2d.h
Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ellipse2d.h
index 293c956494a593d46eba58085b4d005a1a5f7be7..a54b7db671466547dd4ebae7add6e65e69f23764 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2017-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2017-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 // File:        GeomAPI_Ellipse2d.h
 // Created:     26 April 2017
@@ -9,8 +26,10 @@
 
 #include <GeomAPI_Interface.h>
 
-class GeomAPI_Pnt2d;
+class GeomAPI_Circ2d;
 class GeomAPI_Dir2d;
+class GeomAPI_Lin2d;
+class GeomAPI_Pnt2d;
 
 /**\class GeomAPI_Ellipse2d
  * \ingroup DataModel
@@ -46,6 +65,41 @@ public:
 
   /// Returns major radius of the ellipse
   GEOMAPI_EXPORT double majorRadius() const;
+
+  /// Project point on ellipse
+  GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt2d> project(
+      const std::shared_ptr<GeomAPI_Pnt2d>& 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<GeomAPI_Pnt2d> thePoint,
+                                      const double theTolerance,
+                                      double& theParameter) const;
+
+  /// Calculate minimal distance between the ellipse and a line.
+  /// Return corresponding points on the ellipse and on the line.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Lin2d>& theLine,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnLine);
+
+  /// Calculate minimal distance between the ellipse and a circle.
+  /// Return corresponding points on the ellipse and on the circle.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Circ2d>& theCircle,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnCircle);
+
+  /// Calculate minimal distance between two ellipses.
+  /// Return corresponding points on the ellipses.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Ellipse2d>& theEllipse,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnEllipse);
 };
 
 #endif