home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / vplot / part09 < prev    next >
Encoding:
Internet Message Format  |  1988-03-28  |  57.3 KB

  1. Subject:  v14i014:  Device-independant graphics system, with drivers, Part09/24
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5. From: rsalz@uunet.uu.net
  6.  
  7. Submitted-by: Joe Dellinger <joe@hanauma.STANFORD.EDU>
  8. Posting-number: Volume 14, Issue 14
  9. Archive-name: vplot/part09
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 9 (of 24)."
  18. # Wrapped by rsalz@fig.bbn.com on Fri Mar 25 11:47:07 1988
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'Envision_device/envilib/enviattr.c' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'Envision_device/envilib/enviattr.c'\"
  22. else
  23. echo shar: Extracting \"'Envision_device/envilib/enviattr.c'\" \(2314 characters\)
  24. sed "s/^X//" >'Envision_device/envilib/enviattr.c' <<'END_OF_FILE'
  25. X/*
  26. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  27. X * University. Official permission to use this software is included in
  28. X * the documentation. It authorizes you to use this file for any
  29. X * non-commercial purpose, provided that this copyright notice is not
  30. X * removed and that any modifications made to this file are commented
  31. X * and dated in the style of my example below.
  32. X */
  33. X
  34. X/*
  35. X *
  36. X *  source file:   ./filters/envilib/enviattr.c
  37. X *
  38. X * Joe Dellinger (SEP), June 11 1987
  39. X *    Inserted this sample edit history entry.
  40. X *    Please log any further modifications made to this file:
  41. X */
  42. X
  43. X#include <stdio.h>
  44. X#include <math.h>
  45. X#include "../include/attrcom.h"
  46. X#include "../include/params.h"
  47. X#include "envi.h"
  48. X
  49. extern FILE    *pltout;
  50. X
  51. enviattributes (command, value, v1, v2, v3)
  52. X    register int    command, value;
  53. X    int             v1, v2, v3;
  54. X{
  55. int             icol;
  56. X
  57. X    switch (command)
  58. X    {
  59. X    case SET_COLOR:
  60. X    envisetmode (REG);
  61. X    if ((version < 220 && value < 8) || (version >= 220 && value < 16))
  62. X    {
  63. X        if (value < 8)
  64. X        {
  65. X        /* Convert from Regis colors to Envision Colors */
  66. X        icol = (int) (value / 2) + (value - 2 * (int) (value / 2)) * 4;
  67. X        }
  68. X        else
  69. X        {
  70. X        icol = value;
  71. X        }
  72. X        fprintf (pltout, "%cC%c", ESC, icol + '0');
  73. X    }
  74. X    else
  75. X    {
  76. X        /* Try some sort of a fill pattern instead */
  77. X        /* Cycle through colors, skipping black */
  78. X        icol = 1 + ((value - 8) % 7);
  79. X        icol = (int) (icol / 2) + (icol - 2 * (int) (icol / 2)) * 4;
  80. X        fprintf (pltout, "%cC%c", ESC, icol + '0');
  81. X        /* Also cycle through patterns everytime colors flip */
  82. X        icol = floor ((float) (value - 8) / 7.);
  83. X        icol = icol % 33;
  84. X        fprintf (pltout, "%cOH%c", ESC, icol + '0');
  85. X    }
  86. X    break;
  87. X    case SET_COLOR_TABLE:
  88. X    /* 220 can't reset colors 8-15 ... stupid terminal has another bug */
  89. X    if (value < 8)
  90. X    {
  91. X        envisetmode (REG);
  92. X        if (value < 8)
  93. X        {
  94. X        /* Convert from Regis colors to Envision Colors */
  95. X        icol = (int) (value / 2) + (value - 2 * (int) (value / 2)) * 4;
  96. X        }
  97. X        else
  98. X        {
  99. X        icol = value;
  100. X        }
  101. X        v1 /= (int) ((MAX_GUN + 1) / 16);
  102. X        v2 /= (int) ((MAX_GUN + 1) / 16);
  103. X        v3 /= (int) ((MAX_GUN + 1) / 16);
  104. X        fprintf (pltout, "%cQ%c%c%c%c",
  105. X             ESC, icol + '0', v1 + '0', v2 + '0', v3 + '0');
  106. X    }
  107. X    break;
  108. X    default:
  109. X    break;
  110. X    }
  111. X
  112. X    return 0;
  113. X}
  114. END_OF_FILE
  115. if test 2314 -ne `wc -c <'Envision_device/envilib/enviattr.c'`; then
  116.     echo shar: \"'Envision_device/envilib/enviattr.c'\" unpacked with wrong size!
  117. fi
  118. # end of 'Envision_device/envilib/enviattr.c'
  119. fi
  120. if test -f 'Envision_device/envilib/envimessage.c' -a "${1}" != "-c" ; then 
  121.   echo shar: Will not clobber existing file \"'Envision_device/envilib/envimessage.c'\"
  122. else
  123. echo shar: Extracting \"'Envision_device/envilib/envimessage.c'\" \(2025 characters\)
  124. sed "s/^X//" >'Envision_device/envilib/envimessage.c' <<'END_OF_FILE'
  125. X/*
  126. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  127. X * University. Official permission to use this software is included in
  128. X * the documentation. It authorizes you to use this file for any
  129. X * non-commercial purpose, provided that this copyright notice is not
  130. X * removed and that any modifications made to this file are commented
  131. X * and dated in the style of my example below.
  132. X */
  133. X
  134. X/*
  135. X *
  136. X *  source file:   ./filters/envilib/envimessage.c
  137. X *
  138. X * Joe Dellinger (SEP), June 11 1987
  139. X *    Inserted this sample edit history entry.
  140. X *    Please log any further modifications made to this file:
  141. X */
  142. X
  143. X#include <stdio.h>
  144. X#include "../include/mesgcom.h"
  145. X#include "envi.h"
  146. extern FILE    *pltout;
  147. X
  148. envimessage (command, string)
  149. X    int             command;
  150. X    char            string[];
  151. X{
  152. X    switch (command)
  153. X    {
  154. X    case MESG_OFF:        /* Turn off Text */
  155. X    envisetmode (REG);    /* Get out of Tek mode */
  156. X    fprintf (pltout, "%cRA0", ESC);
  157. X    fflush (pltout);
  158. X    break;
  159. X    case MESG_ON:        /* Turn on Text */
  160. X    envisetmode (REG);    /* Get out of Tek mode */
  161. X    fprintf (pltout, "%cRA1", ESC);
  162. X    fflush (pltout);
  163. X    break;
  164. X    case MESG_ERASE:        /* Erase Text */
  165. X    envisetmode (REG);    /* Get out of Tek mode */
  166. X    putc (ESC, pltout);
  167. X    fprintf (pltout, "[2J");/* Erase Text Screen */
  168. X    fflush (pltout);
  169. X    break;
  170. X    case MESG_HOME:        /* Home */
  171. X    envisetmode (REG);    /* Get out of Tek mode */
  172. X    fprintf (pltout, "%c[H", ESC);    /* Home */
  173. X    break;
  174. X    case MESG_READY:        /* Prepare for text */
  175. X    envisetmode (REG);    /* Get out of Tek mode */
  176. X    enviresetpan ();    /* Need to print on the text screen */
  177. X    fflush (pltout);
  178. X    break;
  179. X    case MESG_DONE:        /* Done with text */
  180. X    envisetpan ();
  181. X    fflush (pltout);
  182. X    break;
  183. X    case MESG_HIGHLIGHT_ON:    /* Get ready for prompting */
  184. X    fprintf (pltout, "%c[5m", ESC);
  185. X    break;
  186. X    case MESG_HIGHLIGHT_OFF:    /* Get ready for prompting */
  187. X    fprintf (pltout, "%c[0m", ESC);
  188. X    break;
  189. X    case MESG_TEXT:        /* Print out the text */
  190. X    fprintf (pltout, "%s", string);
  191. X    break;
  192. X    default:            /* Not intended for us, ignore */
  193. X    break;
  194. X    }
  195. X}
  196. END_OF_FILE
  197. if test 2025 -ne `wc -c <'Envision_device/envilib/envimessage.c'`; then
  198.     echo shar: \"'Envision_device/envilib/envimessage.c'\" unpacked with wrong size!
  199. fi
  200. # end of 'Envision_device/envilib/envimessage.c'
  201. fi
  202. if test -f 'Imagen_device/imaglib/imagplot.c' -a "${1}" != "-c" ; then 
  203.   echo shar: Will not clobber existing file \"'Imagen_device/imaglib/imagplot.c'\"
  204. else
  205. echo shar: Extracting \"'Imagen_device/imaglib/imagplot.c'\" \(2505 characters\)
  206. sed "s/^X//" >'Imagen_device/imaglib/imagplot.c' <<'END_OF_FILE'
  207. X/*
  208. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  209. X * University. Official permission to use this software is included in
  210. X * the documentation. It authorizes you to use this file for any
  211. X * non-commercial purpose, provided that this copyright notice is not
  212. X * removed and that any modifications made to this file are commented
  213. X * and dated in the style of my example below.
  214. X */
  215. X
  216. X/*
  217. X *
  218. X *  source file:   ./filters/imaglib/imagplot.c
  219. X *
  220. X * Joe Dellinger (SEP), June 11 1987
  221. X *    Inserted this sample edit history entry.
  222. X *    Please log any further modifications made to this file:
  223. X */
  224. X
  225. X#include <stdio.h>
  226. X#include "../include/err.h"
  227. X#include "../include/enum.h"
  228. X#include "../include/extern.h"
  229. X#include "imagen.h"
  230. X
  231. X/*
  232. X * PATCH:
  233. X * Occasionally, the imagen will forget to plot the last segment of
  234. X * a path. To guard against this, the last point of each path is
  235. X * repeated!
  236. X */
  237. int             lost = 1;
  238. X
  239. imagplot (x, y, draw)
  240. X    int             x, y, draw;
  241. X{
  242. X    if (draw == 0)
  243. X    {
  244. X    startpath ();
  245. X    lost = 0;
  246. X    }
  247. X    addpath (x, y);
  248. X}
  249. X
  250. static int      pathsave[PATHLENGTH][2];
  251. static int      where = -1;
  252. X
  253. startpath ()
  254. X{
  255. X    if (where > 0)
  256. X    {
  257. X    endpath (DRAW_PATH, imag_curcolor);
  258. X    }
  259. X    where = 0;
  260. X}
  261. X
  262. addpath (x, y)
  263. X    int             x, y;
  264. X{
  265. static int      oldx, oldy;
  266. X
  267. X    if (where == -1)
  268. X    ERR (FATAL, name,
  269. X         "addpath, with no active path!(This can't happen.)");
  270. X    if (where > 0 && x == oldx && y == oldy)
  271. X    return;
  272. X    pathsave[where][1] = x;    /* The default coordinates are pretty bizarre */
  273. X    pathsave[where][0] = y;    /* Swap X and Y and they look standard! */
  274. X    oldx = x;
  275. X    oldy = y;
  276. X    where++;
  277. X
  278. X    /*
  279. X     * PATCH: leave room for redundant point at end 
  280. X     */
  281. X    if (where == PATHLENGTH - 1)
  282. X    {
  283. X    endpath (DRAW_PATH, imag_curcolor);
  284. X    }
  285. X}
  286. X
  287. endpath (what_to_do, what_color)
  288. X    int             what_to_do, what_color;
  289. X{
  290. int             i;
  291. X
  292. X    if (where == 0)
  293. X    ERR (FATAL, name, "endpath, can't end path with length zero");
  294. X
  295. X    /*
  296. X     * PATCH: Add redundant point at end 
  297. X     */
  298. X    if (where > 0)
  299. X    {
  300. X    pathsave[where][0] = pathsave[where - 1][0];
  301. X    pathsave[where][1] = pathsave[where - 1][1];
  302. X    where++;
  303. X
  304. X    fprintf (pltout, "%c%c%c", CREATE_PATH, hib (where), lob (where));
  305. X    for (i = 0; i < where; i++)
  306. X    {
  307. X        fprintf (pltout, "%c%c", hib (pathsave[i][0]), lob (pathsave[i][0]));
  308. X        fprintf (pltout, "%c%c", hib (pathsave[i][1]), lob (pathsave[i][1]));
  309. X    }
  310. X    fprintf (pltout, "%c%c", what_to_do, what_color);
  311. X    where = -1;
  312. X    }
  313. X    lost = 1;
  314. X}
  315. END_OF_FILE
  316. if test 2505 -ne `wc -c <'Imagen_device/imaglib/imagplot.c'`; then
  317.     echo shar: \"'Imagen_device/imaglib/imagplot.c'\" unpacked with wrong size!
  318. fi
  319. # end of 'Imagen_device/imaglib/imagplot.c'
  320. fi
  321. if test -f 'Tek_device/cteklib/ctekpack.c' -a "${1}" != "-c" ; then 
  322.   echo shar: Will not clobber existing file \"'Tek_device/cteklib/ctekpack.c'\"
  323. else
  324. echo shar: Extracting \"'Tek_device/cteklib/ctekpack.c'\" \(2469 characters\)
  325. sed "s/^X//" >'Tek_device/cteklib/ctekpack.c' <<'END_OF_FILE'
  326. X/*
  327. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  328. X * University. Official permission to use this software is included in
  329. X * the documentation. It authorizes you to use this file for any
  330. X * non-commercial purpose, provided that this copyright notice is not
  331. X * removed and that any modifications made to this file are commented
  332. X * and dated in the style of my example below.
  333. X */
  334. X
  335. X/*
  336. X *
  337. X *  source file:   ./filters/cteklib/ctekpack.c
  338. X *
  339. X * Joe Dellinger (SEP), June 11 1987
  340. X *    Inserted this sample edit history entry.
  341. X *    Please log any further modifications made to this file:
  342. X */
  343. X
  344. X/*
  345. X * Tek 4105 x,y coordinate packing.
  346. X * All x,y coordinates passed to the Tek are in this format:
  347. X * you need not be in Vector Mode or Marker Mode to use it.
  348. X * There are 12 significant bits per coordinate.
  349. X * If all coordinates are multiples of 4, no 'extra' byte
  350. X * will ever be sent. Previously-encoded positions are saved in
  351. X * ohiy, oloy, etc. in order to abbreviate the number of
  352. X * bytes sent out. This routine assumes pltout is open.
  353. X */
  354. X#include    <stdio.h>
  355. X#include    "ctek.h"
  356. extern FILE    *pltout;
  357. X
  358. ctekxypack (x, y)
  359. X{
  360. int             hiy, extra, loy, hix, lox;
  361. static int      ohiy, oextra, oloy, ohix;
  362. X
  363. X    /*
  364. X     * Encode the new position. 
  365. X     */
  366. X    hiy = 0040 | ((y >> 7) & 037);
  367. X    loy = 0140 | ((y >> 2) & 037);
  368. X    hix = 0040 | ((x >> 7) & 037);
  369. X    lox = 0100 | ((x >> 2) & 037);
  370. X    extra = 0140 | ((y & 03) << 2) | (x & 03);
  371. X
  372. X    /*
  373. X     * Only print what's necessary, according to Tek rules. 
  374. X     */
  375. X    if (hiy != ohiy)
  376. X    Putc (hiy);
  377. X    if (extra != oextra)
  378. X    Putc (extra);
  379. X    if (loy != oloy || extra != oextra || hix != ohix)
  380. X    Putc (loy);
  381. X    if (hix != ohix)
  382. X    Putc (hix);
  383. X    Putc (lox);
  384. X
  385. X    /*
  386. X     * Remember these for next time. 
  387. X     */
  388. X    ohiy = hiy;
  389. X    oextra = extra;
  390. X    oloy = loy;
  391. X    ohix = hix;
  392. X}
  393. X
  394. X/*
  395. X * Issue a packed integer. From one to three bytes sent.
  396. X */
  397. tekipack (i)
  398. X{
  399. int             ihi, imd, ilo;
  400. X
  401. X    if (i < 0)
  402. X    {
  403. X    i = -i;
  404. X    ilo = 040;
  405. X    }
  406. X    else
  407. X    ilo = 060;
  408. X
  409. X    ihi = 0100 | ((i >> 10) & 037);
  410. X    imd = 0100 | ((i >> 4) & 077);
  411. X    ilo |= (i & 017);
  412. X
  413. X    if (ihi != 0100)
  414. X    Putc (ihi);
  415. X    if (imd != 0100)
  416. X    Putc (imd);
  417. X    Putc (ilo);
  418. X}
  419. X
  420. pixpack (x, n)
  421. X    int             x[];
  422. int             n;
  423. X{
  424. int             shift;
  425. int             ii;
  426. int             s;
  427. X
  428. X    shift = 6 / n;
  429. X    s = 0;
  430. X    for (ii = 0; ii < n; ii++)
  431. X    {
  432. X    s = (s << shift) | (x[ii] & 7);
  433. X    }
  434. X    s += 32;
  435. X    Putc (s);
  436. X}
  437. END_OF_FILE
  438. if test 2469 -ne `wc -c <'Tek_device/cteklib/ctekpack.c'`; then
  439.     echo shar: \"'Tek_device/cteklib/ctekpack.c'\" unpacked with wrong size!
  440. fi
  441. # end of 'Tek_device/cteklib/ctekpack.c'
  442. fi
  443. if test -f 'Tek_device/teklib/tekclose.c' -a "${1}" != "-c" ; then 
  444.   echo shar: Will not clobber existing file \"'Tek_device/teklib/tekclose.c'\"
  445. else
  446. echo shar: Extracting \"'Tek_device/teklib/tekclose.c'\" \(2218 characters\)
  447. sed "s/^X//" >'Tek_device/teklib/tekclose.c' <<'END_OF_FILE'
  448. X/*
  449. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  450. X * University. Official permission to use this software is included in
  451. X * the documentation. It authorizes you to use this file for any
  452. X * non-commercial purpose, provided that this copyright notice is not
  453. X * removed and that any modifications made to this file are commented
  454. X * and dated in the style of my example below.
  455. X */
  456. X
  457. X/*
  458. X *
  459. X *  source file:   ./filters/teklib/tekclose.c
  460. X *
  461. X * Joe Dellinger (SEP), June 11 1987
  462. X *    Inserted this sample edit history entry.
  463. X *    Please log any further modifications made to this file:
  464. X */
  465. X
  466. X/*
  467. X * Routine to close the device
  468. X */
  469. X#include <stdio.h>
  470. X#include <strings.h>
  471. X#include "tek.h"
  472. X#include "../include/mesgcom.h"
  473. X#include "../include/closestat.h"
  474. X#include "../include/extern.h"
  475. X
  476. extern char     wstype[];
  477. X
  478. tekclose (status)
  479. X    int             status;
  480. X{
  481. X    switch (status)
  482. X    {
  483. X    case CLOSE_DONE:
  484. X    if (!strncmp (wstype, "tek401", 6))
  485. X        message (MESG_READY);
  486. X    setmode (ALPHA);
  487. X    /* put terminal back into transparent mode */
  488. X    if (!strcmp (wstype, "graphon"))
  489. X        fprintf (pltout, "\0332");
  490. X    else
  491. X    if (!strcmp (wstype, "retrographics"))
  492. X        fprintf (pltout, "\033\"0g");
  493. X    else
  494. X    if (!strcmp (wstype, "selanar"))
  495. X    {
  496. X        fprintf (pltout, "\0332");
  497. X        fflush (pltout);
  498. X        fprintf (pltout, "\033[>1t");    /* turn on text video */
  499. X        fflush (pltout);
  500. X    }
  501. X    else
  502. X    if (!strcmp (wstype, "dscan"))
  503. X        fprintf (pltout, "\033$");
  504. X    break;
  505. X    case CLOSE_FLUSH:
  506. X    fflush (pltout);
  507. X    break;
  508. X    case CLOSE_ERROR:
  509. X    case CLOSE_NORMAL:
  510. X    if (!strcmp (wstype, "retrographics"))
  511. X        message (MESG_DONE);
  512. X    else
  513. X        message (MESG_HOME);
  514. X    break;
  515. X    case CLOSE_INTERRUPT:
  516. X    if (!strncmp (wstype, "tek401", 6))
  517. X    {
  518. X        message (MESG_READY);
  519. X        message (MESG_TEXT, "\n\n\n");
  520. X        message (MESG_DONE);
  521. X        message (MESG_HOME);
  522. X    }
  523. X    else
  524. X        if ((!strcmp (wstype, "graphon")) ||
  525. X        (!strcmp (wstype, "selanar")) ||
  526. X        (!strcmp (wstype, "dscan")))
  527. X    {
  528. X        fprintf (pltout, "\n\n\n");
  529. X        message (MESG_HOME);
  530. X    }
  531. X    else
  532. X    if (!strcmp (wstype, "retrographics"))
  533. X        message (MESG_DONE);
  534. X    break;
  535. X    case CLOSE_PAUSE:
  536. X    case CLOSE_NOTHING:    /* No input */
  537. X    default:            /* not meant for us, ignore */
  538. X    break;
  539. X    }
  540. X}
  541. END_OF_FILE
  542. if test 2218 -ne `wc -c <'Tek_device/teklib/tekclose.c'`; then
  543.     echo shar: \"'Tek_device/teklib/tekclose.c'\" unpacked with wrong size!
  544. fi
  545. # end of 'Tek_device/teklib/tekclose.c'
  546. fi
  547. if test -f 'Virtual_device/vplib/vperase.c' -a "${1}" != "-c" ; then 
  548.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vperase.c'\"
  549. else
  550. echo shar: Extracting \"'Virtual_device/vplib/vperase.c'\" \(2488 characters\)
  551. sed "s/^X//" >'Virtual_device/vplib/vperase.c' <<'END_OF_FILE'
  552. X/*
  553. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  554. X * University. Official permission to use this software is included in
  555. X * the documentation. It authorizes you to use this file for any
  556. X * non-commercial purpose, provided that this copyright notice is not
  557. X * removed and that any modifications made to this file are commented
  558. X * and dated in the style of my example below.
  559. X */
  560. X
  561. X/*
  562. X *
  563. X *  source file:   ./filters/vplib/vperase.c
  564. X *
  565. X * Joe Dellinger (SEP), Dec 19 1987
  566. X *    Inserted this sample edit history entry.
  567. X *    Please log any further modifications made to this file:
  568. X * Joe Dellinger Feb 25 1988
  569. X *    Put out a setstyle command after erases.
  570. X */
  571. X
  572. X#include <stdio.h>
  573. X#include <vplot.h>
  574. X#include "../include/erasecom.h"
  575. X#include "../include/enum.h"
  576. X#include "../include/err.h"
  577. X#include "../include/extern.h"
  578. X#include "../include/round.h"
  579. X#include "vp.h"
  580. X
  581. static int      framecount = -1;
  582. X
  583. vperase (command)
  584. X    int             command;
  585. X{
  586. X    if (vparray[0] == 0)
  587. X    {
  588. X    switch (command)
  589. X    {
  590. X    case ERASE_MIDDLE:
  591. X        vp_erase ();
  592. X        if (!vpdumb && vpstyle)
  593. X        {
  594. X        vp_style (ABSOLUTE);
  595. X        }
  596. X        lost = YES;
  597. X        vpsetflag = NO;
  598. X        break;
  599. X    case ERASE_BREAK:
  600. X        vp_break ();
  601. X        if (!vpdumb && vpstyle)
  602. X        {
  603. X        vp_style (ABSOLUTE);
  604. X        }
  605. X        lost = YES;
  606. X        vpsetflag = NO;
  607. X        break;
  608. X    default:
  609. X        break;
  610. X    }
  611. X    }
  612. X    else
  613. X    {
  614. X    switch (command)
  615. X    {
  616. X    case ERASE_START:
  617. X        framecount = 0;
  618. X        dev_ymin = STANDARD_HEIGHT * RPERIN;
  619. X    case ERASE_MIDDLE:
  620. X        if (framecount < 0)
  621. X        ERR (FATAL, name, "Must have initial erase with gridnum");
  622. X        if ((framecount % vparray[0]) == 0)
  623. X        {
  624. X        dev_xmin = 0;
  625. X        dev_ymin -= vpasize[1];
  626. X        }
  627. X        else
  628. X        {
  629. X        dev_xmin += vpasize[0];
  630. X        }
  631. X        dev_xmax = dev_xmin + vpasize[0];
  632. X        dev_ymax = dev_ymin + vpasize[1];
  633. X
  634. X        if (command == ERASE_MIDDLE)
  635. X        vp_break ();
  636. X
  637. X        lost = YES;
  638. X        vpsetflag = NO;
  639. X        reset_parameters ();
  640. X        framecount++;
  641. X
  642. X        if (vpframe >= 0)
  643. X        {
  644. X        vp_color (WHITE);
  645. X        vp_fat (vpframe);
  646. X
  647. X        vp_move ((float) dev_xmin / RPERIN, (float) dev_ymin / RPERIN);
  648. X        vp_draw ((float) dev_xmax / RPERIN, (float) dev_ymin / RPERIN);
  649. X        vp_draw ((float) dev_xmax / RPERIN, (float) dev_ymax / RPERIN);
  650. X        vp_draw ((float) dev_xmin / RPERIN, (float) dev_ymax / RPERIN);
  651. X        vp_draw ((float) dev_xmin / RPERIN, (float) dev_ymin / RPERIN);
  652. X
  653. X        vp_color (vpcolor);
  654. X        vp_fat (ROUND (vpfat * FATPERIN / RPERIN));
  655. X        }
  656. X        break;
  657. X    case ERASE_BREAK:
  658. X        break;
  659. X    default:
  660. X        break;
  661. X    }
  662. X    }
  663. X}
  664. END_OF_FILE
  665. if test 2488 -ne `wc -c <'Virtual_device/vplib/vperase.c'`; then
  666.     echo shar: \"'Virtual_device/vplib/vperase.c'\" unpacked with wrong size!
  667. fi
  668. # end of 'Virtual_device/vplib/vperase.c'
  669. fi
  670. if test -f 'Virtual_device/vplib/vptext.c' -a "${1}" != "-c" ; then 
  671.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vptext.c'\"
  672. else
  673. echo shar: Extracting \"'Virtual_device/vplib/vptext.c'\" \(2050 characters\)
  674. sed "s/^X//" >'Virtual_device/vplib/vptext.c' <<'END_OF_FILE'
  675. X/*
  676. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  677. X * University. Official permission to use this software is included in
  678. X * the documentation. It authorizes you to use this file for any
  679. X * non-commercial purpose, provided that this copyright notice is not
  680. X * removed and that any modifications made to this file are commented
  681. X * and dated in the style of my example below.
  682. X */
  683. X
  684. X/*
  685. X *
  686. X *  source file:   ./filters/vplib/vptext.c
  687. X *
  688. X * Joe Dellinger (SEP), Dec 19 1987
  689. X *    Inserted this sample edit history entry.
  690. X *    Please log any further modifications made to this file:
  691. X * Joe Dellinger Jan 15 1988
  692. X *    Use the VP_GTEXT vplot command, instead of struggling trying
  693. X *    to make do with the archaic VP_TEXT.
  694. X */
  695. X
  696. X#include    <stdio.h>
  697. X#include    <math.h>
  698. X#include    "../include/vplot.h"
  699. X#include    "../include/extern.h"
  700. X#include    "../include/enum.h"
  701. X#include    "../include/params.h"
  702. X#include    "../include/round.h"
  703. X#include    "./vp.h"
  704. X
  705. extern int
  706. gentext (), nulldev ();
  707. X
  708. vptext (string, pathx, pathy, upx, upy)
  709. X    char           *string;
  710. X    float           pathx, pathy, upx, upy;
  711. X{
  712. int             (*savevector) ();
  713. int             (*saveattributes) ();
  714. int             (*savearea) ();
  715. X
  716. X    vpsetflag = NO;
  717. X    lost = YES;
  718. X
  719. X    if (*string == '\0')
  720. X    return;
  721. X
  722. X    vp_gtext ((float) xold / RPERIN, (float) yold / RPERIN,
  723. X          pathx / RPERIN, pathy / RPERIN,
  724. X          upx / RPERIN, upy / RPERIN,
  725. X          string);
  726. X
  727. X/*
  728. X *   Now reset the pen position to the end of the text.
  729. X *   Do a dummy run through (if this indeed a gentext font)
  730. X */
  731. X    if (txfont < NUMGENFONT)
  732. X    {
  733. X    savevector = dev.vector;
  734. X    saveattributes = dev.attributes;
  735. X    savearea = dev.area;
  736. X
  737. X/*
  738. X *   Disconnect everything except error messages
  739. X */
  740. X    dev.vector = nulldev;
  741. X    dev.attributes = nulldev;
  742. X    dev.area = nulldev;
  743. X
  744. X    gentext (string, pathx, pathy, upx, upy);
  745. X
  746. X    dev.vector = savevector;
  747. X    dev.attributes = saveattributes;
  748. X    dev.area = savearea;
  749. X
  750. X/*
  751. X * Jon note that this shows you how to find the size of the text.
  752. X */
  753. X    vp_move ((float) xold / RPERIN, (float) yold / RPERIN);
  754. X    }
  755. X}
  756. END_OF_FILE
  757. if test 2050 -ne `wc -c <'Virtual_device/vplib/vptext.c'`; then
  758.     echo shar: \"'Virtual_device/vplib/vptext.c'\" unpacked with wrong size!
  759. fi
  760. # end of 'Virtual_device/vplib/vptext.c'
  761. fi
  762. if test -f 'Virtual_device/vplib/vpvector.c' -a "${1}" != "-c" ; then 
  763.   echo shar: Will not clobber existing file \"'Virtual_device/vplib/vpvector.c'\"
  764. else
  765. echo shar: Extracting \"'Virtual_device/vplib/vpvector.c'\" \(2482 characters\)
  766. sed "s/^X//" >'Virtual_device/vplib/vpvector.c' <<'END_OF_FILE'
  767. X/*
  768. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  769. X * University. Official permission to use this software is included in
  770. X * the documentation. It authorizes you to use this file for any
  771. X * non-commercial purpose, provided that this copyright notice is not
  772. X * removed and that any modifications made to this file are commented
  773. X * and dated in the style of my example below.
  774. X */
  775. X
  776. X/*
  777. X *
  778. X *  source file:   ./filters/vplib/vpvector.c
  779. X *
  780. X * Joe Dellinger (SEP), Dec 19 1987
  781. X *    Inserted this sample edit history entry.
  782. X *    Please log any further modifications made to this file:
  783. X */
  784. X
  785. X#include <stdio.h>
  786. X#include <vplot.h>
  787. X#include "../include/extern.h"
  788. X#include "../include/enum.h"
  789. X#include "../include/attrcom.h"
  790. X#include "../include/round.h"
  791. X#include "vp.h"
  792. X#define MOVE 0
  793. X#define DRAW 1
  794. X
  795. extern int      lost;
  796. X
  797. vpvector (x1, y1, x2, y2, nfat, vpdashon)
  798. X    int             x1, y1, x2, y2;
  799. X    int             nfat, vpdashon;
  800. X{
  801. static int      xlst, ylst;
  802. int             d1, d2;
  803. X
  804. X    if (nfat < 0)
  805. X    return;
  806. X
  807. X    /*
  808. X     * Important special case: Zero-length vector at the end of what you've
  809. X     * already plotted. Don't need to do anything. 
  810. X     */
  811. X    if (x1 == x2 && y1 == y2 && !lost && x1 == xlst && y1 == ylst)
  812. X    {
  813. X    return;
  814. X    }
  815. X
  816. X/*
  817. X * As stated in the documentation, dev.vector must be
  818. X * ready to accept changes in fatness and linestyle without
  819. X * warning at any time.
  820. X */
  821. X
  822. X    if (nfat != fat)
  823. X    {
  824. X    vp_fat (ROUND ((float) nfat * FATPERIN / RPERIN));
  825. X    lost = YES;
  826. X    }
  827. X
  828. X    if (vpdashon != dashon)
  829. X    {
  830. X    dev.attributes (NEW_DASH, vpdashon, 0, 0, 0);
  831. X    }
  832. X
  833. X    /*
  834. X     * Minimize movement of "pen" Don't turn around dashed lines, since order
  835. X     * of drawing matters. 
  836. X     */
  837. X    if (!lost && !vpdashon)
  838. X    {
  839. X    d1 = abs (x1 - xlst) + abs (y1 - ylst);
  840. X    d2 = abs (x2 - xlst) + abs (y2 - ylst);
  841. X    if (d2 < d1)
  842. X    {
  843. X        d1 = x1;
  844. X        d2 = y1;
  845. X        x1 = x2;
  846. X        y1 = y2;
  847. X        x2 = d1;
  848. X        y2 = d2;
  849. X    }
  850. X    }
  851. X
  852. X    if ((x1 != xlst) || (y1 != ylst) || lost)
  853. X    {
  854. X    /* Make sure it is a move, not a draw */
  855. X    dev.plot (x1, y1, MOVE);
  856. X    }
  857. X    dev.plot (x2, y2, DRAW);
  858. X    xlst = x2;
  859. X    ylst = y2;
  860. X
  861. X/*
  862. X * Restore fat and dash stuff if we changed it.
  863. X */
  864. X    if (nfat != fat)
  865. X    {
  866. X    vp_fat (ROUND ((float) fat * FATPERIN / RPERIN));
  867. X    lost = YES;
  868. X    }
  869. X
  870. X    if (vpdashon != dashon)
  871. X    {
  872. X    dev.attributes (NEW_DASH, dashon, 0, 0, 0);
  873. X    }
  874. X/*
  875. X * Above can be inefficient, but that's a rare case and it's hard
  876. X * to get around. (Very hard.) This works!
  877. X */
  878. X}
  879. END_OF_FILE
  880. if test 2482 -ne `wc -c <'Virtual_device/vplib/vpvector.c'`; then
  881.     echo shar: \"'Virtual_device/vplib/vpvector.c'\" unpacked with wrong size!
  882. fi
  883. # end of 'Virtual_device/vplib/vpvector.c'
  884. fi
  885. if test -f 'Vplot_Kernel/Hershey/make_vplot.csh' -a "${1}" != "-c" ; then 
  886.   echo shar: Will not clobber existing file \"'Vplot_Kernel/Hershey/make_vplot.csh'\"
  887. else
  888. echo shar: Extracting \"'Vplot_Kernel/Hershey/make_vplot.csh'\" \(2079 characters\)
  889. sed "s/^X//" >'Vplot_Kernel/Hershey/make_vplot.csh' <<'END_OF_FILE'
  890. X#
  891. X# Here is the csh to use to assemble the Hershey font data into reasonable,
  892. X# useable fonts for use with Vplot. The lines_normal_* files contain the
  893. X# information such as base height and ligatures that hertovplot.c mentions
  894. X# needs to be edited in "by hand". (Note all the ligatures for the Russian
  895. X# font! This follows the standard method for transliterating Cyrillic into
  896. X# the roman alphabet.)
  897. X#
  898. X# It's up to you to get the required .oc files from the
  899. X# Hershey font distribution.
  900. X# I'm not going to redistribute the fonts again!
  901. X#
  902. X# I do, however, give you .hmp files. Mine are somewhat modified
  903. X# from the ones that come with the original Hershey font distribution.
  904. X# Mine correct mistakes in and improve on the original ones.
  905. X#
  906. X# Joe Dellinger
  907. X# joe@hanauma.stanford.edu
  908. X#
  909. cat hersh.oc1 hersh.oc2 hersh.oc3 hersh.oc4 > HERSH
  910. cc -o hertovplot hertovplot.c
  911. X
  912. X# Normal Size fonts
  913. X# Beware! Roman triplex font has an error in character "J"!
  914. X# (Width information has a sign error.)
  915. X# You have to fix this by hand before installing it!
  916. X# I've commented that file out for now.
  917. foreach file ( gothgbt.hmp gothgrt.hmp gothitt.hmp greekc.hmp greeks.hmp italict.hmp romand.hmp romans.hmp ) #romant.hmp
  918. echo $file
  919. hertovplot $file < HERSH > temp
  920. cat lines_normal temp > $file:r.vplot_font
  921. rm -f temp
  922. end
  923. foreach file ( italicc.hmp romanc.hmp )
  924. echo $file
  925. hertovplot $file < HERSH > temp
  926. cat lines_normal+rolig temp > $file:r.vplot_font
  927. rm -f temp
  928. end
  929. foreach file ( cyrilc.hmp )
  930. echo $file
  931. hertovplot $file < HERSH > temp
  932. cat lines_normal+cylig temp > $file:r.vplot_font
  933. rm -f temp
  934. end
  935. X
  936. X# Script Normal (No spaces between characters)
  937. foreach file ( scriptc.hmp scripts.hmp )
  938. echo $file
  939. hertovplot $file < HERSH > temp
  940. cat lines_normal_script temp > $file:r.vplot_font
  941. rm -f temp
  942. end
  943. X
  944. X# Misc Normal
  945. foreach file ( math.hmp misc.hmp )
  946. echo $file
  947. hertovplot $file < HERSH > temp
  948. cat lines_normal_misc temp > $file:r.vplot_font
  949. rm -f temp
  950. end
  951. X
  952. rm -f HERSH hertovplot
  953. X# Now copy all the newly generated vplot_fonts to the vplotfont directory.
  954. mv *.vplot_font ../filters/include/vplotfonts
  955. END_OF_FILE
  956. if test 2079 -ne `wc -c <'Vplot_Kernel/Hershey/make_vplot.csh'`; then
  957.     echo shar: \"'Vplot_Kernel/Hershey/make_vplot.csh'\" unpacked with wrong size!
  958. fi
  959. # end of 'Vplot_Kernel/Hershey/make_vplot.csh'
  960. fi
  961. if test -f 'Vplot_Kernel/filters/MakeMake' -a "${1}" != "-c" ; then 
  962.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/MakeMake'\"
  963. else
  964. echo shar: Extracting \"'Vplot_Kernel/filters/MakeMake'\" \(2183 characters\)
  965. sed "s/^X//" >'Vplot_Kernel/filters/MakeMake' <<'END_OF_FILE'
  966. X#! /bin/csh -f
  967. X#
  968. X# If you don't have seplib, remove "MakeMakesep" before executing this shell!
  969. X#
  970. X    rm -f Makefile Makesep
  971. X    /bin/cat << END1A >! Makefile
  972. X#
  973. X# Site-specific definitions are confined to makefiles and include files.
  974. X#
  975. X# The file "machdep" contains all machine dependent parameters for makefiles.
  976. X# MakeMake itself is machine independent!
  977. X#
  978. END1A
  979. X/bin/cat < machdep >> Makefile
  980. X    /bin/cat << END1B >> Makefile
  981. X#
  982. X#
  983. END1B
  984. X
  985. X    set hosttype = `cat hosttype`
  986. X    echo $hosttype
  987. X    set ALL=()
  988. X    foreach dir (*lib)
  989. X        echo Doing $dir
  990. X        switch ($dir)
  991. X            case loclib:
  992. X            case genlib:
  993. X            case utillib:
  994. X                breaksw
  995. X            case imaglib:
  996. X                set ALL=($ALL ipen)
  997. X                breaksw
  998. X            case rteklib:
  999. X                set ALL=($ALL rpen)
  1000. X                breaksw
  1001. X            case spenlib:
  1002. X                set ALL=($ALL spen)
  1003. X                breaksw
  1004. X            case xpenlib:
  1005. X                set ALL=($ALL xpen)
  1006. X                breaksw
  1007. X            default:
  1008. X                set thispen = `echo $dir | sed -e 's/lib/pen/'`
  1009. X                set ALL = ($ALL $thispen)
  1010. X                breaksw
  1011. X        endsw
  1012. X    end
  1013. X    echo "all: $ALL" >> Makefile
  1014. X    echo "" >> Makefile
  1015. X    echo "install: all" >> Makefile
  1016. X
  1017. X    if (-e machdep_restrict) then
  1018. X        set machdepres = machdep_restrict
  1019. X    else
  1020. X        set machdepres = /dev/null
  1021. X    endif
  1022. X
  1023. X    foreach file ($ALL)
  1024. X        if (`grep -c $file $machdepres` > 0) then
  1025. X        set group = `grep $file $machdepres | sed -e 's/^[^     ]*[     ]*//'`
  1026. X        echo -n '    install -c -s -o $(OWNER) -g '$group' -m 0770 ' >> Makefile
  1027. X        else
  1028. X        echo -n '    install -c -s -o $(OWNER) -g $(GROUP) -m 0775 ' >> Makefile
  1029. X        endif
  1030. X
  1031. X        echo $file '$(BIN)'$file >> Makefile
  1032. X    end
  1033. X
  1034. X    if (-e MakeMakesep) then
  1035. X        echo "    make -f Makesep install" >> Makefile
  1036. X    endif
  1037. X
  1038. X    /bin/cat << 'END2' >> Makefile
  1039. X
  1040. X.c.o:; cc -c $(CFLAGS) $*.c
  1041. X
  1042. X$(LOCLIB): loclib/*.c
  1043. X    cd loclib; make "CFLAGS=${CFLAGS}" loclib.a
  1044. X
  1045. X$(GENLIB): genlib/*.c
  1046. X    cd genlib; make "CFLAGS=${CFLAGS}"
  1047. X
  1048. X$(UTILLIB): utilities/*.c
  1049. X    cd utilities; make "CFLAGS=${CFLAGS}"
  1050. X
  1051. clean:
  1052. X'END2'
  1053. echo "    rm -f *.o $ALL" >> Makefile
  1054. if (-e MakeMakesep) then
  1055. X    echo "    make -f Makesep clean" >> Makefile
  1056. endif
  1057. echo " " >> Makefile
  1058. X
  1059. X    foreach dir (*lib)
  1060. X        switch ($dir)
  1061. X            case utillib:
  1062. X            case loclib:
  1063. X            case genlib:
  1064. X                breaksw
  1065. X            default:
  1066. X                cat $dir/*makef >> Makefile
  1067. X                breaksw
  1068. X        endsw
  1069. X    end
  1070. X
  1071. if (-e MakeMakesep) then
  1072. X    source MakeMakesep
  1073. endif
  1074. END_OF_FILE
  1075. if test 2183 -ne `wc -c <'Vplot_Kernel/filters/MakeMake'`; then
  1076.     echo shar: \"'Vplot_Kernel/filters/MakeMake'\" unpacked with wrong size!
  1077. fi
  1078. chmod +x 'Vplot_Kernel/filters/MakeMake'
  1079. # end of 'Vplot_Kernel/filters/MakeMake'
  1080. fi
  1081. if test -f 'Vplot_Kernel/filters/MakeMakesep' -a "${1}" != "-c" ; then 
  1082.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/MakeMakesep'\"
  1083. else
  1084. echo shar: Extracting \"'Vplot_Kernel/filters/MakeMakesep'\" \(2230 characters\)
  1085. sed "s/^X//" >'Vplot_Kernel/filters/MakeMakesep' <<'END_OF_FILE'
  1086. X#! /bin/csh -f
  1087. X    /bin/cat << END1A >! Makesep
  1088. X#
  1089. X# Site-specific definitions are confined to makefiles and include files.
  1090. X# For makefiles the file machdepsep contains all machine-dependent parameters.
  1091. X# MakeMakesep itself is machine independent!
  1092. X#
  1093. END1A
  1094. X/bin/cat < machdepsep >> Makesep
  1095. X    /bin/cat << END1B >> Makesep
  1096. X#
  1097. X#
  1098. END1B
  1099. X
  1100. X    set hosttype = `cat hosttype`
  1101. X    echo $hosttype
  1102. X    set ALL=()
  1103. X    foreach dir (*lib)
  1104. X        echo Doing $dir
  1105. X        switch ($dir)
  1106. X            case loclib:
  1107. X            case genlib:
  1108. X            case utillib:
  1109. X                breaksw
  1110. X            case imaglib:
  1111. X                set ALL=($ALL Ipen)
  1112. X                breaksw
  1113. X            case rteklib:
  1114. X                set ALL=($ALL Rpen)
  1115. X                breaksw
  1116. X            case spenlib:
  1117. X                set ALL=($ALL Spen)
  1118. X                breaksw
  1119. X            case xpenlib:
  1120. X                set ALL=($ALL Xpen)
  1121. X                breaksw
  1122. X            default:
  1123. X                set thispen = `echo $dir | sed -e 's/lib/pen/'`
  1124. X                set thispenf = `echo $thispen | sed -e 's/^\(.\)\(.*\)$/\1/' | tr a-z A-Z`
  1125. X                set thispenb = `echo $thispen | sed -e 's/^\(.\)\(.*\)$/\2/'`
  1126. X                set ALL = ($ALL $thispenf$thispenb)
  1127. X                breaksw
  1128. X        endsw
  1129. X    end
  1130. X    echo "all: $ALL" >> Makesep
  1131. X    echo "" >> Makesep
  1132. X    echo "install: all" >> Makesep
  1133. X
  1134. X    if (-e machdep_restrict) then
  1135. X        set machdepres = machdep_restrict
  1136. X    else
  1137. X        set machdepres = /dev/null
  1138. X    endif
  1139. X
  1140. X    foreach file ($ALL)
  1141. X        if (`grep -c $file $machdepres` > 0) then
  1142. X        set group = `grep $file $machdepres | sed -e 's/^[^     ]*[     ]*//'`
  1143. X        echo -n '    install -c -s -o $(OWNER) -g '$group' -m 0770 ' >> Makesep
  1144. X        else
  1145. X        echo -n '    install -c -s -o $(OWNER) -g $(GROUP) -m 0775 ' >> Makesep
  1146. X        endif
  1147. X
  1148. X        echo $file '$(BIN)'$file >> Makesep
  1149. X    end
  1150. X
  1151. X    /bin/cat << 'END2' >> Makesep
  1152. X
  1153. X.c.o:; cc -c $(CFLAGS) $*.c
  1154. X
  1155. X$(TSEPLIB): loclib/*.c
  1156. X    cd loclib; make "CFLAGS=${CFLAGS}" tseplib.a
  1157. X
  1158. X$(GENLIB): genlib/*.c
  1159. X    cd genlib; make "CFLAGS=${CFLAGS}"
  1160. X
  1161. X$(UTILLIB): utilities/*.c
  1162. X    cd utilities; make "CFLAGS=${CFLAGS}"
  1163. X
  1164. Main_vplot.o: main_vplot.c
  1165. X    cp main_vplot.c Main_vplot.c
  1166. X    cc -c $(CFLAGS) Main_vplot.c
  1167. X    rm Main_vplot.c
  1168. X
  1169. Init_vplot.o: init_vplot.c
  1170. X    cp init_vplot.c Init_vplot.c
  1171. X    cc -c $(CFLAGS) Init_vplot.c
  1172. X    rm Init_vplot.c
  1173. X
  1174. clean:
  1175. X'END2'
  1176. echo "    rm -f *.o $ALL" >> Makesep
  1177. echo " " >> Makesep
  1178. X
  1179. X    foreach dir (*lib)
  1180. X        switch ($dir)
  1181. X            case utillib:
  1182. X            case loclib:
  1183. X            case genlib:
  1184. X                breaksw
  1185. X            default:
  1186. X                cat $dir/*Makef >> Makesep
  1187. X                breaksw
  1188. X        endsw
  1189. X    end
  1190. END_OF_FILE
  1191. if test 2230 -ne `wc -c <'Vplot_Kernel/filters/MakeMakesep'`; then
  1192.     echo shar: \"'Vplot_Kernel/filters/MakeMakesep'\" unpacked with wrong size!
  1193. fi
  1194. chmod +x 'Vplot_Kernel/filters/MakeMakesep'
  1195. # end of 'Vplot_Kernel/filters/MakeMakesep'
  1196. fi
  1197. if test -f 'Vplot_Kernel/filters/Tests/README' -a "${1}" != "-c" ; then 
  1198.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/README'\"
  1199. else
  1200. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/README'\" \(2087 characters\)
  1201. sed "s/^X//" >'Vplot_Kernel/filters/Tests/README' <<'END_OF_FILE'
  1202. This directory contains a test suite and some examples.
  1203. X
  1204. All of the files beginning with a capital letter are meant to be
  1205. run through plas with the -v option, ie:
  1206. plas -v < TEST_align | ?pen scale=?
  1207. X
  1208. Demo files are meant to show what sort of nice pictures you can make
  1209. with vplot. The "demo" files (note lowercase) are meant to be read directly,
  1210. ie:
  1211. X?pen demo_pacific.v
  1212. The lower-case demo files will not be included in some versions of the
  1213. distribution. (If size is of importance.)
  1214. You can try out several of the demo files at once by:
  1215. X?pen par=parfile
  1216. X
  1217. Each of the files beginning "TEST" is meant to test something.
  1218. It should be pretty obvious if something is wrong. Some of them
  1219. will print out text on your screen pointing out what to look for.
  1220. X(If none of them do, then you've got a problem with your dev.message
  1221. routine.) The csh "All_tests" will run through all the tests, one by
  1222. one. The argument to All_tests is the name of the vplot filter you
  1223. want to use.
  1224. X
  1225. Programs:
  1226. X
  1227. The program Font.c produces pldb-format files which display the contents
  1228. of a font. For each glyph in a font the corresponding glyph in font 0
  1229. is shown (small), along with the glyph's index. A ``?'' in a box is
  1230. a special error symbol which indicates that the desired glyph is not
  1231. defined. This error glyph is glyph number 30 in font 0.
  1232. X
  1233. The program rastest.c must be linked with -lvplot, and the output of it
  1234. can be piped into any pen filter. It produces an interesting color raster
  1235. moire pattern (it may take a while to come out if you're using genraster).
  1236. This program also serves as an example of how to use vplotlib from a C program.
  1237. X
  1238. Other example C and FORTRAN programs are:
  1239. X
  1240. ellips.f, libvplot_example.c, polytest.c
  1241. X
  1242. You'll have to edit the makefile to call the appropriate pen filter.
  1243. X
  1244. X
  1245. The programs here are bad examples in that they implicitly use hardwired
  1246. magic numbers, without basing them off of the defined values in vplot.h.
  1247. The metafiles in this directory are also in raw integer Vplot units, not
  1248. inches or centimeters. These, however, are easy to convert using plas (if
  1249. needed) and pldb -i.
  1250. END_OF_FILE
  1251. if test 2087 -ne `wc -c <'Vplot_Kernel/filters/Tests/README'`; then
  1252.     echo shar: \"'Vplot_Kernel/filters/Tests/README'\" unpacked with wrong size!
  1253. fi
  1254. # end of 'Vplot_Kernel/filters/Tests/README'
  1255. fi
  1256. if test -f 'Vplot_Kernel/filters/Tests/rastest.c' -a "${1}" != "-c" ; then 
  1257.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/Tests/rastest.c'\"
  1258. else
  1259. echo shar: Extracting \"'Vplot_Kernel/filters/Tests/rastest.c'\" \(2440 characters\)
  1260. sed "s/^X//" >'Vplot_Kernel/filters/Tests/rastest.c' <<'END_OF_FILE'
  1261. X/*
  1262. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1263. X * University. Official permission to use this software is included in
  1264. X * the documentation. It authorizes you to use this file for any
  1265. X * non-commercial purpose, provided that this copyright notice is not
  1266. X * removed and that any modifications made to this file are commented
  1267. X * and dated in the style of my example below.
  1268. X */
  1269. X
  1270. X/*
  1271. X *
  1272. X *  source file:   ./filters/Tests/rastest.c
  1273. X *
  1274. X * Joe Dellinger (SEP), June 11 1987
  1275. X *    Inserted this sample edit history entry.
  1276. X *    Please log any further modifications made to this file:
  1277. X */
  1278. X
  1279. X#include <stdio.h>
  1280. X#include <vplot.h>
  1281. X
  1282. X#define X 200
  1283. X#define Y 200
  1284. X
  1285. main ()
  1286. X{
  1287. int             offset, xpix, ypix, bit, blast;
  1288. float           xll, yll, xur, yur, ppi;
  1289. unsigned char   array[X * Y];
  1290. int             ii, jj;
  1291. X
  1292. X/*
  1293. X * Create a moire pattern
  1294. X */
  1295. X    for (ii = 0; ii < Y; ii++)
  1296. X    {
  1297. X    for (jj = 0; jj < X; jj++)
  1298. X    {
  1299. X        array[X * ii + jj] = ((((ii - 105) * (ii - 95) + (jj - 110) * (jj - 90)) / 77) % 14) + 1;
  1300. X        if (array[X * ii + jj] > 0)
  1301. X        {
  1302. X        if (array[X * ii + jj] % 2 == 1)
  1303. X            array[X * ii + jj] = 0;
  1304. X        array[X * ii + jj] /= 2;
  1305. X        }
  1306. X        else
  1307. X        {
  1308. X        if (array[X * ii + jj] % 2 == -1)
  1309. X            array[X * ii + jj] = 0;
  1310. X        array[X * ii + jj] /= -13;
  1311. X        }
  1312. X    }
  1313. X    }
  1314. X
  1315. X    offset = 0;
  1316. X    xpix = X;
  1317. X    ypix = Y;
  1318. X    bit = 0;
  1319. X    xll = 0.;
  1320. X    yll = 0.;
  1321. X    xur = 10.;
  1322. X    yur = 10.;
  1323. X    ppi = 0;
  1324. X    blast = 0;
  1325. X
  1326. X/*
  1327. X * Set up where you want the vplot output to go.
  1328. X */
  1329. X    vp_filep (stdout);
  1330. X
  1331. X/*
  1332. X * Decide what "style" plot this is to be.
  1333. X */
  1334. X    vp_style (STANDARD);
  1335. X
  1336. X/*
  1337. X * Draw the raster.
  1338. X */
  1339. X    vp_raster (array, blast, bit, offset, xpix, ypix, xll, yll, ppi, &xur, &yur, 0, 1);
  1340. X
  1341. X/*
  1342. X * Draw a thin blue border around the whole thing.
  1343. X */
  1344. X    vp_fat (0);
  1345. X    vp_color (BLUE);
  1346. X
  1347. X/*
  1348. X * (xll,yll) is the lower-leftmost pixel of the raster plot,
  1349. X * and (xur-xll) is the width in vplot units and (yur-yll) is the
  1350. X * height.
  1351. X * If you think about this carefully, you'll see that then (xur,yur)
  1352. X * is not quite the upper-rightmost pixel of the raster plot, but is
  1353. X * one off.
  1354. X * Things were done this way because the height and width are
  1355. X * the real parameters that you want to specify.
  1356. X * Unfortunately it also means that the border isn't exactly symmetrical.
  1357. X */
  1358. X    vp_move (xll, yll);
  1359. X    vp_draw (xll, yur);
  1360. X    vp_draw (xur, yur);
  1361. X    vp_draw (xur, yll);
  1362. X    vp_draw (xll, yll);
  1363. X
  1364. X/*
  1365. X * Finish up
  1366. X */
  1367. X    vp_endplot ();
  1368. X}
  1369. END_OF_FILE
  1370. if test 2440 -ne `wc -c <'Vplot_Kernel/filters/Tests/rastest.c'`; then
  1371.     echo shar: \"'Vplot_Kernel/filters/Tests/rastest.c'\" unpacked with wrong size!
  1372. fi
  1373. # end of 'Vplot_Kernel/filters/Tests/rastest.c'
  1374. fi
  1375. if test -f 'Vplot_Kernel/filters/distribute_to' -a "${1}" != "-c" ; then 
  1376.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/distribute_to'\"
  1377. else
  1378. echo shar: Extracting \"'Vplot_Kernel/filters/distribute_to'\" \(2384 characters\)
  1379. sed "s/^X//" >'Vplot_Kernel/filters/distribute_to' <<'END_OF_FILE'
  1380. X    #!/bin/sh
  1381. X    #
  1382. X    # Distribute Vplot to other machines
  1383. X    # Writes a series of calls to rcp.  Does not create any directories;
  1384. X    # they must already exist.
  1385. X    #
  1386. X    # Usage:
  1387. X    # distribute_to  machine_name
  1388. X    #
  1389. X    # This will produce a file called "Copy_to_machine_name", which you can
  1390. X    # sh to do the actual copying.
  1391. X    #
  1392. X    # You should have a subdirectory in ./machines for each machine name.
  1393. X    # There must exist two files in this directory, called "dirlist"
  1394. X    # and "path". In the file "dirlist" there should be a list of the
  1395. X    # device libraries to put on that machine, one name per line.
  1396. X    # In the file "path" the path to the filters directory on the
  1397. X    # destination machine should be given. (The output of "pwd" on
  1398. X    # that machine if you were in the filters directory.)
  1399. X    # The modification times of the `date' files keeps track of which files
  1400. X    # are out of date on which machines.
  1401. X    #
  1402. X    # This file will not copy machine-dependent files: "params.h",
  1403. X    # "machdep*", "*.a", "*.o", "*.bin". Params.h and machdep* must
  1404. X    # be copied and appropriately modified as needed by hand.
  1405. X    #
  1406. X    # Author - Chuck Karish
  1407. X    # Debugged by Joe Dellinger 12-17-87
  1408. X    #
  1409. X
  1410. if [ $# -ne 1 ]
  1411. then
  1412. X    echo "distribute_to: Wrong number of arguments." 1>&2
  1413. X    echo "Usage: distribute_to machine_name; sh Copy_to_machine_name" 1>&2
  1414. X    exit 1
  1415. fi
  1416. X
  1417. X    if [ ! -r "./machines/$1/dirlist" ]
  1418. X    then
  1419. X        echo "Must have a dirlist file"
  1420. X        exit 1
  1421. X    fi
  1422. X
  1423. X    if [ ! -r "./machines/$1/path" ]
  1424. X    then
  1425. X        echo "Must have a path file"
  1426. X        exit 1
  1427. X    fi
  1428. X
  1429. GENDIRS="genlib include loclib utilities vplib Tests"
  1430. DEVDIRS=`cat ./machines/$1/dirlist | tr '\015' ' '`
  1431. DEVPATH=`cat ./machines/$1/path | tr '\015' ' '`
  1432. X
  1433. rm -f /tmp/Vplot_dist_$$
  1434. X
  1435. for direct in *.c MakeMake* $GENDIRS $DEVDIRS
  1436. do
  1437. X
  1438. X    if [ -r $direct ]
  1439. X    then
  1440. X        other=""
  1441. X    else
  1442. X        other="otherpens/"
  1443. X    fi
  1444. X
  1445. X    if [ -r "./machines/$1/date" ]
  1446. X    then
  1447. X        find $other$direct -type f -newer ./machines/$1/date -print | \
  1448. X            egrep -v "(\\.a\$|\\.o\$|\\.bin|\\.include|params\\.h\$)" >> \
  1449. X            /tmp/Vplot_dist_$$
  1450. X    else
  1451. X        find $other$direct -type f -print | \
  1452. X            egrep -v "(\\.a\$|\\.o\$|\\.bin|\\.include|params\\.h\$)" >> \
  1453. X            /tmp/Vplot_dist_$$
  1454. X    fi
  1455. done
  1456. X
  1457. sed < /tmp/Vplot_dist_$$ -e 's+^\(.*\)$+rcp '`pwd`'/\1 '$1':'$DEVPATH'/\1+' \
  1458. X| sed -e 's+^\(.*\)\(/otherpens\)\(.*\)\(/otherpens\)\(.*\)$+\1\2\3\5+' \
  1459. X> Copy_to_$1
  1460. rm -f /tmp/Vplot_dist_$$
  1461. echo 'touch -f '`pwd`'/machines/'$1'/date' >> Copy_to_$1
  1462. echo "#rm -f Copy_to_$1" >> Copy_to_$1
  1463. END_OF_FILE
  1464. if test 2384 -ne `wc -c <'Vplot_Kernel/filters/distribute_to'`; then
  1465.     echo shar: \"'Vplot_Kernel/filters/distribute_to'\" unpacked with wrong size!
  1466. fi
  1467. chmod +x 'Vplot_Kernel/filters/distribute_to'
  1468. # end of 'Vplot_Kernel/filters/distribute_to'
  1469. fi
  1470. if test -f 'Vplot_Kernel/filters/genlib/genraster.c' -a "${1}" != "-c" ; then 
  1471.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genraster.c'\"
  1472. else
  1473. echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genraster.c'\" \(2360 characters\)
  1474. sed "s/^X//" >'Vplot_Kernel/filters/genlib/genraster.c' <<'END_OF_FILE'
  1475. X/*
  1476. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1477. X * University. Official permission to use this software is included in
  1478. X * the documentation. It authorizes you to use this file for any
  1479. X * non-commercial purpose, provided that this copyright notice is not
  1480. X * removed and that any modifications made to this file are commented
  1481. X * and dated in the style of my example below.
  1482. X */
  1483. X
  1484. X/*
  1485. X *
  1486. X *  source file:   ./filters/genlib/genraster.c
  1487. X *
  1488. X * Joe Dellinger (SEP), June 11 1987
  1489. X *    Inserted this sample edit history entry.
  1490. X *    Please log any further modifications made to this file:
  1491. X * Joe Dellinger Feb 16 1988
  1492. X *    Make number of arguments consistent between smart and dumb forms
  1493. X *    of dev.raster.
  1494. X */
  1495. X
  1496. X#include <stdio.h>
  1497. X#include "../include/extern.h"
  1498. X#include "../include/enum.h"
  1499. X#include "../include/attrcom.h"
  1500. X
  1501. extern int      overlay, cur_color, need_devcolor;
  1502. X
  1503. genraster (count, out_of, xpos, ypos, length, orient, raster, dummy1, dummy2)
  1504. X    int             count, out_of, xpos, ypos, length, orient, dummy1, dummy2;
  1505. X    unsigned char  *raster;
  1506. X{
  1507. int             ii, sign, xy, xrpos, yrpos;
  1508. int             color, start;
  1509. static int      cur_color_save;
  1510. X
  1511. X    switch (orient)
  1512. X    {
  1513. X    case 0:
  1514. X    xrpos = xpos;
  1515. X    yrpos = ypos;
  1516. X    sign = 1;
  1517. X    xy = 0;
  1518. X    break;
  1519. X    case 1:
  1520. X    xrpos = ypos;
  1521. X    yrpos = xpos;
  1522. X    sign = -1;
  1523. X    xy = 1;
  1524. X    break;
  1525. X    case 2:
  1526. X    xrpos = xpos;
  1527. X    yrpos = ypos;
  1528. X    sign = -1;
  1529. X    xy = 0;
  1530. X    break;
  1531. X    case 3:
  1532. X    xrpos = ypos;
  1533. X    yrpos = xpos;
  1534. X    sign = 1;
  1535. X    xy = 1;
  1536. X    break;
  1537. X    }
  1538. X
  1539. X    start = xrpos;
  1540. X    color = raster[0];
  1541. X
  1542. X    if (count == 0)
  1543. X    {
  1544. X    /*
  1545. X     * First time remember the color so we can restore it the last time. 
  1546. X     */
  1547. X    cur_color_save = cur_color;
  1548. X    }
  1549. X
  1550. X    for (ii = 0; ii <= length; ii++)
  1551. X    {
  1552. X    if (ii == length || raster[ii] != color)
  1553. X    {
  1554. X        if (!((overlay == 1) && (color == 0)))
  1555. X        {
  1556. X        if (cur_color != color || need_devcolor)
  1557. X        {
  1558. X            cur_color = color;
  1559. X            dev.attributes (SET_COLOR, cur_color, 0, 0, 0);
  1560. X            need_devcolor = NO;
  1561. X        }
  1562. X        if (xy)
  1563. X            dev.vector (yrpos, start, yrpos, xrpos + sign * (ii - 1), 0, 0);
  1564. X        else
  1565. X            dev.vector (start, yrpos, xrpos + sign * (ii - 1), yrpos, 0, 0);
  1566. X        }
  1567. X        if (ii != length)
  1568. X        {
  1569. X        color = raster[ii];
  1570. X        start = xrpos + sign * ii;
  1571. X        }
  1572. X    }
  1573. X    }
  1574. X
  1575. X    if (count == out_of - 1 && cur_color != cur_color_save)
  1576. X    {
  1577. X    cur_color = cur_color_save;
  1578. X    need_devcolor = YES;
  1579. X    }
  1580. X}
  1581. END_OF_FILE
  1582. if test 2360 -ne `wc -c <'Vplot_Kernel/filters/genlib/genraster.c'`; then
  1583.     echo shar: \"'Vplot_Kernel/filters/genlib/genraster.c'\" unpacked with wrong size!
  1584. fi
  1585. # end of 'Vplot_Kernel/filters/genlib/genraster.c'
  1586. fi
  1587. if test -f 'Vplot_Kernel/filters/genlib/genvector.c' -a "${1}" != "-c" ; then 
  1588.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/genlib/genvector.c'\"
  1589. else
  1590. echo shar: Extracting \"'Vplot_Kernel/filters/genlib/genvector.c'\" \(2430 characters\)
  1591. sed "s/^X//" >'Vplot_Kernel/filters/genlib/genvector.c' <<'END_OF_FILE'
  1592. X/*
  1593. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1594. X * University. Official permission to use this software is included in
  1595. X * the documentation. It authorizes you to use this file for any
  1596. X * non-commercial purpose, provided that this copyright notice is not
  1597. X * removed and that any modifications made to this file are commented
  1598. X * and dated in the style of my example below.
  1599. X */
  1600. X
  1601. X/*
  1602. X *
  1603. X *  source file:   ./filters/genlib/genvector.c
  1604. X *
  1605. X * Joe Dellinger (SEP), June 11 1987
  1606. X *    Inserted this sample edit history entry.
  1607. X *    Please log any further modifications made to this file:
  1608. X */
  1609. X
  1610. X/*
  1611. X * Generic vector routine for devices that don't support fatness.
  1612. X * This version tries to be smart and minimize the "motion of the pen",
  1613. X * and tries to prolong strings of "draws" where possible.
  1614. X */
  1615. X#include <stdio.h>
  1616. X#include "../include/extern.h"
  1617. X#define MOVE 0
  1618. X#define DRAW 1
  1619. X
  1620. extern int      smart_clip;
  1621. extern int      lost;
  1622. extern int      fatvec ();
  1623. X
  1624. genvector (x1, y1, x2, y2, nfat, dashon)
  1625. X    int             x1, y1, x2, y2;
  1626. X    int             nfat, dashon;
  1627. X{
  1628. static int      xlst, ylst;
  1629. int             d1, d2;
  1630. X
  1631. X    if (nfat < 0)
  1632. X    return;
  1633. X
  1634. X    if (dashon)
  1635. X    {
  1636. X    dashvec (x1, y1, x2, y2, nfat, dashon);
  1637. X    return;
  1638. X    }
  1639. X
  1640. X    if (nfat)            /* Recursively calls itself to make fat lines */
  1641. X    {
  1642. X    fatvec (x1, y1, x2, y2, nfat, dashon);
  1643. X    return;
  1644. X    }
  1645. X
  1646. X    /*
  1647. X     * Do clipping 
  1648. X     */
  1649. X    if (!smart_clip)
  1650. X    if (clip (&x1, &y1, &x2, &y2))
  1651. X        return;
  1652. X    /*
  1653. X     * Important special case: Zero-length vector at the end of what you've
  1654. X     * already plotted. Don't need to do anything. 
  1655. X     */
  1656. X    if (x1 == x2 && y1 == y2 && !lost && x1 == xlst && y1 == ylst)
  1657. X    {
  1658. X    return;
  1659. X    }
  1660. X
  1661. X    /*
  1662. X     * Minimize movement of "pen" 
  1663. X     */
  1664. X    if (!lost)
  1665. X    {
  1666. X    d1 = abs (x1 - xlst) + abs (y1 - ylst);
  1667. X    d2 = abs (x2 - xlst) + abs (y2 - ylst);
  1668. X    if (d2 < d1)
  1669. X    {
  1670. X        d1 = x1;
  1671. X        d2 = y1;
  1672. X        x1 = x2;
  1673. X        y1 = y2;
  1674. X        x2 = d1;
  1675. X        y2 = d2;
  1676. X    }
  1677. X    }
  1678. X
  1679. X    if ((x1 != xlst) || (y1 != ylst) || lost)
  1680. X    {
  1681. X    /* Make sure it is a move, not a draw */
  1682. X    if (!lost && abs (x1 - xlst) <= 1 && abs (y1 - ylst) <= 1)
  1683. X    {
  1684. X        /*
  1685. X         * We're within one pixel, so go ahead and draw a vector to the
  1686. X         * new point. This avoids having to leave and re-enter vector
  1687. X         * mode. 
  1688. X         */
  1689. X        dev.plot (x1, y1, DRAW);
  1690. X    }
  1691. X    else
  1692. X    {
  1693. X        dev.plot (x1, y1, MOVE);
  1694. X    }
  1695. X    }
  1696. X    dev.plot (x2, y2, DRAW);
  1697. X    xlst = x2;
  1698. X    ylst = y2;
  1699. X}
  1700. END_OF_FILE
  1701. if test 2430 -ne `wc -c <'Vplot_Kernel/filters/genlib/genvector.c'`; then
  1702.     echo shar: \"'Vplot_Kernel/filters/genlib/genvector.c'\" unpacked with wrong size!
  1703. fi
  1704. # end of 'Vplot_Kernel/filters/genlib/genvector.c'
  1705. fi
  1706. if test -f 'Vplot_Kernel/filters/include/params.h' -a "${1}" != "-c" ; then 
  1707.   echo shar: Will not clobber existing file \"'Vplot_Kernel/filters/include/params.h'\"
  1708. else
  1709. echo shar: Extracting \"'Vplot_Kernel/filters/include/params.h'\" \(2043 characters\)
  1710. sed "s/^X//" >'Vplot_Kernel/filters/include/params.h' <<'END_OF_FILE'
  1711. X/*
  1712. X * All machine dependencies should go in here!
  1713. X */
  1714. X#define STYLE STANDARD
  1715. X#define IPEN_SPOOL  "/scr/tmp"
  1716. X#define LPR_SPOOL  "/scr/tmp"
  1717. X#define PSPEN_SPOOL "/scr/tmp"
  1718. X#define LASER1_SPOOL "/scr/tmp"
  1719. X#define LASER2_SPOOL "/scr/tmp"
  1720. X
  1721. X/* The path in the next line must end with a slash ('/'). */
  1722. X#define SYSTEM_FONT_DIRECTORY "/usr/src/graphics/vplot/filters/include/vplotfonts/"
  1723. X
  1724. X#define DEFAULT_COLOR     7
  1725. X#define DEFAULT_LINESTYLE 0
  1726. X#define DEFAULT_FONT    0
  1727. X#define DEFAULT_HARDCOPY_FONT    3
  1728. X#define DEFAULT_PREC    0
  1729. X#define DEFAULT_HARDCOPY_PREC    2
  1730. X
  1731. X/*
  1732. X * Ratio of fatness to size for symbols
  1733. X * (ie, how fat will a 1 inch tall symbol's strokes be, in inches?)
  1734. X */
  1735. X#define SYMBFATRATIO    .05
  1736. X
  1737. X/*
  1738. X * These two get re-allocated larger as needed automatically in dovplot.c,
  1739. X * but it's a good idea to start out large enough that that doesn't have
  1740. X * to be done very often
  1741. X */
  1742. X#define TXBUFLEN 250    /* Initial max length of a text string */
  1743. X#define VXBUFLEN 250    /* Initial max number of vertices in a polygon */
  1744. X
  1745. X/*
  1746. X * This is the factor we scale our path and up vectors by before
  1747. X * running them through the local text coordinate transformation.
  1748. X * (The coordinate transformation, being in terms of device units,
  1749. X * gets done in integers. If we don't scale up we get severe roundoff
  1750. X * problems for small text sizes at odd angles. We can't make this
  1751. X * factor too big, though, or we risk very large text overflowing
  1752. X * the maximum possible integer.)
  1753. X */
  1754. X#define TEXTVECSCALE    10.
  1755. X
  1756. X#define FONTCHECK -1987 /* Magic number that identifies font files */
  1757. X#define NHATCH    20     /* Maximum number of lines in a hatch pattern */
  1758. X#define MAX_COL 511    /* Maximum color table number, maximum color number */
  1759. X#define NPAT    512    /* Maximum internal pattern number, MAX_COL + 1 */
  1760. X#define MAXDASH 10    /* Maximum number of dot-dashes */
  1761. X#define MAX_GUN    255    /* Maximum color gun strength */
  1762. X#define NUMGENFONT 100  /* Number of fonts reserved for gentext fonts */
  1763. X#define MAXIN    20    /* Maximum number of input plot files */
  1764. X#define MAXFLEN    120    /* Maximum length of a file name */
  1765. END_OF_FILE
  1766. if test 2043 -ne `wc -c <'Vplot_Kernel/filters/include/params.h'`; then
  1767.     echo shar: \"'Vplot_Kernel/filters/include/params.h'\" unpacked with wrong size!
  1768. fi
  1769. # end of 'Vplot_Kernel/filters/include/params.h'
  1770. fi
  1771. if test -f 'Vplot_Kernel/lvplot/vp_arrow.c' -a "${1}" != "-c" ; then 
  1772.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_arrow.c'\"
  1773. else
  1774. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_arrow.c'\" \(2273 characters\)
  1775. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_arrow.c' <<'END_OF_FILE'
  1776. X/*
  1777. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1778. X * University. Official permission to use this software is included in
  1779. X * the documentation. It authorizes you to use this file for any
  1780. X * non-commercial purpose, provided that this copyright notice is not
  1781. X * removed and that any modifications made to this file are commented
  1782. X * and dated in the style of my example below.
  1783. X */
  1784. X
  1785. X/*
  1786. X *
  1787. X *  source file:   ./lvplot/vp_arrow.c
  1788. X *
  1789. X * Joe Dellinger (SEP), June 11 1987
  1790. X *    Inserted this sample edit history entry.
  1791. X *    Please log any further modifications made to this file:
  1792. X */
  1793. X
  1794. X#include <vplot.h>
  1795. X#include <math.h>
  1796. X#define pio4 0.785398
  1797. X
  1798. X#ifdef FORTRAN
  1799. X
  1800. X#ifndef UUU
  1801. X#define ARROW vparrow_
  1802. X#else UUU
  1803. X#define ARROW vpuarrow_
  1804. X#endif UUU
  1805. X#define X0    *x0
  1806. X#define Y0    *y0
  1807. X#define X    *x
  1808. X#define Y    *y
  1809. X#define R    *r
  1810. X
  1811. X#else
  1812. X
  1813. X#ifndef UUU
  1814. X#define ARROW vp_arrow
  1815. X#else UUU
  1816. X#define ARROW vp_uarrow
  1817. X#endif UUU
  1818. X#define X0    x0
  1819. X#define Y0    y0
  1820. X#define X    x
  1821. X#define Y    y
  1822. X#define R    r
  1823. X
  1824. X#endif
  1825. X
  1826. ARROW (x0, y0, x, y, r)
  1827. X/*
  1828. X * plot an arrow from (x0,y0) to (x,y) with arrow-size r
  1829. X */
  1830. X    float           X0, Y0, X, Y, R;
  1831. X{
  1832. float           beta, alpha, xp[4], yp[4], rr;
  1833. int             flag = 0;
  1834. X
  1835. X    if (R < 0.)
  1836. X    {
  1837. X    rr = -(R);
  1838. X    flag = 1;
  1839. X    }
  1840. X    else
  1841. X    rr = R;
  1842. X
  1843. X    if (X == X0 && Y == Y0)
  1844. X    {
  1845. X    xp[0] = X - rr / 3.;
  1846. X    yp[0] = Y - rr / 3.;
  1847. X    xp[1] = X - rr / 3.;
  1848. X    yp[1] = Y + rr / 3.;
  1849. X    xp[2] = X + rr / 3.;
  1850. X    yp[2] = Y + rr / 3.;
  1851. X    xp[3] = X + rr / 3.;
  1852. X    yp[3] = Y - rr / 3.;
  1853. X    if (flag)
  1854. X#ifndef UUU
  1855. X        vp_area (xp, yp, 4, 0, 0, 0);
  1856. X#else UUU
  1857. X        vp_uarea (xp, yp, 4, 0, 0, 0);
  1858. X#endif UUU
  1859. X    else
  1860. X#ifndef UUU
  1861. X        vp_area (xp, yp, 4, 0, 1, 1);
  1862. X#else UUU
  1863. X        vp_uarea (xp, yp, 4, 0, 1, 1);
  1864. X#endif UUU
  1865. X    }
  1866. X    else
  1867. X    {
  1868. X#ifndef UUU
  1869. X    vp_move (X0, Y0);
  1870. X    vp_draw (X, Y);
  1871. X#else UUU
  1872. X    vp_umove (X0, Y0);
  1873. X    vp_udraw (X, Y);
  1874. X#endif UUU
  1875. X
  1876. X    beta = atan2 (Y - Y0, X - X0);
  1877. X
  1878. X    xp[0] = X;
  1879. X    yp[0] = Y;
  1880. X    alpha = pio4 + beta;
  1881. X    xp[1] = X - rr * cos (alpha);
  1882. X    yp[1] = Y - rr * sin (alpha);
  1883. X    alpha = pio4 - beta;
  1884. X    xp[2] = X - rr * cos (alpha);
  1885. X    yp[2] = Y + rr * sin (alpha);
  1886. X    if (flag)
  1887. X#ifndef UUU
  1888. X        vp_area (xp, yp, 3, 0, 0, 0);
  1889. X#else UUU
  1890. X        vp_uarea (xp, yp, 3, 0, 0, 0);
  1891. X#endif UUU
  1892. X    else
  1893. X#ifndef UUU
  1894. X        vp_area (xp, yp, 3, 0, 1, 1);
  1895. X#else UUU
  1896. X        vp_uarea (xp, yp, 3, 0, 1, 1);
  1897. X#endif UUU
  1898. X    }
  1899. X}
  1900. END_OF_FILE
  1901. if test 2273 -ne `wc -c <'Vplot_Kernel/lvplot/vp_arrow.c'`; then
  1902.     echo shar: \"'Vplot_Kernel/lvplot/vp_arrow.c'\" unpacked with wrong size!
  1903. fi
  1904. # end of 'Vplot_Kernel/lvplot/vp_arrow.c'
  1905. fi
  1906. if test -f 'Vplot_Kernel/lvplot/vp_gtext.c' -a "${1}" != "-c" ; then 
  1907.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_gtext.c'\"
  1908. else
  1909. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_gtext.c'\" \(2090 characters\)
  1910. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_gtext.c' <<'END_OF_FILE'
  1911. X/*
  1912. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  1913. X * University. Official permission to use this software is included in
  1914. X * the documentation. It authorizes you to use this file for any
  1915. X * non-commercial purpose, provided that this copyright notice is not
  1916. X * removed and that any modifications made to this file are commented
  1917. X * and dated in the style of my example below.
  1918. X */
  1919. X
  1920. X/*
  1921. X *
  1922. X *  source file:   ./lvplot/vp_gtext.c
  1923. X *
  1924. X * Joe Dellinger (SEP), Jan 14 1988
  1925. X *    Inserted this sample edit history entry.
  1926. X *    Please log any further modifications made to this file:
  1927. X *
  1928. X */
  1929. X
  1930. X#include <stdio.h>
  1931. X#include <vplot.h>
  1932. X#include "params.h"
  1933. X#include "round.h"
  1934. X#include "vp_pc.h"
  1935. X
  1936. X#ifdef FORTRAN
  1937. X
  1938. X#define TEXT    vpwgtext_
  1939. X#define X        *x
  1940. X#define Y        *y
  1941. X#define XPATH        *xpath
  1942. X#define YPATH        *ypath
  1943. X#define XUP        *xup
  1944. X#define YUP        *yup
  1945. X
  1946. X#else
  1947. X
  1948. X#define TEXT    vp_gtext
  1949. X#define X        x
  1950. X#define Y        y
  1951. X#define XPATH        xpath
  1952. X#define YPATH        ypath
  1953. X#define XUP        xup
  1954. X#define YUP        yup
  1955. X
  1956. X#endif
  1957. X
  1958. X#ifdef FORTRAN
  1959. TEXT (x, y, xpath, ypath, xup, yup, string, nchars)
  1960. X#else
  1961. TEXT (x, y, xpath, ypath, xup, yup, string)
  1962. X#endif
  1963. X    float           X, Y;
  1964. X    float           XPATH, YPATH;
  1965. X    float           XUP, YUP;
  1966. X    char           *string;
  1967. X#ifdef FORTRAN
  1968. X    int            *nchars;
  1969. X#endif
  1970. X{
  1971. X#ifdef FORTRAN
  1972. int             i, length;
  1973. X#endif
  1974. X
  1975. X    p_pout (X, Y, 0, vp_pc._pltout);
  1976. X    putc (VP_GTEXT, vp_pc._pltout);
  1977. X    puth (ROUND (TEXTVECSCALE * XPATH * RPERIN), vp_pc._pltout);
  1978. X    puth (ROUND (TEXTVECSCALE * YPATH * RPERIN), vp_pc._pltout);
  1979. X    puth (ROUND (TEXTVECSCALE * XUP * RPERIN), vp_pc._pltout);
  1980. X    puth (ROUND (TEXTVECSCALE * YUP * RPERIN), vp_pc._pltout);
  1981. X
  1982. X#ifdef FORTRAN
  1983. X/*
  1984. X * Try to still work even if they didn't specify nchars.
  1985. X */
  1986. X    length = 80;
  1987. X    if (nchars != NULL)
  1988. X    {
  1989. X    if (*nchars >= 0)
  1990. X        length = *nchars;
  1991. X    }
  1992. X
  1993. X    for (i = 0; i < length; i++)
  1994. X    {
  1995. X    if (*(string + i) == '\0')
  1996. X        break;
  1997. X    putc (*(string + i), vp_pc._pltout);
  1998. X    }
  1999. X    putc ('\0', vp_pc._pltout);
  2000. X#else FORTRAN
  2001. X    do
  2002. X    {
  2003. X    putc (*string, vp_pc._pltout);
  2004. X    }
  2005. X    while (*string++);
  2006. X#endif FORTRAN
  2007. X}
  2008. END_OF_FILE
  2009. if test 2090 -ne `wc -c <'Vplot_Kernel/lvplot/vp_gtext.c'`; then
  2010.     echo shar: \"'Vplot_Kernel/lvplot/vp_gtext.c'\" unpacked with wrong size!
  2011. fi
  2012. # end of 'Vplot_Kernel/lvplot/vp_gtext.c'
  2013. fi
  2014. if test -f 'Vplot_Kernel/lvplot/vp_text.c' -a "${1}" != "-c" ; then 
  2015.   echo shar: Will not clobber existing file \"'Vplot_Kernel/lvplot/vp_text.c'\"
  2016. else
  2017. echo shar: Extracting \"'Vplot_Kernel/lvplot/vp_text.c'\" \(2050 characters\)
  2018. sed "s/^X//" >'Vplot_Kernel/lvplot/vp_text.c' <<'END_OF_FILE'
  2019. X/*
  2020. X * Copyright 1987 the Board of Trustees of the Leland Stanford Junior
  2021. X * University. Official permission to use this software is included in
  2022. X * the documentation. It authorizes you to use this file for any
  2023. X * non-commercial purpose, provided that this copyright notice is not
  2024. X * removed and that any modifications made to this file are commented
  2025. X * and dated in the style of my example below.
  2026. X */
  2027. X
  2028. X/*
  2029. X *
  2030. X *  source file:   ./lvplot/vp_text.c
  2031. X *
  2032. X * Joe Dellinger (SEP), June 11 1987
  2033. X *    Inserted this sample edit history entry.
  2034. X *    Please log any further modifications made to this file:
  2035. X *
  2036. X * Joe Dellinger Oct 17 1987
  2037. X *    Made Fortran and C calling arguments match.
  2038. X *
  2039. X * Joe Dellinger Dec 7 1987
  2040. X *    Transferred handling of the text justification and font
  2041. X *    to the routines where you'd expect that to get handled,
  2042. X *    instead of only updating that when this routine is called.
  2043. X */
  2044. X
  2045. X#include <stdio.h>
  2046. X#include <vplot.h>
  2047. X#include "vp_pc.h"
  2048. X
  2049. X#ifdef FORTRAN
  2050. X
  2051. X#define TEXT    vpwtext_
  2052. X#define X        *x
  2053. X#define Y        *y
  2054. X#define SIZE    *size
  2055. X#define ORIENT    *orient
  2056. X
  2057. X#else
  2058. X
  2059. X#define TEXT    vp_text
  2060. X#define X        x
  2061. X#define Y        y
  2062. X#define SIZE    size
  2063. X#define ORIENT    orient
  2064. X
  2065. X#endif
  2066. X
  2067. X#ifdef FORTRAN
  2068. TEXT (x, y, size, orient, string, nchars)
  2069. X#else
  2070. TEXT (x, y, size, orient, string)
  2071. X#endif
  2072. X    float           X, Y;
  2073. X    int             SIZE, ORIENT;
  2074. X    char           *string;
  2075. X#ifdef FORTRAN
  2076. X    int            *nchars;
  2077. X#endif
  2078. X{
  2079. X#ifdef FORTRAN
  2080. int             i, length;
  2081. X#endif
  2082. X
  2083. X    if (SIZE == 0)
  2084. X    return;
  2085. X
  2086. X    p_pout (X, Y, 0, vp_pc._pltout);
  2087. X    putc (VP_TEXT, vp_pc._pltout);
  2088. X    puth (SIZE, vp_pc._pltout);
  2089. X    puth (ORIENT, vp_pc._pltout);
  2090. X
  2091. X#ifdef FORTRAN
  2092. X/*
  2093. X * Try to still work even if they didn't specify nchars.
  2094. X */
  2095. X    length = 80;
  2096. X    if (nchars != NULL)
  2097. X    {
  2098. X    if (*nchars >= 0)
  2099. X        length = *nchars;
  2100. X    }
  2101. X
  2102. X    for (i = 0; i < length; i++)
  2103. X    {
  2104. X    if (*(string + i) == '\0')
  2105. X        break;
  2106. X    putc (*(string + i), vp_pc._pltout);
  2107. X    }
  2108. X    putc ('\0', vp_pc._pltout);
  2109. X#else FORTRAN
  2110. X    do
  2111. X    {
  2112. X    putc (*string, vp_pc._pltout);
  2113. X    }
  2114. X    while (*string++);
  2115. X#endif FORTRAN
  2116. X}
  2117. END_OF_FILE
  2118. if test 2050 -ne `wc -c <'Vplot_Kernel/lvplot/vp_text.c'`; then
  2119.     echo shar: \"'Vplot_Kernel/lvplot/vp_text.c'\" unpacked with wrong size!
  2120. fi
  2121. # end of 'Vplot_Kernel/lvplot/vp_text.c'
  2122. fi
  2123. echo shar: End of archive 9 \(of 24\).
  2124. cp /dev/null ark9isdone
  2125. MISSING=""
  2126. 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
  2127.     if test ! -f ark${I}isdone ; then
  2128.     MISSING="${MISSING} ${I}"
  2129.     fi
  2130. done
  2131. if test "${MISSING}" = "" ; then
  2132.     echo You have unpacked all 24 archives.
  2133.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2134. else
  2135.     echo You still need to unpack the following archives:
  2136.     echo "        " ${MISSING}
  2137. fi
  2138. ##  End of shell archive.
  2139. exit 0
  2140.