X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Vertex.cpp;h=d881d79b5bf0ea0cbbb7106bc0d3507f9aa05384;hb=60e95a5502a6940c6c27ce5d561b3c684b0b0a4f;hp=6c3d05e3556f1caff93dccd40fb1d07eb92f080e;hpb=2f89053146098946372bae4d1a3fe2e5272ab9e2;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Vertex.cpp b/src/GeomAPI/GeomAPI_Vertex.cpp index 6c3d05e35..d881d79b5 100644 --- a/src/GeomAPI/GeomAPI_Vertex.cpp +++ b/src/GeomAPI/GeomAPI_Vertex.cpp @@ -35,16 +35,19 @@ 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 { 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); TopoDS_Vertex aVertex2 = TopoDS::Vertex(aInShape); gp_Pnt aPoint2 = BRep_Tool::Pnt(aVertex2); - return aPoint1.IsEqual(aPoint2, Precision::Confusion()); + return aPoint1.IsEqual(aPoint2, Precision::Confusion()) == Standard_True; }