-
-
-#if 0
- // Draw curve formed by points
-
- for(int poly=0; poly<pts.GetNumPolys(); poly++)
- {
- if (pts.GetNumPoints(poly) > 2)
- {
- // Initial move...
- // If it's not on curve, then move to it, otherwise move to last point...
-
- int x, y;
-
- if (pts.GetOnCurve(poly, pts.GetNumPoints(poly) - 1))
- x = (int)pts.GetX(poly, pts.GetNumPoints(poly) - 1), y = (int)pts.GetY(poly, pts.GetNumPoints(poly) - 1);
- else
- x = (int)pts.GetX(poly, 0), y = (int)pts.GetY(poly, 0);
-
- for(int i=0; i<pts.GetNumPoints(poly); i++)
- {
- if (pts.GetOnCurve(poly, i))
-// LineTo(hdc, pts.GetX(poly, i), pts.GetY(poly, i));
- {
- p.drawLine(x, y, pts.GetX(poly, i), pts.GetY(poly, i));
- x = (int)pts.GetX(poly, i), y = (int)pts.GetY(poly, i);
- }
- else
- {
- uint32 prev = pts.GetPrev(poly, i), next = pts.GetNext(poly, i);
- float px = pts.GetX(poly, prev), py = pts.GetY(poly, prev),
- nx = pts.GetX(poly, next), ny = pts.GetY(poly, next);
-
- if (!pts.GetOnCurve(poly, prev))
- px = (px + pts.GetX(poly, i)) / 2.0f,
- py = (py + pts.GetY(poly, i)) / 2.0f;
-
- if (!pts.GetOnCurve(poly, next))
- nx = (nx + pts.GetX(poly, i)) / 2.0f,
- ny = (ny + pts.GetY(poly, i)) / 2.0f;
-
- Bezier(p, point(px, py), point(pts.GetX(poly, i), pts.GetY(poly, i)), point(nx, ny));
- x = (int)nx, y = (int)ny;
-
- if (pts.GetOnCurve(poly, next))
- i++; // Following point is on curve, so move past it
- }
- }
- }
- }
-#endif