home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume8 / gnuplot1.10A / part02 / iris4d.trm < prev    next >
Encoding:
Text File  |  1989-09-09  |  2.2 KB  |  111 lines

  1. /*
  2. Here are the additions to GNUplot so it runs on an IRIS4D series computer.
  3. Don't forget to compile with -DIRIS4D and include -Zg as one of the
  4. libraries.  The window that the plot goes to can be reshaped and moved, but
  5. you will have to replot the data.
  6.  
  7. +----------------------------------+-----------------------------+
  8. |John H. Merritt                   |  Yesterday I knew nothing,  |
  9. |Applied Research Corporation      |  Today I know that.         |
  10. |merritt@iris613.gsfc.nasa.gov     |                             |
  11. +----------------------------------+-----------------------------+
  12. */
  13.  
  14. /* Provided by John H. Merritt (Applied Research Corporation) 7/1/89 */
  15. /* INTERNET: merritt@iris613.gsfc.nasa.gov */
  16.  
  17. #include <gl.h>
  18. #define IRIS4D_XMAX 1024
  19. #define IRIS4D_YMAX 1024
  20.  
  21. #define IRIS4D_XLAST (IRIS4D_XMAX - 1)
  22. #define IRIS4D_YLAST (IRIS4D_YMAX - 1)
  23.  
  24. #define IRIS4D_VCHAR (IRIS4D_YMAX/30)
  25. #define IRIS4D_HCHAR (IRIS4D_XMAX/72)
  26. #define IRIS4D_VTIC (IRIS4D_YMAX/80)
  27. #define IRIS4D_HTIC (IRIS4D_XMAX/80)
  28.  
  29. IRIS4D_init()
  30. {
  31.   foreground();
  32.   winopen("Gnuplot");
  33.   deflinestyle(1, 0x3FFF); /* Long dash */
  34.   deflinestyle(2, 0x5555); /* dotted */
  35.   deflinestyle(3, 0x3333); /* short dash */
  36.   deflinestyle(4, 0xB5AD); /* dotdashed */
  37.   return;
  38. }
  39.  
  40. IRIS4D_graphics()
  41. {
  42.   reshapeviewport();
  43.   ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
  44.   color(WHITE);
  45.   clear();
  46.   
  47.   return;
  48. }
  49.  
  50. IRIS4D_text()
  51. {
  52.   return; /* enter text from another window!!! */
  53. }
  54.  
  55. IRIS4D_linetype(linetype)
  56. int linetype;
  57. {
  58.   static int pen_color[5] = {1, 2, 3, 4, 5};
  59.   
  60.   linetype = linetype % 5;
  61.   color((Colorindex) pen_color[linetype]);
  62.   setlinestyle(linetype);
  63.   return;
  64. }
  65.  
  66. IRIS4D_move(x, y)
  67. unsigned int x, y;
  68. {
  69.   move2i(x, y);
  70.   return;
  71. }
  72.  
  73. IRIS4D_cmove(x, y)
  74. unsigned int x, y;
  75. {
  76.   cmov2i(x, y);
  77.   return;
  78. }
  79.  
  80. IRIS4D_vector(x, y)
  81. unsigned x, y;
  82. {
  83.   draw2i(x, y);
  84.   return;
  85. }
  86.  
  87. IRIS4D_lrput_text(row, str)
  88. unsigned int row;
  89. char *str;
  90. {
  91.   IRIS4D_cmove(IRIS4D_XMAX - IRIS4D_HTIC - IRIS4D_HCHAR*(strlen(str)+1),
  92.           IRIS4D_VTIC + IRIS4D_VCHAR*(row+1)) ;
  93.   charstr(str);
  94.   return;
  95. }
  96.  
  97.  
  98. IRIS4D_ulput_text(row,str)
  99. unsigned int row ;
  100. char *str ;
  101. {
  102.   IRIS4D_cmove(IRIS4D_HTIC, IRIS4D_YMAX - IRIS4D_VTIC - IRIS4D_VCHAR*(row+1)) ;
  103.   charstr(str);
  104.   return;
  105. }
  106.  
  107. IRIS4D_reset()
  108. {
  109.   return;
  110. }
  111.