Salome HOME
Task 3.3 Build/Edge and Build/Wire on a whole Sketch (issue #3083)
[modules/shaper.git] / src / GeomAPI / GeomAPI_Edge.cpp
index 830fbb1b1ceac2fa867ea85ac0b3011820cc7814..c4504272b3ccbea972eb5606d69f5288aab6da0a 100644 (file)
@@ -25,6 +25,7 @@
 #include<GeomAPI_Lin.h>
 #include<GeomAPI_Ax2.h>
 #include<GeomAPI_Ellipse.h>
+#include<GeomAPI_Vertex.h>
 
 #include <BRepAdaptor_Curve.hxx>
 
@@ -69,6 +70,18 @@ GeomAPI_Edge::GeomAPI_Edge(const std::shared_ptr<GeomAPI_Shape>& theShape)
   }
 }
 
+void GeomAPI_Edge::vertices(std::shared_ptr<GeomAPI_Vertex>& theStartVertex,
+                            std::shared_ptr<GeomAPI_Vertex>& theEndVertex) const
+{
+  const TopoDS_Edge& anEdge = impl<TopoDS_Edge>();
+  TopoDS_Vertex aStart, aEnd;
+  TopExp::Vertices(anEdge, aStart, aEnd);
+  theStartVertex.reset(new GeomAPI_Vertex);
+  theStartVertex->setImpl(new TopoDS_Vertex(aStart));
+  theEndVertex.reset(new GeomAPI_Vertex);
+  theEndVertex->setImpl(new TopoDS_Vertex(aEnd));
+}
+
 static Handle(Geom_Curve) baseCurve(const TopoDS_Edge& theEdge)
 {
   double aFirst, aLast;