-// 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<GeomAPI_Pnt.h>
+#include <GeomAPI_Ax1.h>
#include<GeomAPI_XYZ.h>
#include<GeomAPI_Pnt2d.h>
#include<GeomAPI_Dir.h>
return distance(theOther) < Precision::Confusion();
}
+bool GeomAPI_Pnt::isLess(const std::shared_ptr<GeomAPI_Pnt>& 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_Pnt2d> GeomAPI_Pnt::to2D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
const std::shared_ptr<GeomAPI_Dir>& theDirX, const std::shared_ptr<GeomAPI_Dir>& theDirY)
{
gp_Pnt2d aRes = ProjLib::Project(aPln, *MY_PNT);
return std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(aRes.X(), aRes.Y()));
}
+
+void GeomAPI_Pnt::rotate(const std::shared_ptr<GeomAPI_Ax1>& theAxis, const double theAngle)
+{
+ MY_PNT->Rotate(theAxis->impl<gp_Ax1>(), theAngle / 180.0 * M_PI);
+}