diff options
author | joye <joye> | 2014-05-30 21:31:04 (GMT) |
---|---|---|
committer | joye <joye> | 2014-05-30 21:31:04 (GMT) |
commit | f8a01906e319c1d68d96f6bf20510cf771f6e7e3 (patch) | |
tree | 8014823bb5d7c11452240f645ca317ffbe6dbf87 /src/bltGraph.C | |
parent | b4e1bb34955d01729ee9e29bae532c06b71b1afa (diff) | |
download | blt-f8a01906e319c1d68d96f6bf20510cf771f6e7e3.zip blt-f8a01906e319c1d68d96f6bf20510cf771f6e7e3.tar.gz blt-f8a01906e319c1d68d96f6bf20510cf771f6e7e3.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltGraph.C')
-rw-r--r-- | src/bltGraph.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bltGraph.C b/src/bltGraph.C index ab4eae0..e5fae53 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -1423,6 +1423,31 @@ void Graph::drawSegments(Drawable drawable, GC gc, delete [] xsegments; } +void Graph::printPolyline(Blt_Ps ps, Point2d* screenPts, int nScreenPts) +{ + Point2d *pp, *pend; + + pp = screenPts; + Blt_Ps_Append(ps, "newpath\n"); + Blt_Ps_Format(ps, " %g %g moveto\n", pp->x, pp->y); + for (pp++, pend = screenPts + nScreenPts; pp < pend; pp++) { + Blt_Ps_Format(ps, " %g %g lineto\n", pp->x, pp->y); + } +} + +void Graph::printMaxPolyline(Blt_Ps ps, Point2d* points, int nPoints) +{ + if (nPoints <= 0) + return; + + for (int nLeft = nPoints; nLeft > 0; nLeft -= 1500) { + int length = MIN(1500, nLeft); + printPolyline(ps, points, length); + Blt_Ps_Append(ps, "DashesProc stroke\n"); + points += length; + } +} + void Graph::printSegments(Blt_Ps ps, Segment2d* segments, int nSegments) { Segment2d* sp; |