home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / gnuplot.iris4d < prev    next >
Encoding:
Text File  |  1989-07-08  |  3.4 KB  |  144 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. Subject: v07i067: IRIS4D version of GNUplot
  4. Reply-To: merritt@iris613.gsfc.nasa.gov (John H Merritt)
  5. Distribution: world
  6. Organization: Goddard Space Flight Center Climate and Radiation Branch
  7.  
  8. Posting-number: Volume 7, Issue 67
  9. Submitted-by: merritt@iris613.gsfc.nasa.gov (John H Merritt)
  10. Archive-name: gnuplot.iris4d
  11.  
  12. [...now all we have to do is figure out how to wedge *this* into the
  13. patch-handling system....  ++bsa]
  14.  
  15. Here are the additions to GNUplot so it runs on an IRIS4D series computer.
  16. Don't forget to compile with -DIRIS4D and include -Zg as one of the
  17. libraries.  The window that the plot goes to can be reshaped and moved, but
  18. you will have to replot the data.
  19.  
  20. +----------------------------------+-----------------------------+
  21. |John H. Merritt                   |  Yesterday I knew nothing,  |
  22. |Applied Research Corporation      |  Today I know that.         |
  23. |merritt@iris613.gsfc.nasa.gov     |                             |
  24. +----------------------------------+-----------------------------+
  25.  
  26. ----------------------------------------------------------
  27. ------------ place following in struct termentry ---------
  28. ------------ daffynition near bottom of term.c   ---------
  29. ----------------------------------------------------------
  30. #ifdef IRIS4D
  31.     ,{"iris4d", IRIS4D_XMAX, IRIS4D_YMAX, IRIS4D_VCHAR,
  32.         IRIS4D_HCHAR, IRIS4D_VTIC, IRIS4D_HTIC,
  33.         IRIS4D_init, IRIS4D_reset, IRIS4D_text,
  34.         IRIS4D_graphics, IRIS4D_move, IRIS4D_vector,
  35.         IRIS4D_linetype, IRIS4D_lrput_text, IRIS4D_ulput_text,
  36.         do_point}
  37. #endif
  38.  
  39. ------------------------------------------------------------
  40. ------------ place following anywhere in term.c ------------
  41. ------------------------------------------------------------
  42. #ifdef IRIS4D
  43.  
  44. /* Provided by John H. Merritt (Applied Research Corporation) 7/1/89 */
  45. /* INTERNET: merritt@iris613.gsfc.nasa.gov */
  46.  
  47. #include <gl.h>
  48. #define IRIS4D_XMAX 1024
  49. #define IRIS4D_YMAX 1024
  50.  
  51. #define IRIS4D_XLAST (IRIS4D_XMAX - 1)
  52. #define IRIS4D_YLAST (IRIS4D_YMAX - 1)
  53.  
  54. #define IRIS4D_VCHAR (IRIS4D_YMAX/30)
  55. #define IRIS4D_HCHAR (IRIS4D_XMAX/72)
  56. #define IRIS4D_VTIC (IRIS4D_YMAX/80)
  57. #define IRIS4D_HTIC (IRIS4D_XMAX/80)
  58.  
  59. IRIS4D_init()
  60. {
  61.   foreground();
  62.   winopen("Gnuplot");
  63.   deflinestyle(1, 0x3FFF); /* Long dash */
  64.   deflinestyle(2, 0x5555); /* dotted */
  65.   deflinestyle(3, 0x3333); /* short dash */
  66.   deflinestyle(4, 0xB5AD); /* dotdashed */
  67.   return;
  68. }
  69.  
  70. IRIS4D_graphics()
  71. {
  72.   reshapeviewport();
  73.   ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
  74.   color(WHITE);
  75.   clear();
  76.   
  77.   return;
  78. }
  79.  
  80. IRIS4D_text()
  81. {
  82.   return; /* enter text from another window!!! */
  83. }
  84.  
  85. IRIS4D_linetype(linetype)
  86. int linetype;
  87. {
  88.   static int pen_color[5] = {1, 2, 3, 4, 5};
  89.   
  90.   linetype = linetype % 5;
  91.   color((Colorindex) pen_color[linetype]);
  92.   setlinestyle(linetype);
  93.   return;
  94. }
  95.  
  96. IRIS4D_move(x, y)
  97. unsigned int x, y;
  98. {
  99.   move2i(x, y);
  100.   return;
  101. }
  102.  
  103. IRIS4D_cmove(x, y)
  104. unsigned int x, y;
  105. {
  106.   cmov2i(x, y);
  107.   return;
  108. }
  109.  
  110. IRIS4D_vector(x, y)
  111. unsigned x, y;
  112. {
  113.   draw2i(x, y);
  114.   return;
  115. }
  116.  
  117. IRIS4D_lrput_text(row, str)
  118. unsigned int row;
  119. char *str;
  120. {
  121.   IRIS4D_cmove(IRIS4D_XMAX - IRIS4D_HTIC - IRIS4D_HCHAR*(strlen(str)+1),
  122.           IRIS4D_VTIC + IRIS4D_VCHAR*(row+1)) ;
  123.   charstr(str);
  124.   return;
  125. }
  126.  
  127.  
  128. IRIS4D_ulput_text(row,str)
  129. unsigned int row ;
  130. char *str ;
  131. {
  132.   IRIS4D_cmove(IRIS4D_HTIC, IRIS4D_YMAX - IRIS4D_VTIC - IRIS4D_VCHAR*(row+1)) ;
  133.   charstr(str);
  134.   return;
  135. }
  136.  
  137. IRIS4D_reset()
  138. {
  139.   return;
  140. }
  141.  
  142. #endif /* IRIS4D */
  143.  
  144.