X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_PointBuilder.cpp;h=096dc4a96bc01d45798762380b297aa7325a315d;hb=7fcf163a8a369889707c5b73eeeb2bc68a4b906e;hp=053504d79e227c08c400bf02a50039129593947e;hpb=8dc74f82810d5f597b78633b457efb0ef4f89f9f;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index 053504d79..096dc4a96 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAlgoAPI_PointBuilder.cpp // Created: 02 Jun 2014 // Author: Mikhail PONIKAROV @@ -5,16 +7,33 @@ #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(); +}