/* * Copyright (c) 2004 Chirok Han * * This file is part of fig2pstricks. * * Fig2pstricks is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Fig2pstricks is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with fig2pstricks; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact: beanerjo@yahoo.com */ #include "fig2pstricks.h" #include "extern.h" int preinfo_polyline(int*ctbl,int*xmin,int*ymin,int*xmax,int*ymax,STREAM*sp) { int i, n, fa, ba, x, y, depth; tskipw(sp, 3); into_colortbl(ctbl,tscani(sp)); // linecolor into_colortbl(ctbl,tscani(sp)); // fillcolor depth = tscani(sp); tskipw(sp, 6); fa = tscani(sp); ba = tscani(sp); n = tscani(sp); if (fa) tskipw(sp, 5); if (ba) tskipw(sp, 5); for (i=0; i*xmax) *xmax=x; if (y<*ymin) *ymin=y; else if (y>*ymax) *ymax=y; } return depth; } void proc_polyline(FILE *fp, STREAM *sp) /* 2 */ { int i, fa, ba, npoints, subtype; int nx, ny; int hasset=0; int linearc; STYLE style; subtype = read_style(&style, sp); hasset = write_style(fp, &prev_style, &style); prev_style = style; psset_close(fp, hasset); tskipw(sp, 2); linearc = tscani(sp); fa = tscani(sp); ba = tscani(sp); npoints = tscani(sp); fputc('\n', fp); if (subtype==1) fprintf(fp, "\\psline"); else fprintf(fp, "\\pspolygon"); if (star_style(&style)) fputc('*', fp); if (linearc>0) fprintf(fp, "[linearc=%.3f]", thick2cm(linearc)); proc_arrows(fp, fa, ba, sp, subtype==1); for (i=0; i