1 #ifndef lint 2 static char *sccsid ="piece.c (CWI) 1.1 85/03/01"; 3 #endif 4 #include "ideal.h" 5 #include "y.tab.h" 6 7 void linecall (linefax) 8 LINEPTR linefax; 9 { 10 printf ("...line %f %f %f %f\n", 11 linefax->x0, linefax->y0, 12 linefax->x1, linefax->y1 13 ); 14 } 15 16 void circcall (circfax) 17 CIRCPTR circfax; 18 { 19 printf ("...circle %f %f %f\n", 20 circfax->x0, circfax->y0, circfax->r 21 ); 22 } 23 24 void arccall (arcfax) 25 ARCPTR arcfax; 26 { 27 printf ("...arc %f %f %f %f %f %f %f %f %f\n", 28 arcfax->x0, arcfax->y0, 29 arcfax->x1, arcfax->y1, 30 arcfax->x2, arcfax->y2, 31 arcfax->theta1, arcfax->theta2, 32 33 fabs(arcfax->radius) 34 ); 35 } 36 37 void textcall (textfax) 38 TEXTPTR textfax; 39 { 40 switch (textfax->command) { 41 case LEFT: 42 printf ("...left %f %f '%s\n", 43 textfax->x0, 44 textfax->y0, 45 textfax->string 46 ); 47 break; 48 case CENTER: 49 printf ("...center %f %f '%s\n", 50 textfax->x0, 51 textfax->y0, 52 textfax->string 53 ); 54 break; 55 case RIGHT: 56 printf ("...right %f %f '%s\n", 57 textfax->x0, 58 textfax->y0, 59 textfax->string 60 ); 61 break; 62 default: 63 fprintf (stderr, "ideal: textcall: can't happen\n"); 64 break; 65 } 66 } 67 68 void boundscall (maxx, maxy, minx, miny) 69 float maxx, maxy; 70 float minx, miny; 71 { 72 printf ("...maxx %f\n", maxx); 73 printf ("...maxy %f\n", maxy); 74 printf ("...minx %f\n", minx); 75 printf ("...miny %f\n", miny); 76 } 77 78 void splcall (knotlist) 79 EXPRPTR knotlist; 80 { 81 printf ("...spline %f %f\n", 82 Re(((INTLPTR) knotlist->expr)), 83 Im(((INTLPTR) knotlist->expr)) 84 ); 85 knotlist = knotlist->next; 86 while (knotlist) { 87 printf ("...knot %f %f\n", 88 Re(((INTLPTR) knotlist->expr)), 89 Im(((INTLPTR) knotlist->expr)) 90 ); 91 knotlist = knotlist->next; 92 } 93 printf ("...endspline\n"); 94 } 95