home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 334_02 / iris4d.trm < prev    next >
Text File  |  1991-02-05  |  2KB  |  117 lines

  1. /* GNUPLOT - iris4d.trm */
  2. /*
  3.  * Copyright (C) 1990   
  4.  *
  5.  * Permission to use, copy, and distribute this software and its
  6.  * documentation for any purpose with or without fee is hereby granted, 
  7.  * provided that the above copyright notice appear in all copies and 
  8.  * that both that copyright notice and this permission notice appear 
  9.  * in supporting documentation.
  10.  *
  11.  * Permission to modify the software is granted, but not the right to
  12.  * distribute the modified code.  Modifications are to be distributed 
  13.  * as patches to released version.
  14.  *  
  15.  * This software  is provided "as is" without express or implied warranty.
  16.  * 
  17.  * This file is included by ../term.c.
  18.  *
  19.  * This terminal driver supports:
  20.  *   IRIS terminals
  21.  *
  22.  * AUTHORS
  23.  *   John H. Merritt 
  24.  *           (Applied Research Corporation) 7/1/89
  25.  *           INTERNET: merritt@iris613.gsfc.nasa.gov
  26.  * 
  27.  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  28.  * 
  29.  */
  30.  
  31. #include <gl.h>
  32. #define IRIS4D_XMAX 1024
  33. #define IRIS4D_YMAX 1024
  34.  
  35. #define IRIS4D_XLAST (IRIS4D_XMAX - 1)
  36. #define IRIS4D_YLAST (IRIS4D_YMAX - 1)
  37.  
  38. #define IRIS4D_VCHAR (IRIS4D_YMAX/30)
  39. #define IRIS4D_HCHAR (IRIS4D_XMAX/72)
  40. #define IRIS4D_VTIC (IRIS4D_YMAX/80)
  41. #define IRIS4D_HTIC (IRIS4D_XMAX/80)
  42.  
  43. IRIS4D_init()
  44. {
  45.   foreground();
  46.   winopen("Gnuplot");
  47.   deflinestyle(1, 0x3FFF); /* Long dash */
  48.   deflinestyle(2, 0x5555); /* dotted */
  49.   deflinestyle(3, 0x3333); /* short dash */
  50.   deflinestyle(4, 0xB5AD); /* dotdashed */
  51.   return;
  52. }
  53.  
  54. IRIS4D_graphics()
  55. {
  56.   reshapeviewport();
  57.   ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
  58.   color(WHITE);
  59.   clear();
  60.   
  61.   return;
  62. }
  63.  
  64. IRIS4D_text()
  65. {
  66.   return; /* enter text from another window!!! */
  67. }
  68.  
  69. IRIS4D_linetype(linetype)
  70. int linetype;
  71. {
  72.   static int pen_color[5] = {1, 2, 3, 4, 5};
  73.   
  74.   linetype = linetype % 5;
  75.   color((Colorindex) pen_color[linetype]);
  76.   setlinestyle(linetype);
  77.   return;
  78. }
  79.  
  80. IRIS4D_move(x, y)
  81. unsigned int x, y;
  82. {
  83.   move2i(x, y);
  84.   return;
  85. }
  86.  
  87. IRIS4D_cmove(x, y)
  88. unsigned int x, y;
  89. {
  90.   cmov2i(x, y);
  91.   return;
  92. }
  93.  
  94. IRIS4D_vector(x, y)
  95. unsigned x, y;
  96. {
  97.   draw2i(x, y);
  98.   return;
  99. }
  100.  
  101.  
  102. IRIS4D_put_text(x,y,str)
  103. int x, y;
  104. char *str;
  105. {
  106.   IRIS4D_cmove(x,y - IRIS4D_VCHAR/2);
  107.   charstr(str);
  108.   return;
  109. }
  110.  
  111.  
  112. IRIS4D_reset()
  113. {
  114.   return;
  115. }
  116.  
  117.