The R Project SVN R

Rev

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

Rev 14752 Rev 15321
Line 1863... Line 1863...
1863
	/* DEVICE coordinates using GConvert			*/
1863
	/* DEVICE coordinates using GConvert			*/
1864
	/********************************************************/
1864
	/********************************************************/
1865
 
1865
 
1866
static void GA_Polyline(int n, double *x, double *y, int coords, DevDesc *dd)
1866
static void GA_Polyline(int n, double *x, double *y, int coords, DevDesc *dd)
1867
{
1867
{
-
 
1868
    char *vmax = vmaxget();
1868
    point *p = (point *) C_alloc(n, sizeof(point));
1869
    point *p = (point *) R_alloc(n, sizeof(point));
1869
    double devx, devy;
1870
    double devx, devy;
1870
    int   i;
1871
    int   i;
1871
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1872
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1872
    TRACEDEVGA("pl");
1873
    TRACEDEVGA("pl");
1873
    for (i = 0; i < n; i++) {
1874
    for (i = 0; i < n; i++) {
Line 1878... Line 1879...
1878
	p[i].y = (int) devy;
1879
	p[i].y = (int) devy;
1879
    }
1880
    }
1880
    SetColor(dd->gp.col, dd),
1881
    SetColor(dd->gp.col, dd),
1881
	SetLinetype(dd->gp.lty, dd->gp.lwd, dd);
1882
	SetLinetype(dd->gp.lty, dd->gp.lwd, dd);
1882
    DRAW(gdrawpolyline(_d, xd->lwd, xd->lty, xd->fgcolor, p, n, 0, 0));
1883
    DRAW(gdrawpolyline(_d, xd->lwd, xd->lty, xd->fgcolor, p, n, 0, 0));
1883
    C_free((char *) p);
1884
    vmaxset(vmax);
1884
}
1885
}
1885
 
1886
 
1886
	/********************************************************/
1887
	/********************************************************/
1887
	/* device_Polygon should have the side-effect that a 	*/
1888
	/* device_Polygon should have the side-effect that a 	*/
1888
	/* polygon is drawn using the given x and y values	*/
1889
	/* polygon is drawn using the given x and y values	*/
Line 1896... Line 1897...
1896
	/********************************************************/
1897
	/********************************************************/
1897
 
1898
 
1898
static void GA_Polygon(int n, double *x, double *y, int coords,
1899
static void GA_Polygon(int n, double *x, double *y, int coords,
1899
			int bg, int fg, DevDesc *dd)
1900
			int bg, int fg, DevDesc *dd)
1900
{
1901
{
-
 
1902
    char *vmax = vmaxget();
1901
    point *points;
1903
    point *points;
1902
    double devx, devy;
1904
    double devx, devy;
1903
    int   i;
1905
    int   i;
1904
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1906
    gadesc *xd = (gadesc *) dd->deviceSpecific;
1905
 
1907
 
1906
    TRACEDEVGA("plg");
1908
    TRACEDEVGA("plg");
1907
    points = (point *) C_alloc(n , sizeof(point));
1909
    points = (point *) R_alloc(n , sizeof(point));
1908
    if (!points)
1910
    if (!points)
1909
	return;
1911
	return;
1910
    for (i = 0; i < n; i++) {
1912
    for (i = 0; i < n; i++) {
1911
	devx = x[i];
1913
	devx = x[i];
1912
	devy = y[i];
1914
	devy = y[i];
Line 1921... Line 1923...
1921
    if (fg != NA_INTEGER) {
1923
    if (fg != NA_INTEGER) {
1922
	SetColor(fg, dd);
1924
	SetColor(fg, dd);
1923
	SetLinetype(dd->gp.lty, dd->gp.lwd, dd);
1925
	SetLinetype(dd->gp.lty, dd->gp.lwd, dd);
1924
	DRAW(gdrawpolygon(_d, xd->lwd, xd->lty, xd->fgcolor, points, n, 0 ));
1926
	DRAW(gdrawpolygon(_d, xd->lwd, xd->lty, xd->fgcolor, points, n, 0 ));
1925
    }
1927
    }
1926
    C_free((char *) points);
1928
    vmaxset(vmax);
1927
}
1929
}
1928
 
1930
 
1929
 
1931
 
1930
	/********************************************************/
1932
	/********************************************************/
1931
	/* device_Text should have the side-effect that the 	*/
1933
	/* device_Text should have the side-effect that the 	*/