Salome HOME
Merge branch 'Dev_0.6.1' of ssh://newgeom.redmine.opencascade.com:322/newgeom into...
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.cpp
index 5e455f9f3dd3f3bd426fa0f85999859c4bac463f..759b0b323cb2c90205d2fef862abfe9c3fbc9c97 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        GeomAPI_Edge.cpp
 // Created:     24 Jul 2014
 // Author:      Artem ZHIDKOV
@@ -98,11 +100,14 @@ std::shared_ptr<GeomAPI_Circ> GeomAPI_Edge::circle()
 }
 
 
-bool GeomAPI_Edge::isEqual(std::shared_ptr<GeomAPI_Shape> theEdge)
+bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
 {
   const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   const TopoDS_Shape& aInShape = theEdge->impl<TopoDS_Shape>();
-  
+
+  if (aMyShape.ShapeType() != aInShape.ShapeType())
+    return false;
+
   double aMyStart, aMyEnd;
   Handle(Geom_Curve) aMyCurve = BRep_Tool::Curve(TopoDS::Edge(aMyShape), aMyStart, aMyEnd);
   double aInStart, aInEnd;
@@ -129,4 +134,4 @@ bool GeomAPI_Edge::isEqual(std::shared_ptr<GeomAPI_Shape> theEdge)
     return false;
 
   return true;
-}
\ No newline at end of file
+}