version 1.2, 2000/10/15 10:58:11 |
version 1.3, 2000/10/24 01:53:53 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/plot/smoothing.c,v 1.1 2000/10/15 06:56:53 takayama Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/plot/smoothing.c,v 1.2 2000/10/15 10:58:11 takayama Exp $ */ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#include "ox.h" |
#include "ox.h" |
Line 24 static struct polyLine *polyLine_addNewSegment(struct |
|
Line 24 static struct polyLine *polyLine_addNewSegment(struct |
|
int x,int y); |
int x,int y); |
static int polyLine_lastY(struct polyLine *pl); |
static int polyLine_lastY(struct polyLine *pl); |
static void polyLine_outputPS(struct polyLine *pl); |
static void polyLine_outputPS(struct polyLine *pl); |
|
static void polyLine_output_bezier_PS(struct polyLine *pl); |
static void polyLine_outputProlog(int xmin, int ymin, int xmax, int ymax); |
static void polyLine_outputProlog(int xmin, int ymin, int xmax, int ymax); |
static void polyLine_outputEpilog(void); |
static void polyLine_outputEpilog(void); |
static void polyLine_error(char *s); |
static void polyLine_error(char *s); |
Line 115 static void polyLine_outputPS(struct polyLine *pl) { |
|
Line 116 static void polyLine_outputPS(struct polyLine *pl) { |
|
} |
} |
fflush(Fp); |
fflush(Fp); |
} |
} |
|
static void polyLine_output_bezier_PS(struct polyLine *pl) { |
|
int n,i,m; |
|
n = pl->numberOfSegments; |
|
if (n == 1) { |
|
fprintf(Fp," %d %d ifplot_putpixel\n",translateX(pl->x[0]),translateY(pl->y[0])); |
|
}else if (n > 1) { |
|
fprintf(Fp," newpath "); |
|
i=0; |
|
m = n-1-((n-1)/3)*3; |
|
fprintf(Fp," %d %d ",translateX(pl->x[i]),translateY(pl->y[i])); |
|
fprintf(Fp," moveto \n "); |
|
for (i=1; i<= ((n-1)/3)*3; i++) { |
|
fprintf(Fp," %d %d ",translateX(pl->x[i]),translateY(pl->y[i])); |
|
if ( i%3 == 0) fprintf(Fp," curveto "); |
|
} |
|
for (i=n-m; i<n; i++) { |
|
fprintf(Fp," %d %d lineto ",translateX(pl->x[i]),translateY(pl->y[i])); |
|
} |
|
fprintf(Fp," stroke\n"); |
|
} |
|
fflush(Fp); |
|
} |
static void polyLine_outputProlog(int xmin, int ymin,int xmax, int ymax) { |
static void polyLine_outputProlog(int xmin, int ymin,int xmax, int ymax) { |
fprintf(Fp,"%%!PS-Adobe-1.0\n"); |
fprintf(Fp,"%%!PS-Adobe-1.0\n"); |
fprintf(Fp,"%%%%BoundingBox: %d %d %d %d \n", |
fprintf(Fp,"%%%%BoundingBox: %d %d %d %d \n", |
Line 123 static void polyLine_outputProlog(int xmin, int ymin,i |
|
Line 146 static void polyLine_outputProlog(int xmin, int ymin,i |
|
fprintf(Fp,"%%%%Creator: This is generated by ifplot\n"); |
fprintf(Fp,"%%%%Creator: This is generated by ifplot\n"); |
fprintf(Fp,"%%%%Title: ifplot\n"); |
fprintf(Fp,"%%%%Title: ifplot\n"); |
fprintf(Fp,"%%%%EndComments: \n"); |
fprintf(Fp,"%%%%EndComments: \n"); |
|
fprintf(Fp,"0.1 setlinewidth \n"); |
|
fprintf(Fp,"2 setlinecap \n"); |
|
fprintf(Fp,"2 setlinejoin \n"); |
fprintf(Fp,"/ifplot_putpixel { \n"); |
fprintf(Fp,"/ifplot_putpixel { \n"); |
fprintf(Fp," /yyy 2 1 roll def /xxx 2 1 roll def \n"); |
fprintf(Fp," /yyy 2 1 roll def /xxx 2 1 roll def \n"); |
fprintf(Fp," gsave newpath xxx yyy .5 0 360 arc \n"); |
fprintf(Fp," gsave newpath xxx yyy .5 0 360 arc \n"); |
Line 183 static int updatePolyLine(struct polyLine *pl[], int p |
|
Line 209 static int updatePolyLine(struct polyLine *pl[], int p |
|
} |
} |
for (i=1; i<=Ysize; i++) { |
for (i=1; i<=Ysize; i++) { |
if (prevHasNext[i] == NO && prev[i] IS_POLYLINE) { |
if (prevHasNext[i] == NO && prev[i] IS_POLYLINE) { |
polyLine_outputPS(pl[prev[i]]); |
/* polyLine_outputPS(pl[prev[i]]); */ |
|
polyLine_output_bezier_PS(pl[prev[i]]); |
} |
} |
} |
} |
|
|