X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_PointBuilder.cpp;h=096dc4a96bc01d45798762380b297aa7325a315d;hb=c65c7a084cf32f54c8d8a93fceace414c3b0fb21;hp=d12bd6a86c61debae635c578b6efe1eef374f7fd;hpb=587c5c1821f464e323eec057ba860b2433d4f412;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index d12bd6a86..096dc4a96 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -1,22 +1,39 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAlgoAPI_PointBuilder.cpp // Created: 02 Jun 2014 // Author: Mikhail PONIKAROV - - #include #include #include +#include #include +#include #include +#include +#include -boost::shared_ptr GeomAlgoAPI_PointBuilder::point( - boost::shared_ptr thePoint) +std::shared_ptr GeomAlgoAPI_PointBuilder::point( + std::shared_ptr thePoint) { const gp_Pnt& aPnt = thePoint->impl(); BRepBuilderAPI_MakeVertex aMaker(aPnt); TopoDS_Vertex aVertex = aMaker.Vertex(); - boost::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Vertex); aRes->setImpl(new TopoDS_Shape(aVertex)); return aRes; } + + +std::shared_ptr GeomAlgoAPI_PointBuilder::point(std::shared_ptr theVertex) +{ + TopoDS_Shape aShape = theVertex->impl(); + if ((!aShape.IsNull()) && (aShape.ShapeType() == TopAbs_VERTEX)) { + TopoDS_Vertex aVertex = TopoDS::Vertex(aShape); + gp_Pnt aPoint = BRep_Tool::Pnt(aVertex); + std::shared_ptr aPnt(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); + return aPnt; + } + return std::shared_ptr(); +}