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...
{
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)
{
HYDROData_PolylineXY::PointsList aSectPoints = theOldPolyline->GetPoints(isec, false);
int nbPoints = aSectPoints.Length();
+ DEBTRACE("nbPoints " << nbPoints);
if (forward)
for (int i=1; i<=nbPoints; i++)
{