From: Paul RASCLE Date: Tue, 12 Jul 2016 18:06:25 +0000 (+0200) Subject: debug successive split polylines X-Git-Tag: v1.6~89 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ffe95fced68b2305e780f6ca0ca118f2eb9dd659;p=modules%2Fhydro.git debug successive split polylines --- diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index c36a6c7f..3eaa0ad9 100644 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -505,11 +505,15 @@ bool convertEdgesToSections( const TopoDS_Edge& double pmin = p[0]; double pmax = p[1]; bool forward = true; - if (! isOldSectionclosed) // no need to check first and last points on an open curve + DEBTRACE("isOldSectionclosed: " << isOldSectionclosed); + if (!isOldSectionclosed) // no need to check first and last points on an open curve { - pmin = p[1]; - pmax = p[0]; - forward = false; + if (pmin > pmax) + { + pmin = p[1]; + pmax = p[0]; + forward = false; + } } else // old section closed: check if we use first or last points... { @@ -538,6 +542,7 @@ bool convertEdgesToSections( const TopoDS_Edge& else if ((abs(pmax - pfirst) <1.e-3) and (p[2] > pmin)) // forward, replace pmax par plast pmax = plast; } + DEBTRACE("forward: "<< forward << " pmin " << pmin << " pmax " << pmax); HYDROData_PolylineXY::Point aFirstPoint, aLastPoint; if (forward) { @@ -553,6 +558,7 @@ bool convertEdgesToSections( const TopoDS_Edge& HYDROData_PolylineXY::PointsList aSectPoints = theOldPolyline->GetPoints(isec, false); int nbPoints = aSectPoints.Length(); + DEBTRACE("nbPoints " << nbPoints); if (forward) for (int i=1; i<=nbPoints; i++) {