rsalz@uunet.uu.net (03/30/88)
Submitted-by: Joe Dellinger <joe@hanauma.STANFORD.EDU> Posting-number: Volume 14, Issue 14 Archive-name: vplot/part09 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 9 (of 24)." # Wrapped by rsalz@fig.bbn.com on Fri Mar 25 11:47:07 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Envision_device/envilib/enviattr.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Envision_device/envilib/enviattr.c'\" else echo shar: Extracting \"'Envision_device/envilib/enviattr.c'\" \(2314 characters\) sed "s/^X//" >'Envision_device/envilib/enviattr.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/envilib/enviattr.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <stdio.h> X#include <math.h> X#include "../include/attrcom.h" X#include "../include/params.h" X#include "envi.h" X extern FILE *pltout; X enviattributes (command, value, v1, v2, v3) X register int command, value; X int v1, v2, v3; X{ int icol; X X switch (command) X { X case SET_COLOR: X envisetmode (REG); X if ((version < 220 && value < 8) || (version >= 220 && value < 16)) X { X if (value < 8) X { X /* Convert from Regis colors to Envision Colors */ X icol = (int) (value / 2) + (value - 2 * (int) (value / 2)) * 4; X } X else X { X icol = value; X } X fprintf (pltout, "%cC%c", ESC, icol + '0'); X } X else X { X /* Try some sort of a fill pattern instead */ X /* Cycle through colors, skipping black */ X icol = 1 + ((value - 8) % 7); X icol = (int) (icol / 2) + (icol - 2 * (int) (icol / 2)) * 4; X fprintf (pltout, "%cC%c", ESC, icol + '0'); X /* Also cycle through patterns everytime colors flip */ X icol = floor ((float) (value - 8) / 7.); X icol = icol % 33; X fprintf (pltout, "%cOH%c", ESC, icol + '0'); X } X break; X case SET_COLOR_TABLE: X /* 220 can't reset colors 8-15 ... stupid terminal has another bug */ X if (value < 8) X { X envisetmode (REG); X if (value < 8) X { X /* Convert from Regis colors to Envision Colors */ X icol = (int) (value / 2) + (value - 2 * (int) (value / 2)) * 4; X } X else X { X icol = value; X } X v1 /= (int) ((MAX_GUN + 1) / 16); X v2 /= (int) ((MAX_GUN + 1) / 16); X v3 /= (int) ((MAX_GUN + 1) / 16); X fprintf (pltout, "%cQ%c%c%c%c", X ESC, icol + '0', v1 + '0', v2 + '0', v3 + '0'); X } X break; X default: X break; X } X X return 0; X} END_OF_FILE if test 2314 -ne `wc -c <'Envision_device/envilib/enviattr.c'`; then echo shar: \"'Envision_device/envilib/enviattr.c'\" unpacked with wrong size! fi # end of 'Envision_device/envilib/enviattr.c' fi if test -f 'Envision_device/envilib/envimessage.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Envision_device/envilib/envimessage.c'\" else echo shar: Extracting \"'Envision_device/envilib/envimessage.c'\" \(2025 characters\) sed "s/^X//" >'Envision_device/envilib/envimessage.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/envilib/envimessage.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <stdio.h> X#include "../include/mesgcom.h" X#include "envi.h" extern FILE *pltout; X envimessage (command, string) X int command; X char string[]; X{ X switch (command) X { X case MESG_OFF: /* Turn off Text */ X envisetmode (REG); /* Get out of Tek mode */ X fprintf (pltout, "%cRA0", ESC); X fflush (pltout); X break; X case MESG_ON: /* Turn on Text */ X envisetmode (REG); /* Get out of Tek mode */ X fprintf (pltout, "%cRA1", ESC); X fflush (pltout); X break; X case MESG_ERASE: /* Erase Text */ X envisetmode (REG); /* Get out of Tek mode */ X putc (ESC, pltout); X fprintf (pltout, "[2J");/* Erase Text Screen */ X fflush (pltout); X break; X case MESG_HOME: /* Home */ X envisetmode (REG); /* Get out of Tek mode */ X fprintf (pltout, "%c[H", ESC); /* Home */ X break; X case MESG_READY: /* Prepare for text */ X envisetmode (REG); /* Get out of Tek mode */ X enviresetpan (); /* Need to print on the text screen */ X fflush (pltout); X break; X case MESG_DONE: /* Done with text */ X envisetpan (); X fflush (pltout); X break; X case MESG_HIGHLIGHT_ON: /* Get ready for prompting */ X fprintf (pltout, "%c[5m", ESC); X break; X case MESG_HIGHLIGHT_OFF: /* Get ready for prompting */ X fprintf (pltout, "%c[0m", ESC); X break; X case MESG_TEXT: /* Print out the text */ X fprintf (pltout, "%s", string); X break; X default: /* Not intended for us, ignore */ X break; X } X} END_OF_FILE if test 2025 -ne `wc -c <'Envision_device/envilib/envimessage.c'`; then echo shar: \"'Envision_device/envilib/envimessage.c'\" unpacked with wrong size! fi # end of 'Envision_device/envilib/envimessage.c' fi if test -f 'Imagen_device/imaglib/imagplot.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagplot.c'\" else echo shar: Extracting \"'Imagen_device/imaglib/imagplot.c'\" \(2505 characters\) sed "s/^X//" >'Imagen_device/imaglib/imagplot.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/imaglib/imagplot.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <stdio.h> X#include "../include/err.h" X#include "../include/enum.h" X#include "../include/extern.h" X#include "imagen.h" X X/* X * PATCH: X * Occasionally, the imagen will forget to plot the last segment of X * a path. To guard against this, the last point of each path is X * repeated! X */ int lost = 1; X imagplot (x, y, draw) X int x, y, draw; X{ X if (draw == 0) X { X startpath (); X lost = 0; X } X addpath (x, y); X} X static int pathsave[PATHLENGTH][2]; static int where = -1; X startpath () X{ X if (where > 0) X { X endpath (DRAW_PATH, imag_curcolor); X } X where = 0; X} X addpath (x, y) X int x, y; X{ static int oldx, oldy; X X if (where == -1) X ERR (FATAL, name, X "addpath, with no active path!(This can't happen.)"); X if (where > 0 && x == oldx && y == oldy) X return; X pathsave[where][1] = x; /* The default coordinates are pretty bizarre */ X pathsave[where][0] = y; /* Swap X and Y and they look standard! */ X oldx = x; X oldy = y; X where++; X X /* X * PATCH: leave room for redundant point at end X */ X if (where == PATHLENGTH - 1) X { X endpath (DRAW_PATH, imag_curcolor); X } X} X endpath (what_to_do, what_color) X int what_to_do, what_color; X{ int i; X X if (where == 0) X ERR (FATAL, name, "endpath, can't end path with length zero"); X X /* X * PATCH: Add redundant point at end X */ X if (where > 0) X { X pathsave[where][0] = pathsave[where - 1][0]; X pathsave[where][1] = pathsave[where - 1][1]; X where++; X X fprintf (pltout, "%c%c%c", CREATE_PATH, hib (where), lob (where)); X for (i = 0; i < where; i++) X { X fprintf (pltout, "%c%c", hib (pathsave[i][0]), lob (pathsave[i][0])); X fprintf (pltout, "%c%c", hib (pathsave[i][1]), lob (pathsave[i][1])); X } X fprintf (pltout, "%c%c", what_to_do, what_color); X where = -1; X } X lost = 1; X} END_OF_FILE if test 2505 -ne `wc -c <'Imagen_device/imaglib/imagplot.c'`; then echo shar: \"'Imagen_device/imaglib/imagplot.c'\" unpacked with wrong size! fi # end of 'Imagen_device/imaglib/imagplot.c' fi if test -f 'Tek_device/cteklib/ctekpack.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekpack.c'\" else echo shar: Extracting \"'Tek_device/cteklib/ctekpack.c'\" \(2469 characters\) sed "s/^X//" >'Tek_device/cteklib/ctekpack.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/cteklib/ctekpack.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X/* X * Tek 4105 x,y coordinate packing. X * All x,y coordinates passed to the Tek are in this format: X * you need not be in Vector Mode or Marker Mode to use it. X * There are 12 significant bits per coordinate. X * If all coordinates are multiples of 4, no 'extra' byte X * will ever be sent. Previously-encoded positions are saved in X * ohiy, oloy, etc. in order to abbreviate the number of X * bytes sent out. This routine assumes pltout is open. X */ X#include <stdio.h> X#include "ctek.h" extern FILE *pltout; X ctekxypack (x, y) X{ int hiy, extra, loy, hix, lox; static int ohiy, oextra, oloy, ohix; X X /* X * Encode the new position. X */ X hiy = 0040 | ((y >> 7) & 037); X loy = 0140 | ((y >> 2) & 037); X hix = 0040 | ((x >> 7) & 037); X lox = 0100 | ((x >> 2) & 037); X extra = 0140 | ((y & 03) << 2) | (x & 03); X X /* X * Only print what's necessary, according to Tek rules. X */ X if (hiy != ohiy) X Putc (hiy); X if (extra != oextra) X Putc (extra); X if (loy != oloy || extra != oextra || hix != ohix) X Putc (loy); X if (hix != ohix) X Putc (hix); X Putc (lox); X X /* X * Remember these for next time. X */ X ohiy = hiy; X oextra = extra; X oloy = loy; X ohix = hix; X} X X/* X * Issue a packed integer. From one to three bytes sent. X */ tekipack (i) X{ int ihi, imd, ilo; X X if (i < 0) X { X i = -i; X ilo = 040; X } X else X ilo = 060; X X ihi = 0100 | ((i >> 10) & 037); X imd = 0100 | ((i >> 4) & 077); X ilo |= (i & 017); X X if (ihi != 0100) X Putc (ihi); X if (imd != 0100) X Putc (imd); X Putc (ilo); X} X pixpack (x, n) X int x[]; int n; X{ int shift; int ii; int s; X X shift = 6 / n; X s = 0; X for (ii = 0; ii < n; ii++) X { X s = (s << shift) | (x[ii] & 7); X } X s += 32; X Putc (s); X} END_OF_FILE if test 2469 -ne `wc -c <'Tek_device/cteklib/ctekpack.c'`; then echo shar: \"'Tek_device/cteklib/ctekpack.c'\" unpacked with wrong size! fi # end of 'Tek_device/cteklib/ctekpack.c' fi if test -f 'Tek_device/teklib/tekclose.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Tek_device/teklib/tekclose.c'\" else echo shar: Extracting \"'Tek_device/teklib/tekclose.c'\" \(2218 characters\) sed "s/^X//" >'Tek_device/teklib/tekclose.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/teklib/tekclose.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X/* X * Routine to close the device X */ X#include <stdio.h> X#include <strings.h> X#include "tek.h" X#include "../include/mesgcom.h" X#include "../include/closestat.h" X#include "../include/extern.h" X extern char wstype[]; X tekclose (status) X int status; X{ X switch (status) X { X case CLOSE_DONE: X if (!strncmp (wstype, "tek401", 6)) X message (MESG_READY); X setmode (ALPHA); X /* put terminal back into transparent mode */ X if (!strcmp (wstype, "graphon")) X fprintf (pltout, "\0332"); X else X if (!strcmp (wstype, "retrographics")) X fprintf (pltout, "\033\"0g"); X else X if (!strcmp (wstype, "selanar")) X { X fprintf (pltout, "\0332"); X fflush (pltout); X fprintf (pltout, "\033[>1t"); /* turn on text video */ X fflush (pltout); X } X else X if (!strcmp (wstype, "dscan")) X fprintf (pltout, "\033$"); X break; X case CLOSE_FLUSH: X fflush (pltout); X break; X case CLOSE_ERROR: X case CLOSE_NORMAL: X if (!strcmp (wstype, "retrographics")) X message (MESG_DONE); X else X message (MESG_HOME); X break; X case CLOSE_INTERRUPT: X if (!strncmp (wstype, "tek401", 6)) X { X message (MESG_READY); X message (MESG_TEXT, "\n\n\n"); X message (MESG_DONE); X message (MESG_HOME); X } X else X if ((!strcmp (wstype, "graphon")) || X (!strcmp (wstype, "selanar")) || X (!strcmp (wstype, "dscan"))) X { X fprintf (pltout, "\n\n\n"); X message (MESG_HOME); X } X else X if (!strcmp (wstype, "retrographics")) X message (MESG_DONE); X break; X case CLOSE_PAUSE: X case CLOSE_NOTHING: /* No input */ X default: /* not meant for us, ignore */ X break; X } X} END_OF_FILE if test 2218 -ne `wc -c <'Tek_device/teklib/tekclose.c'`; then echo shar: \"'Tek_device/teklib/tekclose.c'\" unpacked with wrong size! fi # end of 'Tek_device/teklib/tekclose.c' fi if test -f 'Virtual_device/vplib/vperase.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Virtual_device/vplib/vperase.c'\" else echo shar: Extracting \"'Virtual_device/vplib/vperase.c'\" \(2488 characters\) sed "s/^X//" >'Virtual_device/vplib/vperase.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/vplib/vperase.c X * X * Joe Dellinger (SEP), Dec 19 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X * Joe Dellinger Feb 25 1988 X * Put out a setstyle command after erases. X */ X X#include <stdio.h> X#include <vplot.h> X#include "../include/erasecom.h" X#include "../include/enum.h" X#include "../include/err.h" X#include "../include/extern.h" X#include "../include/round.h" X#include "vp.h" X static int framecount = -1; X vperase (command) X int command; X{ X if (vparray[0] == 0) X { X switch (command) X { X case ERASE_MIDDLE: X vp_erase (); X if (!vpdumb && vpstyle) X { X vp_style (ABSOLUTE); X } X lost = YES; X vpsetflag = NO; X break; X case ERASE_BREAK: X vp_break (); X if (!vpdumb && vpstyle) X { X vp_style (ABSOLUTE); X } X lost = YES; X vpsetflag = NO; X break; X default: X break; X } X } X else X { X switch (command) X { X case ERASE_START: X framecount = 0; X dev_ymin = STANDARD_HEIGHT * RPERIN; X case ERASE_MIDDLE: X if (framecount < 0) X ERR (FATAL, name, "Must have initial erase with gridnum"); X if ((framecount % vparray[0]) == 0) X { X dev_xmin = 0; X dev_ymin -= vpasize[1]; X } X else X { X dev_xmin += vpasize[0]; X } X dev_xmax = dev_xmin + vpasize[0]; X dev_ymax = dev_ymin + vpasize[1]; X X if (command == ERASE_MIDDLE) X vp_break (); X X lost = YES; X vpsetflag = NO; X reset_parameters (); X framecount++; X X if (vpframe >= 0) X { X vp_color (WHITE); X vp_fat (vpframe); X X vp_move ((float) dev_xmin / RPERIN, (float) dev_ymin / RPERIN); X vp_draw ((float) dev_xmax / RPERIN, (float) dev_ymin / RPERIN); X vp_draw ((float) dev_xmax / RPERIN, (float) dev_ymax / RPERIN); X vp_draw ((float) dev_xmin / RPERIN, (float) dev_ymax / RPERIN); X vp_draw ((float) dev_xmin / RPERIN, (float) dev_ymin / RPERIN); X X vp_color (vpcolor); X vp_fat (ROUND (vpfat * FATPERIN / RPERIN)); X } X break; X case ERASE_BREAK: X break; X default: X break; X } X } X} END_OF_FILE if test 2488 -ne `wc -c <'Virtual_device/vplib/vperase.c'`; then echo shar: \"'Virtual_device/vplib/vperase.c'\" unpacked with wrong size! fi # end of 'Virtual_device/vplib/vperase.c' fi if test -f 'Virtual_device/vplib/vptext.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Virtual_device/vplib/vptext.c'\" else echo shar: Extracting \"'Virtual_device/vplib/vptext.c'\" \(2050 characters\) sed "s/^X//" >'Virtual_device/vplib/vptext.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/vplib/vptext.c X * X * Joe Dellinger (SEP), Dec 19 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X * Joe Dellinger Jan 15 1988 X * Use the VP_GTEXT vplot command, instead of struggling trying X * to make do with the archaic VP_TEXT. X */ X X#include <stdio.h> X#include <math.h> X#include "../include/vplot.h" X#include "../include/extern.h" X#include "../include/enum.h" X#include "../include/params.h" X#include "../include/round.h" X#include "./vp.h" X extern int gentext (), nulldev (); X vptext (string, pathx, pathy, upx, upy) X char *string; X float pathx, pathy, upx, upy; X{ int (*savevector) (); int (*saveattributes) (); int (*savearea) (); X X vpsetflag = NO; X lost = YES; X X if (*string == '\0') X return; X X vp_gtext ((float) xold / RPERIN, (float) yold / RPERIN, X pathx / RPERIN, pathy / RPERIN, X upx / RPERIN, upy / RPERIN, X string); X X/* X * Now reset the pen position to the end of the text. X * Do a dummy run through (if this indeed a gentext font) X */ X if (txfont < NUMGENFONT) X { X savevector = dev.vector; X saveattributes = dev.attributes; X savearea = dev.area; X X/* X * Disconnect everything except error messages X */ X dev.vector = nulldev; X dev.attributes = nulldev; X dev.area = nulldev; X X gentext (string, pathx, pathy, upx, upy); X X dev.vector = savevector; X dev.attributes = saveattributes; X dev.area = savearea; X X/* X * Jon note that this shows you how to find the size of the text. X */ X vp_move ((float) xold / RPERIN, (float) yold / RPERIN); X } X} END_OF_FILE if test 2050 -ne `wc -c <'Virtual_device/vplib/vptext.c'`; then echo shar: \"'Virtual_device/vplib/vptext.c'\" unpacked with wrong size! fi # end of 'Virtual_device/vplib/vptext.c' fi if test -f 'Virtual_device/vplib/vpvector.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpvector.c'\" else echo shar: Extracting \"'Virtual_device/vplib/vpvector.c'\" \(2482 characters\) sed "s/^X//" >'Virtual_device/vplib/vpvector.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/vplib/vpvector.c X * X * Joe Dellinger (SEP), Dec 19 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <stdio.h> X#include <vplot.h> X#include "../include/extern.h" X#include "../include/enum.h" X#include "../include/attrcom.h" X#include "../include/round.h" X#include "vp.h" X#define MOVE 0 X#define DRAW 1 X extern int lost; X vpvector (x1, y1, x2, y2, nfat, vpdashon) X int x1, y1, x2, y2; X int nfat, vpdashon; X{ static int xlst, ylst; int d1, d2; X X if (nfat < 0) X return; X X /* X * Important special case: Zero-length vector at the end of what you've X * already plotted. Don't need to do anything. X */ X if (x1 == x2 && y1 == y2 && !lost && x1 == xlst && y1 == ylst) X { X return; X } X X/* X * As stated in the documentation, dev.vector must be X * ready to accept changes in fatness and linestyle without X * warning at any time. X */ X X if (nfat != fat) X { X vp_fat (ROUND ((float) nfat * FATPERIN / RPERIN)); X lost = YES; X } X X if (vpdashon != dashon) X { X dev.attributes (NEW_DASH, vpdashon, 0, 0, 0); X } X X /* X * Minimize movement of "pen" Don't turn around dashed lines, since order X * of drawing matters. X */ X if (!lost && !vpdashon) X { X d1 = abs (x1 - xlst) + abs (y1 - ylst); X d2 = abs (x2 - xlst) + abs (y2 - ylst); X if (d2 < d1) X { X d1 = x1; X d2 = y1; X x1 = x2; X y1 = y2; X x2 = d1; X y2 = d2; X } X } X X if ((x1 != xlst) || (y1 != ylst) || lost) X { X /* Make sure it is a move, not a draw */ X dev.plot (x1, y1, MOVE); X } X dev.plot (x2, y2, DRAW); X xlst = x2; X ylst = y2; X X/* X * Restore fat and dash stuff if we changed it. X */ X if (nfat != fat) X { X vp_fat (ROUND ((float) fat * FATPERIN / RPERIN)); X lost = YES; X } X X if (vpdashon != dashon) X { X dev.attributes (NEW_DASH, dashon, 0, 0, 0); X } X/* X * Above can be inefficient, but that's a rare case and it's hard X * to get around. (Very hard.) This works! X */ X} END_OF_FILE if test 2482 -ne `wc -c <'Virtual_device/vplib/vpvector.c'`; then echo shar: \"'Virtual_device/vplib/vpvector.c'\" unpacked with wrong size! fi # end of 'Virtual_device/vplib/vpvector.c' fi if test -f 'Vplot_Kernel/Hershey/make_vplot.csh' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/Hershey/make_vplot.csh'\" else echo shar: Extracting \"'Vplot_Kernel/Hershey/make_vplot.csh'\" \(2079 characters\) sed "s/^X//" >'Vplot_Kernel/Hershey/make_vplot.csh' <<'END_OF_FILE' X# X# Here is the csh to use to assemble the Hershey font data into reasonable, X# useable fonts for use with Vplot. The lines_normal_* files contain the X# information such as base height and ligatures that hertovplot.c mentions X# needs to be edited in "by hand". (Note all the ligatures for the Russian X# font! This follows the standard method for transliterating Cyrillic into X# the roman alphabet.) X# X# It's up to you to get the required .oc files from the X# Hershey font distribution. X# I'm not going to redistribute the fonts again! X# X# I do, however, give you .hmp files. Mine are somewhat modified X# from the ones that come with the original Hershey font distribution. X# Mine correct mistakes in and improve on the original ones. X# X# Joe Dellinger X# joe@hanauma.stanford.edu X# cat hersh.oc1 hersh.oc2 hersh.oc3 hersh.oc4 > HERSH cc -o hertovplot hertovplot.c X X# Normal Size fonts X# Beware! Roman triplex font has an error in character "J"! X# (Width information has a sign error.) X# You have to fix this by hand before installing it! X# I've commented that file out for now. foreach file ( gothgbt.hmp gothgrt.hmp gothitt.hmp greekc.hmp greeks.hmp italict.hmp romand.hmp romans.hmp ) #romant.hmp echo $file hertovplot $file < HERSH > temp cat lines_normal temp > $file:r.vplot_font rm -f temp end foreach file ( italicc.hmp romanc.hmp ) echo $file hertovplot $file < HERSH > temp cat lines_normal+rolig temp > $file:r.vplot_font rm -f temp end foreach file ( cyrilc.hmp ) echo $file hertovplot $file < HERSH > temp cat lines_normal+cylig temp > $file:r.vplot_font rm -f temp end X X# Script Normal (No spaces between characters) foreach file ( scriptc.hmp scripts.hmp ) echo $file hertovplot $file < HERSH > temp cat lines_normal_script temp > $file:r.vplot_font rm -f temp end X X# Misc Normal foreach file ( math.hmp misc.hmp ) echo $file hertovplot $file < HERSH > temp cat lines_normal_misc temp > $file:r.vplot_font rm -f temp end X rm -f HERSH hertovplot X# Now copy all the newly generated vplot_fonts to the vplotfont directory. mv *.vplot_font ../filters/include/vplotfonts END_OF_FILE if test 2079 -ne `wc -c <'Vplot_Kernel/Hershey/make_vplot.csh'`; then echo shar: \"'Vplot_Kernel/Hershey/make_vplot.csh'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/Hershey/make_vplot.csh' fi if test -f 'Vplot_Kernel/filters/MakeMake' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/MakeMake'\" else echo shar: Extracting \"'Vplot_Kernel/filters/MakeMake'\" \(2183 characters\) sed "s/^X//" >'Vplot_Kernel/filters/MakeMake' <<'END_OF_FILE' X#! /bin/csh -f X# X# If you don't have seplib, remove "MakeMakesep" before executing this shell! X# X rm -f Makefile Makesep X /bin/cat << END1A >! Makefile X# X# Site-specific definitions are confined to makefiles and include files. X# X# The file "machdep" contains all machine dependent parameters for makefiles. X# MakeMake itself is machine independent! X# END1A X/bin/cat < machdep >> Makefile X /bin/cat << END1B >> Makefile X# X# END1B X X set hosttype = `cat hosttype` X echo $hosttype X set ALL=() X foreach dir (*lib) X echo Doing $dir X switch ($dir) X case loclib: X case genlib: X case utillib: X breaksw X case imaglib: X set ALL=($ALL ipen) X breaksw X case rteklib: X set ALL=($ALL rpen) X breaksw X case spenlib: X set ALL=($ALL spen) X breaksw X case xpenlib: X set ALL=($ALL xpen) X breaksw X default: X set thispen = `echo $dir | sed -e 's/lib/pen/'` X set ALL = ($ALL $thispen) X breaksw X endsw X end X echo "all: $ALL" >> Makefile X echo "" >> Makefile X echo "install: all" >> Makefile X X if (-e machdep_restrict) then X set machdepres = machdep_restrict X else X set machdepres = /dev/null X endif X X foreach file ($ALL) X if (`grep -c $file $machdepres` > 0) then X set group = `grep $file $machdepres | sed -e 's/^[^ ]*[ ]*//'` X echo -n ' install -c -s -o $(OWNER) -g '$group' -m 0770 ' >> Makefile X else X echo -n ' install -c -s -o $(OWNER) -g $(GROUP) -m 0775 ' >> Makefile X endif X X echo $file '$(BIN)'$file >> Makefile X end X X if (-e MakeMakesep) then X echo " make -f Makesep install" >> Makefile X endif X X /bin/cat << 'END2' >> Makefile X X.c.o:; cc -c $(CFLAGS) $*.c X X$(LOCLIB): loclib/*.c X cd loclib; make "CFLAGS=${CFLAGS}" loclib.a X X$(GENLIB): genlib/*.c X cd genlib; make "CFLAGS=${CFLAGS}" X X$(UTILLIB): utilities/*.c X cd utilities; make "CFLAGS=${CFLAGS}" X clean: X'END2' echo " rm -f *.o $ALL" >> Makefile if (-e MakeMakesep) then X echo " make -f Makesep clean" >> Makefile endif echo " " >> Makefile X X foreach dir (*lib) X switch ($dir) X case utillib: X case loclib: X case genlib: X breaksw X default: X cat $dir/*makef >> Makefile X breaksw X endsw X end X if (-e MakeMakesep) then X source MakeMakesep endif END_OF_FILE if test 2183 -ne `wc -c <'Vplot_Kernel/filters/MakeMake'`; then echo shar: \"'Vplot_Kernel/filters/MakeMake'\" unpacked with wrong size! fi chmod +x 'Vplot_Kernel/filters/MakeMake' # end of 'Vplot_Kernel/filters/MakeMake' fi if test -f 'Vplot_Kernel/filters/MakeMakesep' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/MakeMakesep'\" else echo shar: Extracting \"'Vplot_Kernel/filters/MakeMakesep'\" \(2230 characters\) sed "s/^X//" >'Vplot_Kernel/filters/MakeMakesep' <<'END_OF_FILE' X#! /bin/csh -f X /bin/cat << END1A >! Makesep X# X# Site-specific definitions are confined to makefiles and include files. X# For makefiles the file machdepsep contains all machine-dependent parameters. X# MakeMakesep itself is machine independent! X# END1A X/bin/cat < machdepsep >> Makesep X /bin/cat << END1B >> Makesep X# X# END1B X X set hosttype = `cat hosttype` X echo $hosttype X set ALL=() X foreach dir (*lib) X echo Doing $dir X switch ($dir) X case loclib: X case genlib: X case utillib: X breaksw X case imaglib: X set ALL=($ALL Ipen) X breaksw X case rteklib: X set ALL=($ALL Rpen) X breaksw X case spenlib: X set ALL=($ALL Spen) X breaksw X case xpenlib: X set ALL=($ALL Xpen) X breaksw X default: X set thispen = `echo $dir | sed -e 's/lib/pen/'` X set thispenf = `echo $thispen | sed -e 's/^\(.\)\(.*\)$/\1/' | tr a-z A-Z` X set thispenb = `echo $thispen | sed -e 's/^\(.\)\(.*\)$/\2/'` X set ALL = ($ALL $thispenf$thispenb) X breaksw X endsw X end X echo "all: $ALL" >> Makesep X echo "" >> Makesep X echo "install: all" >> Makesep X X if (-e machdep_restrict) then X set machdepres = machdep_restrict X else X set machdepres = /dev/null X endif X X foreach file ($ALL) X if (`grep -c $file $machdepres` > 0) then X set group = `grep $file $machdepres | sed -e 's/^[^ ]*[ ]*//'` X echo -n ' install -c -s -o $(OWNER) -g '$group' -m 0770 ' >> Makesep X else X echo -n ' install -c -s -o $(OWNER) -g $(GROUP) -m 0775 ' >> Makesep X endif X X echo $file '$(BIN)'$file >> Makesep X end X X /bin/cat << 'END2' >> Makesep X X.c.o:; cc -c $(CFLAGS) $*.c X X$(TSEPLIB): loclib/*.c X cd loclib; make "CFLAGS=${CFLAGS}" tseplib.a X X$(GENLIB): genlib/*.c X cd genlib; make "CFLAGS=${CFLAGS}" X X$(UTILLIB): utilities/*.c X cd utilities; make "CFLAGS=${CFLAGS}" X Main_vplot.o: main_vplot.c X cp main_vplot.c Main_vplot.c X cc -c $(CFLAGS) Main_vplot.c X rm Main_vplot.c X Init_vplot.o: init_vplot.c X cp init_vplot.c Init_vplot.c X cc -c $(CFLAGS) Init_vplot.c X rm Init_vplot.c X clean: X'END2' echo " rm -f *.o $ALL" >> Makesep echo " " >> Makesep X X foreach dir (*lib) X switch ($dir) X case utillib: X case loclib: X case genlib: X breaksw X default: X cat $dir/*Makef >> Makesep X breaksw X endsw X end END_OF_FILE if test 2230 -ne `wc -c <'Vplot_Kernel/filters/MakeMakesep'`; then echo shar: \"'Vplot_Kernel/filters/MakeMakesep'\" unpacked with wrong size! fi chmod +x 'Vplot_Kernel/filters/MakeMakesep' # end of 'Vplot_Kernel/filters/MakeMakesep' fi if test -f 'Vplot_Kernel/filters/Tests/README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/README'\" else echo shar: Extracting \"'Vplot_Kernel/filters/Tests/README'\" \(2087 characters\) sed "s/^X//" >'Vplot_Kernel/filters/Tests/README' <<'END_OF_FILE' This directory contains a test suite and some examples. X All of the files beginning with a capital letter are meant to be run through plas with the -v option, ie: plas -v < TEST_align | ?pen scale=? X Demo files are meant to show what sort of nice pictures you can make with vplot. The "demo" files (note lowercase) are meant to be read directly, ie: X?pen demo_pacific.v The lower-case demo files will not be included in some versions of the distribution. (If size is of importance.) You can try out several of the demo files at once by: X?pen par=parfile X Each of the files beginning "TEST" is meant to test something. It should be pretty obvious if something is wrong. Some of them will print out text on your screen pointing out what to look for. X(If none of them do, then you've got a problem with your dev.message routine.) The csh "All_tests" will run through all the tests, one by one. The argument to All_tests is the name of the vplot filter you want to use. X Programs: X The program Font.c produces pldb-format files which display the contents of a font. For each glyph in a font the corresponding glyph in font 0 is shown (small), along with the glyph's index. A ``?'' in a box is a special error symbol which indicates that the desired glyph is not defined. This error glyph is glyph number 30 in font 0. X The program rastest.c must be linked with -lvplot, and the output of it can be piped into any pen filter. It produces an interesting color raster moire pattern (it may take a while to come out if you're using genraster). This program also serves as an example of how to use vplotlib from a C program. X Other example C and FORTRAN programs are: X ellips.f, libvplot_example.c, polytest.c X You'll have to edit the makefile to call the appropriate pen filter. X X The programs here are bad examples in that they implicitly use hardwired magic numbers, without basing them off of the defined values in vplot.h. The metafiles in this directory are also in raw integer Vplot units, not inches or centimeters. These, however, are easy to convert using plas (if needed) and pldb -i. END_OF_FILE if test 2087 -ne `wc -c <'Vplot_Kernel/filters/Tests/README'`; then echo shar: \"'Vplot_Kernel/filters/Tests/README'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/filters/Tests/README' fi if test -f 'Vplot_Kernel/filters/Tests/rastest.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/rastest.c'\" else echo shar: Extracting \"'Vplot_Kernel/filters/Tests/rastest.c'\" \(2440 characters\) sed "s/^X//" >'Vplot_Kernel/filters/Tests/rastest.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/Tests/rastest.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <stdio.h> X#include <vplot.h> X X#define X 200 X#define Y 200 X main () X{ int offset, xpix, ypix, bit, blast; float xll, yll, xur, yur, ppi; unsigned char array[X * Y]; int ii, jj; X X/* X * Create a moire pattern X */ X for (ii = 0; ii < Y; ii++) X { X for (jj = 0; jj < X; jj++) X { X array[X * ii + jj] = ((((ii - 105) * (ii - 95) + (jj - 110) * (jj - 90)) / 77) % 14) + 1; X if (array[X * ii + jj] > 0) X { X if (array[X * ii + jj] % 2 == 1) X array[X * ii + jj] = 0; X array[X * ii + jj] /= 2; X } X else X { X if (array[X * ii + jj] % 2 == -1) X array[X * ii + jj] = 0; X array[X * ii + jj] /= -13; X } X } X } X X offset = 0; X xpix = X; X ypix = Y; X bit = 0; X xll = 0.; X yll = 0.; X xur = 10.; X yur = 10.; X ppi = 0; X blast = 0; X X/* X * Set up where you want the vplot output to go. X */ X vp_filep (stdout); X X/* X * Decide what "style" plot this is to be. X */ X vp_style (STANDARD); X X/* X * Draw the raster. X */ X vp_raster (array, blast, bit, offset, xpix, ypix, xll, yll, ppi, &xur, &yur, 0, 1); X X/* X * Draw a thin blue border around the whole thing. X */ X vp_fat (0); X vp_color (BLUE); X X/* X * (xll,yll) is the lower-leftmost pixel of the raster plot, X * and (xur-xll) is the width in vplot units and (yur-yll) is the X * height. X * If you think about this carefully, you'll see that then (xur,yur) X * is not quite the upper-rightmost pixel of the raster plot, but is X * one off. X * Things were done this way because the height and width are X * the real parameters that you want to specify. X * Unfortunately it also means that the border isn't exactly symmetrical. X */ X vp_move (xll, yll); X vp_draw (xll, yur); X vp_draw (xur, yur); X vp_draw (xur, yll); X vp_draw (xll, yll); X X/* X * Finish up X */ X vp_endplot (); X} END_OF_FILE if test 2440 -ne `wc -c <'Vplot_Kernel/filters/Tests/rastest.c'`; then echo shar: \"'Vplot_Kernel/filters/Tests/rastest.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/filters/Tests/rastest.c' fi if test -f 'Vplot_Kernel/filters/distribute_to' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/distribute_to'\" else echo shar: Extracting \"'Vplot_Kernel/filters/distribute_to'\" \(2384 characters\) sed "s/^X//" >'Vplot_Kernel/filters/distribute_to' <<'END_OF_FILE' X #!/bin/sh X # X # Distribute Vplot to other machines X # Writes a series of calls to rcp. Does not create any directories; X # they must already exist. X # X # Usage: X # distribute_to machine_name X # X # This will produce a file called "Copy_to_machine_name", which you can X # sh to do the actual copying. X # X # You should have a subdirectory in ./machines for each machine name. X # There must exist two files in this directory, called "dirlist" X # and "path". In the file "dirlist" there should be a list of the X # device libraries to put on that machine, one name per line. X # In the file "path" the path to the filters directory on the X # destination machine should be given. (The output of "pwd" on X # that machine if you were in the filters directory.) X # The modification times of the `date' files keeps track of which files X # are out of date on which machines. X # X # This file will not copy machine-dependent files: "params.h", X # "machdep*", "*.a", "*.o", "*.bin". Params.h and machdep* must X # be copied and appropriately modified as needed by hand. X # X # Author - Chuck Karish X # Debugged by Joe Dellinger 12-17-87 X # X if [ $# -ne 1 ] then X echo "distribute_to: Wrong number of arguments." 1>&2 X echo "Usage: distribute_to machine_name; sh Copy_to_machine_name" 1>&2 X exit 1 fi X X if [ ! -r "./machines/$1/dirlist" ] X then X echo "Must have a dirlist file" X exit 1 X fi X X if [ ! -r "./machines/$1/path" ] X then X echo "Must have a path file" X exit 1 X fi X GENDIRS="genlib include loclib utilities vplib Tests" DEVDIRS=`cat ./machines/$1/dirlist | tr '\015' ' '` DEVPATH=`cat ./machines/$1/path | tr '\015' ' '` X rm -f /tmp/Vplot_dist_$$ X for direct in *.c MakeMake* $GENDIRS $DEVDIRS do X X if [ -r $direct ] X then X other="" X else X other="otherpens/" X fi X X if [ -r "./machines/$1/date" ] X then X find $other$direct -type f -newer ./machines/$1/date -print | \ X egrep -v "(\\.a\$|\\.o\$|\\.bin|\\.include|params\\.h\$)" >> \ X /tmp/Vplot_dist_$$ X else X find $other$direct -type f -print | \ X egrep -v "(\\.a\$|\\.o\$|\\.bin|\\.include|params\\.h\$)" >> \ X /tmp/Vplot_dist_$$ X fi done X sed < /tmp/Vplot_dist_$$ -e 's+^\(.*\)$+rcp '`pwd`'/\1 '$1':'$DEVPATH'/\1+' \ X| sed -e 's+^\(.*\)\(/otherpens\)\(.*\)\(/otherpens\)\(.*\)$+\1\2\3\5+' \ X> Copy_to_$1 rm -f /tmp/Vplot_dist_$$ echo 'touch -f '`pwd`'/machines/'$1'/date' >> Copy_to_$1 echo "#rm -f Copy_to_$1" >> Copy_to_$1 END_OF_FILE if test 2384 -ne `wc -c <'Vplot_Kernel/filters/distribute_to'`; then echo shar: \"'Vplot_Kernel/filters/distribute_to'\" unpacked with wrong size! fi chmod +x 'Vplot_Kernel/filters/distribute_to' # end of 'Vplot_Kernel/filters/distribute_to' fi if test -f 'Vplot_Kernel/filters/genlib/genraster.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genraster.c'\" else echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genraster.c'\" \(2360 characters\) sed "s/^X//" >'Vplot_Kernel/filters/genlib/genraster.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/genlib/genraster.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X * Joe Dellinger Feb 16 1988 X * Make number of arguments consistent between smart and dumb forms X * of dev.raster. X */ X X#include <stdio.h> X#include "../include/extern.h" X#include "../include/enum.h" X#include "../include/attrcom.h" X extern int overlay, cur_color, need_devcolor; X genraster (count, out_of, xpos, ypos, length, orient, raster, dummy1, dummy2) X int count, out_of, xpos, ypos, length, orient, dummy1, dummy2; X unsigned char *raster; X{ int ii, sign, xy, xrpos, yrpos; int color, start; static int cur_color_save; X X switch (orient) X { X case 0: X xrpos = xpos; X yrpos = ypos; X sign = 1; X xy = 0; X break; X case 1: X xrpos = ypos; X yrpos = xpos; X sign = -1; X xy = 1; X break; X case 2: X xrpos = xpos; X yrpos = ypos; X sign = -1; X xy = 0; X break; X case 3: X xrpos = ypos; X yrpos = xpos; X sign = 1; X xy = 1; X break; X } X X start = xrpos; X color = raster[0]; X X if (count == 0) X { X /* X * First time remember the color so we can restore it the last time. X */ X cur_color_save = cur_color; X } X X for (ii = 0; ii <= length; ii++) X { X if (ii == length || raster[ii] != color) X { X if (!((overlay == 1) && (color == 0))) X { X if (cur_color != color || need_devcolor) X { X cur_color = color; X dev.attributes (SET_COLOR, cur_color, 0, 0, 0); X need_devcolor = NO; X } X if (xy) X dev.vector (yrpos, start, yrpos, xrpos + sign * (ii - 1), 0, 0); X else X dev.vector (start, yrpos, xrpos + sign * (ii - 1), yrpos, 0, 0); X } X if (ii != length) X { X color = raster[ii]; X start = xrpos + sign * ii; X } X } X } X X if (count == out_of - 1 && cur_color != cur_color_save) X { X cur_color = cur_color_save; X need_devcolor = YES; X } X} END_OF_FILE if test 2360 -ne `wc -c <'Vplot_Kernel/filters/genlib/genraster.c'`; then echo shar: \"'Vplot_Kernel/filters/genlib/genraster.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/filters/genlib/genraster.c' fi if test -f 'Vplot_Kernel/filters/genlib/genvector.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genvector.c'\" else echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genvector.c'\" \(2430 characters\) sed "s/^X//" >'Vplot_Kernel/filters/genlib/genvector.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./filters/genlib/genvector.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X/* X * Generic vector routine for devices that don't support fatness. X * This version tries to be smart and minimize the "motion of the pen", X * and tries to prolong strings of "draws" where possible. X */ X#include <stdio.h> X#include "../include/extern.h" X#define MOVE 0 X#define DRAW 1 X extern int smart_clip; extern int lost; extern int fatvec (); X genvector (x1, y1, x2, y2, nfat, dashon) X int x1, y1, x2, y2; X int nfat, dashon; X{ static int xlst, ylst; int d1, d2; X X if (nfat < 0) X return; X X if (dashon) X { X dashvec (x1, y1, x2, y2, nfat, dashon); X return; X } X X if (nfat) /* Recursively calls itself to make fat lines */ X { X fatvec (x1, y1, x2, y2, nfat, dashon); X return; X } X X /* X * Do clipping X */ X if (!smart_clip) X if (clip (&x1, &y1, &x2, &y2)) X return; X /* X * Important special case: Zero-length vector at the end of what you've X * already plotted. Don't need to do anything. X */ X if (x1 == x2 && y1 == y2 && !lost && x1 == xlst && y1 == ylst) X { X return; X } X X /* X * Minimize movement of "pen" X */ X if (!lost) X { X d1 = abs (x1 - xlst) + abs (y1 - ylst); X d2 = abs (x2 - xlst) + abs (y2 - ylst); X if (d2 < d1) X { X d1 = x1; X d2 = y1; X x1 = x2; X y1 = y2; X x2 = d1; X y2 = d2; X } X } X X if ((x1 != xlst) || (y1 != ylst) || lost) X { X /* Make sure it is a move, not a draw */ X if (!lost && abs (x1 - xlst) <= 1 && abs (y1 - ylst) <= 1) X { X /* X * We're within one pixel, so go ahead and draw a vector to the X * new point. This avoids having to leave and re-enter vector X * mode. X */ X dev.plot (x1, y1, DRAW); X } X else X { X dev.plot (x1, y1, MOVE); X } X } X dev.plot (x2, y2, DRAW); X xlst = x2; X ylst = y2; X} END_OF_FILE if test 2430 -ne `wc -c <'Vplot_Kernel/filters/genlib/genvector.c'`; then echo shar: \"'Vplot_Kernel/filters/genlib/genvector.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/filters/genlib/genvector.c' fi if test -f 'Vplot_Kernel/filters/include/params.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/params.h'\" else echo shar: Extracting \"'Vplot_Kernel/filters/include/params.h'\" \(2043 characters\) sed "s/^X//" >'Vplot_Kernel/filters/include/params.h' <<'END_OF_FILE' X/* X * All machine dependencies should go in here! X */ X#define STYLE STANDARD X#define IPEN_SPOOL "/scr/tmp" X#define LPR_SPOOL "/scr/tmp" X#define PSPEN_SPOOL "/scr/tmp" X#define LASER1_SPOOL "/scr/tmp" X#define LASER2_SPOOL "/scr/tmp" X X/* The path in the next line must end with a slash ('/'). */ X#define SYSTEM_FONT_DIRECTORY "/usr/src/graphics/vplot/filters/include/vplotfonts/" X X#define DEFAULT_COLOR 7 X#define DEFAULT_LINESTYLE 0 X#define DEFAULT_FONT 0 X#define DEFAULT_HARDCOPY_FONT 3 X#define DEFAULT_PREC 0 X#define DEFAULT_HARDCOPY_PREC 2 X X/* X * Ratio of fatness to size for symbols X * (ie, how fat will a 1 inch tall symbol's strokes be, in inches?) X */ X#define SYMBFATRATIO .05 X X/* X * These two get re-allocated larger as needed automatically in dovplot.c, X * but it's a good idea to start out large enough that that doesn't have X * to be done very often X */ X#define TXBUFLEN 250 /* Initial max length of a text string */ X#define VXBUFLEN 250 /* Initial max number of vertices in a polygon */ X X/* X * This is the factor we scale our path and up vectors by before X * running them through the local text coordinate transformation. X * (The coordinate transformation, being in terms of device units, X * gets done in integers. If we don't scale up we get severe roundoff X * problems for small text sizes at odd angles. We can't make this X * factor too big, though, or we risk very large text overflowing X * the maximum possible integer.) X */ X#define TEXTVECSCALE 10. X X#define FONTCHECK -1987 /* Magic number that identifies font files */ X#define NHATCH 20 /* Maximum number of lines in a hatch pattern */ X#define MAX_COL 511 /* Maximum color table number, maximum color number */ X#define NPAT 512 /* Maximum internal pattern number, MAX_COL + 1 */ X#define MAXDASH 10 /* Maximum number of dot-dashes */ X#define MAX_GUN 255 /* Maximum color gun strength */ X#define NUMGENFONT 100 /* Number of fonts reserved for gentext fonts */ X#define MAXIN 20 /* Maximum number of input plot files */ X#define MAXFLEN 120 /* Maximum length of a file name */ END_OF_FILE if test 2043 -ne `wc -c <'Vplot_Kernel/filters/include/params.h'`; then echo shar: \"'Vplot_Kernel/filters/include/params.h'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/filters/include/params.h' fi if test -f 'Vplot_Kernel/lvplot/vp_arrow.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_arrow.c'\" else echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_arrow.c'\" \(2273 characters\) sed "s/^X//" >'Vplot_Kernel/lvplot/vp_arrow.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./lvplot/vp_arrow.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X */ X X#include <vplot.h> X#include <math.h> X#define pio4 0.785398 X X#ifdef FORTRAN X X#ifndef UUU X#define ARROW vparrow_ X#else UUU X#define ARROW vpuarrow_ X#endif UUU X#define X0 *x0 X#define Y0 *y0 X#define X *x X#define Y *y X#define R *r X X#else X X#ifndef UUU X#define ARROW vp_arrow X#else UUU X#define ARROW vp_uarrow X#endif UUU X#define X0 x0 X#define Y0 y0 X#define X x X#define Y y X#define R r X X#endif X ARROW (x0, y0, x, y, r) X/* X * plot an arrow from (x0,y0) to (x,y) with arrow-size r X */ X float X0, Y0, X, Y, R; X{ float beta, alpha, xp[4], yp[4], rr; int flag = 0; X X if (R < 0.) X { X rr = -(R); X flag = 1; X } X else X rr = R; X X if (X == X0 && Y == Y0) X { X xp[0] = X - rr / 3.; X yp[0] = Y - rr / 3.; X xp[1] = X - rr / 3.; X yp[1] = Y + rr / 3.; X xp[2] = X + rr / 3.; X yp[2] = Y + rr / 3.; X xp[3] = X + rr / 3.; X yp[3] = Y - rr / 3.; X if (flag) X#ifndef UUU X vp_area (xp, yp, 4, 0, 0, 0); X#else UUU X vp_uarea (xp, yp, 4, 0, 0, 0); X#endif UUU X else X#ifndef UUU X vp_area (xp, yp, 4, 0, 1, 1); X#else UUU X vp_uarea (xp, yp, 4, 0, 1, 1); X#endif UUU X } X else X { X#ifndef UUU X vp_move (X0, Y0); X vp_draw (X, Y); X#else UUU X vp_umove (X0, Y0); X vp_udraw (X, Y); X#endif UUU X X beta = atan2 (Y - Y0, X - X0); X X xp[0] = X; X yp[0] = Y; X alpha = pio4 + beta; X xp[1] = X - rr * cos (alpha); X yp[1] = Y - rr * sin (alpha); X alpha = pio4 - beta; X xp[2] = X - rr * cos (alpha); X yp[2] = Y + rr * sin (alpha); X if (flag) X#ifndef UUU X vp_area (xp, yp, 3, 0, 0, 0); X#else UUU X vp_uarea (xp, yp, 3, 0, 0, 0); X#endif UUU X else X#ifndef UUU X vp_area (xp, yp, 3, 0, 1, 1); X#else UUU X vp_uarea (xp, yp, 3, 0, 1, 1); X#endif UUU X } X} END_OF_FILE if test 2273 -ne `wc -c <'Vplot_Kernel/lvplot/vp_arrow.c'`; then echo shar: \"'Vplot_Kernel/lvplot/vp_arrow.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/lvplot/vp_arrow.c' fi if test -f 'Vplot_Kernel/lvplot/vp_gtext.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_gtext.c'\" else echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_gtext.c'\" \(2090 characters\) sed "s/^X//" >'Vplot_Kernel/lvplot/vp_gtext.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./lvplot/vp_gtext.c X * X * Joe Dellinger (SEP), Jan 14 1988 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X * X */ X X#include <stdio.h> X#include <vplot.h> X#include "params.h" X#include "round.h" X#include "vp_pc.h" X X#ifdef FORTRAN X X#define TEXT vpwgtext_ X#define X *x X#define Y *y X#define XPATH *xpath X#define YPATH *ypath X#define XUP *xup X#define YUP *yup X X#else X X#define TEXT vp_gtext X#define X x X#define Y y X#define XPATH xpath X#define YPATH ypath X#define XUP xup X#define YUP yup X X#endif X X#ifdef FORTRAN TEXT (x, y, xpath, ypath, xup, yup, string, nchars) X#else TEXT (x, y, xpath, ypath, xup, yup, string) X#endif X float X, Y; X float XPATH, YPATH; X float XUP, YUP; X char *string; X#ifdef FORTRAN X int *nchars; X#endif X{ X#ifdef FORTRAN int i, length; X#endif X X p_pout (X, Y, 0, vp_pc._pltout); X putc (VP_GTEXT, vp_pc._pltout); X puth (ROUND (TEXTVECSCALE * XPATH * RPERIN), vp_pc._pltout); X puth (ROUND (TEXTVECSCALE * YPATH * RPERIN), vp_pc._pltout); X puth (ROUND (TEXTVECSCALE * XUP * RPERIN), vp_pc._pltout); X puth (ROUND (TEXTVECSCALE * YUP * RPERIN), vp_pc._pltout); X X#ifdef FORTRAN X/* X * Try to still work even if they didn't specify nchars. X */ X length = 80; X if (nchars != NULL) X { X if (*nchars >= 0) X length = *nchars; X } X X for (i = 0; i < length; i++) X { X if (*(string + i) == '\0') X break; X putc (*(string + i), vp_pc._pltout); X } X putc ('\0', vp_pc._pltout); X#else FORTRAN X do X { X putc (*string, vp_pc._pltout); X } X while (*string++); X#endif FORTRAN X} END_OF_FILE if test 2090 -ne `wc -c <'Vplot_Kernel/lvplot/vp_gtext.c'`; then echo shar: \"'Vplot_Kernel/lvplot/vp_gtext.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/lvplot/vp_gtext.c' fi if test -f 'Vplot_Kernel/lvplot/vp_text.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_text.c'\" else echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_text.c'\" \(2050 characters\) sed "s/^X//" >'Vplot_Kernel/lvplot/vp_text.c' <<'END_OF_FILE' X/* X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior X * University. Official permission to use this software is included in X * the documentation. It authorizes you to use this file for any X * non-commercial purpose, provided that this copyright notice is not X * removed and that any modifications made to this file are commented X * and dated in the style of my example below. X */ X X/* X * X * source file: ./lvplot/vp_text.c X * X * Joe Dellinger (SEP), June 11 1987 X * Inserted this sample edit history entry. X * Please log any further modifications made to this file: X * X * Joe Dellinger Oct 17 1987 X * Made Fortran and C calling arguments match. X * X * Joe Dellinger Dec 7 1987 X * Transferred handling of the text justification and font X * to the routines where you'd expect that to get handled, X * instead of only updating that when this routine is called. X */ X X#include <stdio.h> X#include <vplot.h> X#include "vp_pc.h" X X#ifdef FORTRAN X X#define TEXT vpwtext_ X#define X *x X#define Y *y X#define SIZE *size X#define ORIENT *orient X X#else X X#define TEXT vp_text X#define X x X#define Y y X#define SIZE size X#define ORIENT orient X X#endif X X#ifdef FORTRAN TEXT (x, y, size, orient, string, nchars) X#else TEXT (x, y, size, orient, string) X#endif X float X, Y; X int SIZE, ORIENT; X char *string; X#ifdef FORTRAN X int *nchars; X#endif X{ X#ifdef FORTRAN int i, length; X#endif X X if (SIZE == 0) X return; X X p_pout (X, Y, 0, vp_pc._pltout); X putc (VP_TEXT, vp_pc._pltout); X puth (SIZE, vp_pc._pltout); X puth (ORIENT, vp_pc._pltout); X X#ifdef FORTRAN X/* X * Try to still work even if they didn't specify nchars. X */ X length = 80; X if (nchars != NULL) X { X if (*nchars >= 0) X length = *nchars; X } X X for (i = 0; i < length; i++) X { X if (*(string + i) == '\0') X break; X putc (*(string + i), vp_pc._pltout); X } X putc ('\0', vp_pc._pltout); X#else FORTRAN X do X { X putc (*string, vp_pc._pltout); X } X while (*string++); X#endif FORTRAN X} END_OF_FILE if test 2050 -ne `wc -c <'Vplot_Kernel/lvplot/vp_text.c'`; then echo shar: \"'Vplot_Kernel/lvplot/vp_text.c'\" unpacked with wrong size! fi # end of 'Vplot_Kernel/lvplot/vp_text.c' fi echo shar: End of archive 9 \(of 24\). cp /dev/null ark9isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 24 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0