The R Project SVN R

Rev

Rev 36362 | Rev 36748 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36362 Rev 36366
Line 1764... Line 1764...
1764
/*
1764
/*
1765
 * Draws a "curve" through the specified control points.
1765
 * Draws a "curve" through the specified control points.
1766
 * Return the vertices of the line that gets drawn.
1766
 * Return the vertices of the line that gets drawn.
1767
 */
1767
 */
1768
SEXP GEXspline(int n, double *x, double *y, double *s, Rboolean open,
1768
SEXP GEXspline(int n, double *x, double *y, double *s, Rboolean open,
-
 
1769
	       Rboolean draw, /* May be called just to get points */
1769
	       R_GE_gcontext *gc, GEDevDesc *dd)
1770
	       R_GE_gcontext *gc, GEDevDesc *dd)
1770
{
1771
{
1771
    /*
1772
    /*
1772
     * Use xspline.c code to generate points to draw
1773
     * Use xspline.c code to generate points to draw
1773
     * Draw polygon or polyline from points
1774
     * Draw polygon or polyline from points
Line 1778... Line 1779...
1778
     * after any R_alloc's done by functions I call.
1779
     * after any R_alloc's done by functions I call.
1779
     */
1780
     */
1780
    char *vmaxsave = vmaxget();
1781
    char *vmaxsave = vmaxget();
1781
    if (open) {
1782
    if (open) {
1782
      compute_open_spline(n, x, y, s, HIGH_PRECISION, dd);
1783
      compute_open_spline(n, x, y, s, HIGH_PRECISION, dd);
-
 
1784
      if (draw)
1783
      GEPolyline(npoints, xpoints, ypoints, gc, dd);
1785
	  GEPolyline(npoints, xpoints, ypoints, gc, dd);
1784
    } else {
1786
    } else {
1785
      compute_closed_spline(n, x, y, s, HIGH_PRECISION, dd);
1787
      compute_closed_spline(n, x, y, s, HIGH_PRECISION, dd);
-
 
1788
      if (draw)
1786
      GEPolygon(npoints, xpoints, ypoints, gc, dd);
1789
	  GEPolygon(npoints, xpoints, ypoints, gc, dd);
1787
    }
1790
    }
1788
    if (npoints > 1) {
1791
    if (npoints > 1) {
1789
	SEXP xpts, ypts;
1792
	SEXP xpts, ypts;
1790
	int i;
1793
	int i;
1791
	PROTECT(xpts = allocVector(REALSXP, npoints));
1794
	PROTECT(xpts = allocVector(REALSXP, npoints));