Changeset 420 for trunk/Jgraph/draw.c
- Timestamp:
- 02/27/08 07:13:31 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jgraph/draw.c
r419 r420 22 22 error_header(); 23 23 fprintf(stderr, 24 "Value of %f is at negative infinity with log rhythmic %c axis\n",24 "Value of %f is at negative infinity with logarithmic %c axis\n", 25 25 val, (axis->is_x) ? 'x' : 'y'); 26 26 exit(1); 27 27 } 28 28 return (log(val) / axis->logfactor - axis->logmin) * axis->factor; … … 51 51 #define MAXIMUM(a,b) ((a > b) ? a : b) 52 52 53 draw_axis(a, other) 54 Axis a, other; 53 void draw_label(Label l) 54 { 55 if (l->label == CNULL) return; 56 comment(l->label); 57 print_label(l); 58 } 59 60 void draw_axis(Axis a, Axis other) 55 61 { 56 62 char orientation; … … 117 123 118 124 119 draw_label(l) 120 Label l; 121 { 122 if (l->label == CNULL) return; 123 comment(l->label); 124 print_label(l); 125 } 126 127 set_clip(g) 128 Graph g; 125 void set_clip(Graph g) 129 126 { 130 127 comment("Setting Clip"); … … 136 133 } 137 134 138 draw_curves(g) 139 Graph g; 135 void draw_curve(Curve c, Graph g); 136 137 void draw_curves(Graph g) 140 138 { 141 139 Curve c; … … 151 149 } 152 150 153 draw_curve(c, g) 154 Curve c; 155 Graph g; 151 void draw_mark(float x, float y, Curve c, Graph g); 152 void draw_arrow(float x1, float y1, float x2, float y2, Curve c); 153 154 void draw_curve(Curve c, Graph g) 156 155 { 157 156 Point p, px, py; … … 270 269 } 271 270 272 draw_mark(x, y, c, g) 273 float x, y; 274 Curve c; 275 Graph g; 271 void draw_mark(float x, float y, Curve c, Graph g) 276 272 { 277 273 Point p; … … 317 313 } 318 314 for (i = 0; i < 4; i++) { 319 if (fscanf(f, "%d", &(bb[i])) == NULL) {315 if (fscanf(f, "%d", &(bb[i])) == 0) { 320 316 fprintf(stderr, "Error: Eps file '%s': eof in %s\n", 321 317 c->eps, "bounding box"); … … 502 498 } 503 499 504 draw_arrow(x1, y1, x2, y2, c) 505 float x1, y1, x2, y2; 506 Curve c; 500 void draw_arrow(float x1, float y1, float x2, float y2, Curve c) 507 501 { 508 502 float dx, dy; … … 542 536 } 543 537 544 draw_legend(g) 545 Graph g; 538 void draw_legend(Graph g) 546 539 { 547 540 Curve c; … … 606 599 } 607 600 608 draw_strings(g) 609 Graph g; 601 void draw_strings(Graph g) 610 602 { 611 603 String s; … … 616 608 } 617 609 618 draw_graph(g) 619 Graph g; 610 void draw_graph(Graph g) 620 611 { 621 612 comment("Drawing New Graph"); … … 637 628 } 638 629 639 draw_graphs(gs, pp, landscape) 640 Graphs gs;641 int pp; 642 int landscape; 630 void draw_header(Graphs gs, int pp, int landscape); 631 void draw_footer(Graphs gs, int pp); 632 633 void draw_graphs(Graphs gs, int pp, int landscape) 643 634 { 644 635 Graphs gs_p; … … 661 652 } 662 653 663 draw_header(gs, pp, landscape) 664 Graphs gs; 665 int pp; 666 int landscape; 654 void draw_header(Graphs gs, int pp, int landscape) 667 655 { 668 656 FILE *f; … … 774 762 } 775 763 } else if (landscape) { 776 printf("% f0 translate\n", -gs->bb[2] - gs->bb[0]);764 printf("%d 0 translate\n", -gs->bb[2] - gs->bb[0]); 777 765 } 778 766 printf("1 setlinecap 1 setlinejoin\n"); … … 835 823 } 836 824 837 draw_footer(gs, pp) 838 Graphs gs; 839 int pp; 825 void draw_footer(Graphs gs, int pp) 840 826 { 841 827 FILE *f;
Note:
See TracChangeset
for help on using the changeset viewer.