X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Vertex.cpp;h=b917837a09cfcaa4e9589598625f7a4d4f63765e;hb=61cd0845b41710ad4e7eae07cc6106904be67b9f;hp=4c51908717d167c62bea1a59c1b12246ded02696;hpb=a07cdcdf600fc224bc862686439dfbe01d72524a;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Vertex.cpp b/src/GeomAPI/GeomAPI_Vertex.cpp index 4c5190871..b917837a0 100644 --- a/src/GeomAPI/GeomAPI_Vertex.cpp +++ b/src/GeomAPI/GeomAPI_Vertex.cpp @@ -35,11 +35,16 @@ std::shared_ptr GeomAPI_Vertex::point() return std::shared_ptr(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); } -bool GeomAPI_Vertex::isEqual(std::shared_ptr theVert) +bool GeomAPI_Vertex::isEqual(const std::shared_ptr theVert) const { + if (!theVert.get() || ! theVert->isVertex()) + return false; const TopoDS_Shape& aMyShape = const_cast(this)->impl(); const TopoDS_Shape& aInShape = theVert->impl(); + if (aMyShape.ShapeType() != aInShape.ShapeType()) + return false; + TopoDS_Vertex aVertex1 = TopoDS::Vertex(aMyShape); gp_Pnt aPoint1 = BRep_Tool::Pnt(aVertex1);