X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelGeomAlgo%2FModelGeomAlgo_Point2D.cpp;h=19328db10fcc361a6e0526a72ac33d2d95188925;hb=d04ea67117f609da08de8ae7631e8f2f844ea437;hp=430409fe75ba12980bff4c62c080152abf10234a;hpb=263446e2c5fa3e7c28a163dd143bc489f9b75395;p=modules%2Fshaper.git diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp old mode 100755 new mode 100644 index 430409fe7..19328db10 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "ModelGeomAlgo_Point2D.h" @@ -350,15 +349,8 @@ bool ModelGeomAlgo_Point2D::isPointOnEdge(const std::shared_ptr t { bool isInside = false; if (theBaseShape->shapeType() == GeomAPI_Shape::EDGE) { - std::shared_ptr anEdge(new GeomAPI_Edge(theBaseShape)); - if (anEdge->isLine()) { - std::shared_ptr aLine = anEdge->line(); - theProjectedPoint = aLine->project(thePoint); - } - else if (anEdge->isCircle() || anEdge->isArc()) { - std::shared_ptr aCircle = anEdge->circle(); - theProjectedPoint = aCircle->project(thePoint); - } + GeomCurvePtr aCurve(new GeomAPI_Curve(theBaseShape->edge())); + theProjectedPoint = aCurve->project(thePoint); if (theProjectedPoint.get()) { std::shared_ptr aVertexShape(new GeomAPI_Vertex(theProjectedPoint->x(), theProjectedPoint->y(), theProjectedPoint->z())); @@ -376,7 +368,7 @@ bool ModelGeomAlgo_Point2D::isInnerPointOnEdge(const std::shared_ptr 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())); @@ -394,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; }