]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug successive split polylines
authorPaul RASCLE <paul.rascle@edf.fr>
Tue, 12 Jul 2016 18:06:25 +0000 (20:06 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Tue, 12 Jul 2016 18:06:25 +0000 (20:06 +0200)
src/HYDROData/HYDROData_PolylineXY.cxx

index c36a6c7ff77edba8f13997fdc979e8fc4a74b633..3eaa0ad90360092de7db9b7ceb2215f0d03a4776 100644 (file)
@@ -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++)
                       {