void vdpnta_(float *x, float *y) { float new_x, new_y; int temp; new_x = map_x(*x); new_y = map_y(*y); temp = 1; vflush(); vlist_x[nvert] = new_x; vlist_y[nvert] = new_y; nvert++; cpm_(&temp, &new_x, &new_y); xcp = *x; ycp = *y; }
static void draw_full_sets_on_grid ( bitmap_t * fset_mask, /* IN - mask of valid FSTs */ struct cinfo * cip /* IN - compatibility info */ ) { int i; int j; int u, v, ux, uy, vx, vy; int nt; int ns; struct full_set * fsp; struct pset * terms; struct pset * steins; struct edge * ep; int * xi; int * yi; xi = grid.xindex; yi = grid.yindex; for (i = 0; i < cip -> num_edges; i++) { if (NOT BITON (fset_mask, i)) continue; fsp = cip -> full_trees [i]; ep = fsp -> edges; terms = fsp -> terminals; steins = fsp -> steiners; nt = terms -> n; ns = steins -> n; for (j = 0; j < fsp -> nedges; j++, ep++) { u = ep -> p1; if (u < 0) { fatal ("draw_full_sets_on_grid: Bug 1."); } if (u < nt) { u = terms -> a [u].pnum; ux = xi [u]; uy = yi [u]; } else { u -= nt; if (u >= ns) { fatal ("draw_full_sets_on_grid: Bug 2."); } ux = map_x (steins -> a [u].x); uy = map_y (steins -> a [u].y); } v = ep -> p2; if (v < 0) { fatal ("draw_full_sets_on_grid: Bug 3."); } if (v < nt) { v = terms -> a [v].pnum; vx = xi [v]; vy = yi [v]; } else { v -= nt; if (v >= ns) { fatal ("draw_full_sets_on_grid: Bug 4."); } vx = map_x (steins -> a [v].x); vy = map_y (steins -> a [v].y); } draw_bb_grid (ux, uy, vx, vy); } } }
void vdtext_(int *length, int char_array[]) { int i, lenout, len, temp1, temp2; float dx, dy, temp_xcp, temp_ycp, temp3; int strout[150]; len = *length; if (len < 1) { vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 212, Severity Code 5 "); return; } if (len > 136) { vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 213, Severity Code 5 "); len = 136; } if (alpha_mode) { temp1 = XEAGMD; temp2 = 1; temp3 = 1.; /* graphics */ cesc2_(&temp1, &temp2, &temp3); alpha_mode = FALSE; } lenout = 0; /*count characters in string output buffer "strout" */ for (i = 0; i < len; i++) { if (char_array[i] < 32 || char_array[i] > 126) { switch (char_array[i]) { case 8: dx = -vector[6]; dy = 0.; break; case 10: dx = 0.; dy = -vector[5]; break; case 13: dx = -xcp; dy = 0.; break; default: dx = 0.; dy = 0.; vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 208, Severity Code 5 "); break; } /* Stuff to send, finish the string */ if (lenout != 0) { temp_xcp = map_x(xcp); temp_ycp = map_y(ycp); ctx2_(&temp_xcp, &temp_ycp, strout, &lenout); xcp += lenout * vector[6]; lenout = 0; } xcp += dx; ycp += dy; vdmova_(&xcp, &ycp); } else strout[lenout++] = char_array[i]; } /* All done, get rid of them */ if (lenout != 0) { temp_xcp = map_x(xcp); temp_ycp = map_y(ycp); ctx2_(&temp_xcp, &temp_ycp, strout, &lenout); xcp += lenout * vector[6]; lenout = 0; } }
void vdinit_(float *aspect, int *justif) { float asp; int just, temp, temp2, vstat, vconc; float xconc, yconc, x1, y1, x2, y2, x3, y3, x4, y4, temp_xcp, temp_ycp; float scaled_ndc_xmax, scaled_ndc_ymax; float rtemp = 0.0; xconc = 0.0; yconc = 0.0; x1 = 0.0; y1 = 0.0; x2 = 0.0; y2 = 0.0; x3 = 0.0; y3 = 0.0; x4 = 0.0; y4 = 0.0; asp = *aspect; just = *justif; if (asp < 0.) { vdicgi_errh(" SVDI Shell (VDINIT) Error Number 721 Severity 5: "); asp = 0.; } if (just < 0 || just > 9) { vdicgi_errh(" SVDI Shell (VDINIT) Error Number 720 Severity 5: "); just = 0; } /* Initialize CGI */ temp = CACT; alpha_mode = FALSE; ci_(&temp); /* Inquire everything you always wanted to know about */ vbinq(); /* Turn off clip indicators */ temp = CDCOFF; cdscl_(&temp); temp = COFF; ccl_(&temp); /* Set up proper scaling to take advantage of whole device (not just square) */ if (asp == 0.) asp = dev_cap[14] / dev_cap[15]; if (asp > 1.) { ndc_xmax = 1.; ndc_ymax = 1. / asp; } else { ndc_xmax = asp; ndc_ymax = 1.; } scale = 32767.; scaled_ndc_xmax = map_x(ndc_xmax); scaled_ndc_ymax = map_y(ndc_ymax); rtemp = 0.0; cvdcx_(&rtemp, &rtemp, &scaled_ndc_xmax, &scaled_ndc_ymax); /* Set color mode to index, and set color index precision to 8 bits */ temp = CINDEX; ccsm_(&temp); temp = 8; ccixp_(&temp); color_scale = 255.; /* set up the standard 8 colors in indices 2 - 9 (0 reserved for background, 1 reserved for default foreground) */ temp = 2; temp2 = 8; cct_(&temp, &temp2, init_colors); /* Set default marker type to dot */ temp = 1; cmkt_(&temp); /* Set default interior style to solid */ temp = CSOLID; cis_(&temp); /* Inquire what the default character size is - use cgtxx instead of cqtxa because need both x and y size (may have to adjust for inter character/line spacing later */ temp_xcp = map_x(xcp); temp_ycp = map_y(ycp); cgtxx2_(&temp_xcp, &temp_ycp, &vstat, &vconc, &xconc, &yconc, &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4); if (vstat == CVAL) { vector[5] = ndc_map_x(x2 - x1); vector[6] = ndc_map_y(y4 - y1); } else vdicgi_errh(" SVDI Shell (VDINIT) inquire error from cgtxx "); /* Initialize locator device */ temp = CLOCAT; temp2 = 1; cili_(&temp, &temp2); }