X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt.cpp;h=d2b943df36e7b3089af3a36846a03fccb27fe4b1;hb=04a80e2c553cff698cb44206ce2da2cc362de53a;hp=976d3949f3733bf96dddfe5502494f05f39f8b44;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index 976d3949f..d2b943df3 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,13 +12,13 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include +#include #include #include #include @@ -85,6 +85,21 @@ bool GeomAPI_Pnt::isEqual(const std::shared_ptr& theOther) const return distance(theOther) < Precision::Confusion(); } +bool GeomAPI_Pnt::isLess(const std::shared_ptr& theOther, + const double theTolerance) const +{ + if (MY_PNT->X() + theTolerance < theOther->x()) + return true; + else if (MY_PNT->X() < theOther->x() + theTolerance) { + if (MY_PNT->Y() + theTolerance < theOther->y()) + return true; + else if (MY_PNT->Y() < theOther->y() + theTolerance && + MY_PNT->Z() + theTolerance < theOther->z()) + return true; + } + return false; +} + std::shared_ptr GeomAPI_Pnt::to2D(const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, const std::shared_ptr& theDirY) { @@ -114,3 +129,8 @@ std::shared_ptr GeomAPI_Pnt::to2D(const std::shared_ptr(new GeomAPI_Pnt2d(aRes.X(), aRes.Y())); } + +void GeomAPI_Pnt::rotate(const std::shared_ptr& theAxis, const double theAngle) +{ + MY_PNT->Rotate(theAxis->impl(), theAngle / 180.0 * M_PI); +}