Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelGeomAlgo / ModelGeomAlgo_Point2D.cpp
index 6eff0ea8b0f357ebabd87c72866223c09d8fb135..b950621449bd1742f903e7e8e6386b97bce40858 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-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
@@ -349,15 +349,8 @@ bool ModelGeomAlgo_Point2D::isPointOnEdge(const std::shared_ptr<GeomAPI_Shape> t
 {
   bool isInside = false;
   if (theBaseShape->shapeType() == GeomAPI_Shape::EDGE) {
-    std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(theBaseShape));
-    if (anEdge->isLine()) {
-      std::shared_ptr<GeomAPI_Lin> aLine = anEdge->line();
-      theProjectedPoint = aLine->project(thePoint);
-    }
-    else if (anEdge->isCircle() || anEdge->isArc()) {
-      std::shared_ptr<GeomAPI_Circ> aCircle = anEdge->circle();
-      theProjectedPoint = aCircle->project(thePoint);
-    }
+    GeomCurvePtr aCurve(new GeomAPI_Curve(theBaseShape->edge()));
+    theProjectedPoint = aCurve->project(thePoint);
     if (theProjectedPoint.get()) {
       std::shared_ptr<GeomAPI_Vertex> aVertexShape(new GeomAPI_Vertex(theProjectedPoint->x(),
                                                 theProjectedPoint->y(), theProjectedPoint->z()));
@@ -375,7 +368,7 @@ bool ModelGeomAlgo_Point2D::isInnerPointOnEdge(const std::shared_ptr<GeomAPI_Sha
   bool isInside = isPointOnEdge(theBaseShape, thePoint, theProjectedPoint);
   if (isInside) {
     std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(theBaseShape));
-    if (!anEdge->isCircle()) {
+    if (!anEdge->isClosed()) {
       // check the point is not on the boundary
       GeomVertexPtr aVertex(new GeomAPI_Vertex(theProjectedPoint->x(),
           theProjectedPoint->y(), theProjectedPoint->z()));
@@ -393,7 +386,7 @@ std::string doubleToString(double theValue)
 {
   std::string aValueStr;
   char aBuf[50];
-  int n = sprintf(aBuf, "%g", theValue);
+  sprintf(aBuf, "%g", theValue);
   aValueStr = std::string(aBuf);
   return aValueStr;
 }