-// 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
//
// 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<mailto:webmaster.salome@opencascade.com>
+// 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);
+}