X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Lin.cpp;h=58095f0e8f1432d4b10086ad5a48634549da044d;hb=6538b6539abf93cf24183c7cfe8a5800a464178f;hp=9d040702438eb7018cd74c4e77938f55fe3c11a9;hpb=73c02c2103a34ec5d2ac48a345757dee0e0d42f9;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Lin.cpp b/src/GeomAPI/GeomAPI_Lin.cpp index 9d0407024..58095f0e8 100644 --- a/src/GeomAPI/GeomAPI_Lin.cpp +++ b/src/GeomAPI/GeomAPI_Lin.cpp @@ -20,24 +20,25 @@ #define MY_LIN static_cast(myImpl) static gp_Lin* newLine(const double theStartX, const double theStartY, const double theStartZ, - const double theEndX, const double theEndY, const double theEndZ) + const double theEndX, const double theEndY, const double theEndZ) { gp_XYZ aDir(theEndX - theStartX, theEndY - theStartY, theEndZ - theStartZ); gp_Pnt aStart(theStartX, theStartY, theStartZ); return new gp_Lin(aStart, gp_Dir(aDir)); } - GeomAPI_Lin::GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ, - const double theEndX, const double theEndY, const double theEndZ) - : GeomAPI_Interface(newLine(theStartX, theStartY, theStartZ, theEndX, theEndY, theEndZ)) -{} + const double theEndX, const double theEndY, const double theEndZ) + : GeomAPI_Interface(newLine(theStartX, theStartY, theStartZ, theEndX, theEndY, theEndZ)) +{ +} GeomAPI_Lin::GeomAPI_Lin(const boost::shared_ptr& theStart, const boost::shared_ptr& theEnd) - : GeomAPI_Interface(newLine(theStart->x(), theStart->y(), theStart->z(), - theEnd->x(), theEnd->y(), theEnd->z())) -{} + : GeomAPI_Interface( + newLine(theStart->x(), theStart->y(), theStart->z(), theEnd->x(), theEnd->y(), theEnd->z())) +{ +} double GeomAPI_Lin::distance(const boost::shared_ptr& thePoint) const { @@ -45,30 +46,31 @@ double GeomAPI_Lin::distance(const boost::shared_ptr& thePoint) con } const boost::shared_ptr GeomAPI_Lin::intersect( - const boost::shared_ptr& theLine) const + const boost::shared_ptr& theLine) const { if (MY_LIN->SquareDistance(theLine->impl()) > Precision::Confusion()) - return boost::shared_ptr(); + return boost::shared_ptr(); const gp_Dir& aDir1 = MY_LIN->Direction(); const gp_Dir& aDir2 = theLine->impl().Direction(); gp_Dir aCross = aDir1.Crossed(aDir2); - gp_Pln aPlane(MY_LIN->Location(), aCross); // plane containing both lines + gp_Pln aPlane(MY_LIN->Location(), aCross); // plane containing both lines gp_Lin2d aPrjLine1 = ProjLib::Project(aPlane, *MY_LIN); gp_Lin2d aPrjLine2 = ProjLib::Project(aPlane, theLine->impl()); IntAna2d_AnaIntersection anInter(aPrjLine1, aPrjLine1); if (!anInter.IsDone() || anInter.IsEmpty()) - return boost::shared_ptr(); + return boost::shared_ptr(); const gp_Pnt2d& anIntPnt2d = anInter.Point(0).Value(); gp_Pnt aResult = ElSLib::Value(anIntPnt2d.X(), anIntPnt2d.Y(), aPlane); return boost::shared_ptr( - new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); + new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); } -const boost::shared_ptr GeomAPI_Lin::project(const boost::shared_ptr& thePoint) const +const boost::shared_ptr GeomAPI_Lin::project( + const boost::shared_ptr& thePoint) const { const gp_XYZ& aDir = MY_LIN->Direction().XYZ(); const gp_XYZ& aLoc = MY_LIN->Location().XYZ();