X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt2d.cpp;h=a2bab72a78896bd3d07c080401b72fdeb8fa89e2;hb=a5746a7f8fd8bcd555fb16f98e312c86ca1210da;hp=70bc646930fab9e98b4bfaf9028ee58030d9dcf3;hpb=cd9217d7e87997ec8bc150a6d8c389e742ca0f84;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pnt2d.cpp b/src/GeomAPI/GeomAPI_Pnt2d.cpp index 70bc64693..a2bab72a7 100644 --- a/src/GeomAPI/GeomAPI_Pnt2d.cpp +++ b/src/GeomAPI/GeomAPI_Pnt2d.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAPI_Pnt2d.cpp // Created: 29 May 2014 // Author: Artem ZHIDKOV @@ -10,14 +12,16 @@ #include -#define MY_PNT2D static_cast(myImpl) +#include + +#define MY_PNT2D implPtr() GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY) : GeomAPI_Interface(new gp_Pnt2d(theX, theY)) { } -GeomAPI_Pnt2d::GeomAPI_Pnt2d(const boost::shared_ptr& theCoords) +GeomAPI_Pnt2d::GeomAPI_Pnt2d(const std::shared_ptr& theCoords) : GeomAPI_Interface(new gp_Pnt2d(theCoords->x(), theCoords->y())) { } @@ -42,22 +46,27 @@ void GeomAPI_Pnt2d::setY(const double theY) return MY_PNT2D->SetY(theY); } -boost::shared_ptr GeomAPI_Pnt2d::to3D(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY) +std::shared_ptr GeomAPI_Pnt2d::to3D(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY) { - boost::shared_ptr aSum = theOrigin->xyz()->added(theDirX->xyz()->multiplied(x())) + std::shared_ptr aSum = theOrigin->xyz()->added(theDirX->xyz()->multiplied(x())) ->added(theDirY->xyz()->multiplied(y())); - return boost::shared_ptr(new GeomAPI_Pnt(aSum)); + return std::shared_ptr(new GeomAPI_Pnt(aSum)); } -const boost::shared_ptr GeomAPI_Pnt2d::xy() +const std::shared_ptr GeomAPI_Pnt2d::xy() { - return boost::shared_ptr(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y())); + return std::shared_ptr(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y())); } -double GeomAPI_Pnt2d::distance(const boost::shared_ptr& theOther) const +double GeomAPI_Pnt2d::distance(const std::shared_ptr& theOther) const { return MY_PNT2D->Distance(theOther->impl()); } + +bool GeomAPI_Pnt2d::isEqual(const std::shared_ptr& theOther) const +{ + return distance(theOther) < Precision::Confusion(); +}