Salome HOME
Coincidence to rectangle macro feature: 1. Get point of sub-feature to set coincidenc...
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.cpp
index f9572daa79949e4da668fc374466dc078f598de2..2edd787d94d9333de94d9ede8eaa99081c756b36 100644 (file)
@@ -131,6 +131,8 @@ std::shared_ptr<GeomAPI_Lin> GeomAPI_Edge::line()
 
 bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
 {
+  if (!theEdge.get() || ! theEdge->isEdge())
+    return false;
   const TopoDS_Shape& aMyShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
   const TopoDS_Shape& aInShape = theEdge->impl<TopoDS_Shape>();
 
@@ -164,3 +166,9 @@ bool GeomAPI_Edge::isEqual(const std::shared_ptr<GeomAPI_Shape> theEdge) const
 
   return true;
 }
+
+void GeomAPI_Edge::getRange(double& theFirst, double& theLast) const
+{
+  const TopoDS_Shape& aShape = const_cast<GeomAPI_Edge*>(this)->impl<TopoDS_Shape>();
+  Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, theFirst, theLast);
+}