Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Coincidence to rectangle macro feature: 1. Get point of sub-feature to set coincidenc...
[modules/shaper.git]
/
src
/
GeomAPI
/
GeomAPI_Pnt2d.cpp
diff --git
a/src/GeomAPI/GeomAPI_Pnt2d.cpp
b/src/GeomAPI/GeomAPI_Pnt2d.cpp
index 1b4ee554bfb82bde1c9bdc1338b246635bbe2489..a2bab72a78896bd3d07c080401b72fdeb8fa89e2 100644
(file)
--- a/
src/GeomAPI/GeomAPI_Pnt2d.cpp
+++ b/
src/GeomAPI/GeomAPI_Pnt2d.cpp
@@
-1,21
+1,30
@@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: GeomAPI_Pnt2d.cpp
// Created: 29 May 2014
// Author: Artem ZHIDKOV
#include<GeomAPI_Pnt2d.h>
#include<GeomAPI_XY.h>
// File: GeomAPI_Pnt2d.cpp
// Created: 29 May 2014
// Author: Artem ZHIDKOV
#include<GeomAPI_Pnt2d.h>
#include<GeomAPI_XY.h>
+#include<GeomAPI_XYZ.h>
+#include<GeomAPI_Pnt.h>
+#include<GeomAPI_Dir.h>
#include<gp_Pnt2d.hxx>
#include<gp_Pnt2d.hxx>
-#define MY_PNT2D static_cast<gp_Pnt2d*>(myImpl)
+#include <Precision.hxx>
+
+#define MY_PNT2D implPtr<gp_Pnt2d>()
GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY)
GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY)
- : GeomAPI_Interface(new gp_Pnt2d(theX, theY))
-{}
+ : GeomAPI_Interface(new gp_Pnt2d(theX, theY))
+{
+}
-GeomAPI_Pnt2d::GeomAPI_Pnt2d(const boost::shared_ptr<GeomAPI_XY>& theCoords)
- : GeomAPI_Interface(new gp_Pnt2d(theCoords->x(), theCoords->y()))
-{}
+GeomAPI_Pnt2d::GeomAPI_Pnt2d(const std::shared_ptr<GeomAPI_XY>& theCoords)
+ : GeomAPI_Interface(new gp_Pnt2d(theCoords->x(), theCoords->y()))
+{
+}
double GeomAPI_Pnt2d::x() const
{
double GeomAPI_Pnt2d::x() const
{
@@
-37,12
+46,27
@@
void GeomAPI_Pnt2d::setY(const double theY)
return MY_PNT2D->SetY(theY);
}
return MY_PNT2D->SetY(theY);
}
-const boost::shared_ptr<GeomAPI_XY> GeomAPI_Pnt2d::xy()
+std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pnt2d::to3D(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
+ const std::shared_ptr<GeomAPI_Dir>& theDirX,
+ const std::shared_ptr<GeomAPI_Dir>& theDirY)
{
{
- return boost::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y()));
+ std::shared_ptr<GeomAPI_XYZ> aSum = theOrigin->xyz()->added(theDirX->xyz()->multiplied(x()))
+ ->added(theDirY->xyz()->multiplied(y()));
+
+ return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aSum));
}
}
-double GeomAPI_Pnt2d::distance(const boost::shared_ptr<GeomAPI_Pnt2d>& theOther) const
+const std::shared_ptr<GeomAPI_XY> GeomAPI_Pnt2d::xy()
+{
+ return std::shared_ptr<GeomAPI_XY>(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y()));
+}
+
+double GeomAPI_Pnt2d::distance(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const
{
return MY_PNT2D->Distance(theOther->impl<gp_Pnt2d>());
}
{
return MY_PNT2D->Distance(theOther->impl<gp_Pnt2d>());
}
+
+bool GeomAPI_Pnt2d::isEqual(const std::shared_ptr<GeomAPI_Pnt2d>& theOther) const
+{
+ return distance(theOther) < Precision::Confusion();
+}