home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume07 / gnuplot.irs < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  3.8 KB

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