The R Project SVN R

Rev

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

Rev 13792 Rev 15321
Line 479... Line 479...
479
 
479
 
480
/* maximal number of line segments of one contour segment: 
480
/* maximal number of line segments of one contour segment: 
481
 * for preventing infinite loops -- shouldn't be needed --> warning */
481
 * for preventing infinite loops -- shouldn't be needed --> warning */
482
#define MAX_ns 25000
482
#define MAX_ns 25000
483
 
483
 
-
 
484
    char *vmax;
-
 
485
 
484
    double f, xl, xh, yl, yh, zll, zhl, zlh, zhh, xx[4], yy[4];
486
    double f, xl, xh, yl, yh, zll, zhl, zlh, zhh, xx[4], yy[4];
485
    double xend, yend;
487
    double xend, yend;
486
    int i, ii, j, jj, k, l, m, nacode, ns, ns2, dir;
488
    int i, ii, j, jj, k, l, m, nacode, ns, ns2, dir;
487
    SEGP seglist, seg, s, start, end;
489
    SEGP seglist, seg, s, start, end;
488
    double *xxx, *yyy;
490
    double *xxx, *yyy;
Line 718... Line 720...
718
		warning("contour(): circular/long seglist -- bug.report()!");
720
		warning("contour(): circular/long seglist -- bug.report()!");
719
 
721
 
720
	    /* countour midpoint : use for labelling sometime (not yet!) */
722
	    /* countour midpoint : use for labelling sometime (not yet!) */
721
	    if (ns > 3) ns2 = ns/2; else ns2 = -1;
723
	    if (ns > 3) ns2 = ns/2; else ns2 = -1;
722
 
724
 
-
 
725
	    vmax = vmaxget();
723
	    xxx = (double *) C_alloc(ns + 1, sizeof(double));
726
	    xxx = (double *) R_alloc(ns + 1, sizeof(double));
724
	    yyy = (double *) C_alloc(ns + 1, sizeof(double));
727
	    yyy = (double *) R_alloc(ns + 1, sizeof(double));
725
	    /* now have the space, go through again: */
728
	    /* now have the space, go through again: */
726
	    s = start;
729
	    s = start;
727
	    ns = 0;
730
	    ns = 0;
728
	    xxx[ns] = s->x0;
731
	    xxx[ns] = s->x0;
729
	    yyy[ns++] = s->y0;
732
	    yyy[ns++] = s->y0;
Line 1044... Line 1047...
1044
	    else {
1047
	    else {
1045
		GPolyline(ns, xxx, yyy, USER, dd);
1048
		GPolyline(ns, xxx, yyy, USER, dd);
1046
	    }
1049
	    }
1047
 
1050
 
1048
	    GMode(0, dd);
1051
	    GMode(0, dd);
1049
	    C_free((char *) xxx);
1052
	    vmaxset(vmax);
1050
	    C_free((char *) yyy);
-
 
1051
	} /* while */
1053
	} /* while */
1052
      } /* for(i .. )  for(j ..) */
1054
      } /* for(i .. )  for(j ..) */
1053
    UNPROTECT_PTR(label1); /* pwwwargh! This is messy, but last thing
1055
    UNPROTECT_PTR(label1); /* pwwwargh! This is messy, but last thing
1054
			      protected is likely labelList, and that needs
1056
			      protected is likely labelList, and that needs
1055
			      to be preserved across calls */
1057
			      to be preserved across calls */