Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_PointBuilder.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_PointBuilder.cpp
4 // Created:     02 Jun 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include <GeomAlgoAPI_PointBuilder.h>
8 #include <GeomAPI_Pnt.h>
9 #include <GeomAPI_Shape.h>
10 #include <BRepBuilderAPI_MakeVertex.hxx>
11 #include <TopoDS_Vertex.hxx>
12
13 std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_PointBuilder::point(
14     std::shared_ptr<GeomAPI_Pnt> thePoint)
15 {
16   const gp_Pnt& aPnt = thePoint->impl<gp_Pnt>();
17   BRepBuilderAPI_MakeVertex aMaker(aPnt);
18   TopoDS_Vertex aVertex = aMaker.Vertex();
19   std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
20   aRes->setImpl(new TopoDS_Shape(aVertex));
21   return aRes;
22 }