X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pnt.cpp;h=d2b943df36e7b3089af3a36846a03fccb27fe4b1;hb=04a80e2c553cff698cb44206ce2da2cc362de53a;hp=9138365cc1ec6c0fc5bc1ebe7986794d282a3c3b;hpb=1b93f1881c5fec599aa79707f93c84dd9c287bc0;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index 9138365cc..d2b943df3 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -1,10 +1,24 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAPI_Pnt.cpp -// Created: 23 Apr 2014 -// Author: Mikhail PONIKAROV +// 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include +#include #include #include #include @@ -71,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) { @@ -100,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); +}