home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / pcgraphc.zip / LIN_DEMO.C < prev    next >
C/C++ Source or Header  |  1988-12-26  |  2KB  |  116 lines

  1. #include <stdio.h>
  2. #include "graph.h"
  3. #include <math.h>
  4.  
  5. main()
  6.     {
  7.     int mode;
  8.     double re, im, a, x, y, xt, d_to_r, lab_y;
  9.     char *idx;
  10.  
  11.     mode = CGA_320x200;        /* CGA 640x200 BW */
  12.  
  13.     g_init (mode);            /* select graphics mode: default pen = 1, lable origin = 1 */
  14.     if (ratio () < 1)
  15.         lab_y = 95 * ratio ();    /* 100 gdu's in horizontal direction */
  16.     else
  17.         lab_y = 95;        /* 100 gdu's in vertical direction */
  18.     move (0,0);
  19.     csize (3,0,0);            /* change size of label */
  20.     labelf ("Default Hard Clip Limit");
  21.     line_type (3, 10);
  22.     frame ();            /* frame hard clip limit */
  23.     limit (8.0, 210.0, 13, 150);    /* set new hard clip limits (mm's) */
  24.     line_type (1,0);
  25.     move (0, 0);
  26.     labelf ("New Hard Clip Limit");
  27.     line_type (4,0);
  28.     frame ();            /* frame new hard clip limit */
  29.     line_type (1,0);
  30.     lorg (1);
  31.     move (10, 10);
  32.     csize (2.8,0,0);
  33.     labelf ("Viewport & Soft Clip Limit");
  34.     move (10,90);
  35.     csize (4,0,0);
  36.     labelf ("Line Types and Labels");
  37.     csize (4,0,0);
  38.     ldir (0);
  39.     move (70,0);
  40.     labelf ("Horizontal ");        /* labels */
  41.     ldir (45);
  42.     labelf ("Diagonal ");
  43.     ldir (90);
  44.     labelf ("Vertical");
  45.     locate (10.0, 95.0, 10.0, 90.0 );    /* units in gdu's */
  46.     line_type (5,0);
  47.     frame ();            /* frame locate window */
  48.     show (0, 80.0, 0, 120.0);    /* isotropic scaling */
  49.                     /* changes from gdu's to udu's */
  50.     csize (3,0,0);
  51.     ldir (0);
  52.     lorg (8);
  53.     line_type (1,0);
  54.     move (15,15);
  55.     labelf ("type 1");
  56.     move (15,15);
  57.     draw (65,15);
  58.     line_type (1,0);
  59.     move (15,25);
  60.     labelf ("type 2");
  61.     line_type (2,0);
  62.     move (15,25);
  63.     draw (65,25);
  64.     line_type (1,0);
  65.     move (15,35);
  66.     labelf ("type 3");
  67.     line_type (3,0);
  68.     move (15,35);
  69.     draw (65,35);
  70.     line_type (1,0);
  71.     move (15,45);
  72.     labelf ("type 4");
  73.     line_type (4,0);
  74.     move (15,45);
  75.     draw (65,45);
  76.     line_type (1,0);
  77.     move (15,55);
  78.     labelf ("type 5");
  79.     line_type (5,0);
  80.     move (15,55);
  81.     draw (65,55);
  82.     line_type (1,0);
  83.     move (15,65);
  84.     labelf ("type 6");
  85.     line_type (6,0);
  86.     move (15,65);
  87.     draw (65,65);
  88.     line_type (1,0);
  89.     move (15,75);
  90.     labelf ("type 7");
  91.     line_type (7,0);
  92.     move (15,75);
  93.     draw (65,75);
  94.     line_type (1,0);
  95.     move (15,85);
  96.     labelf ("type 8");
  97.     line_type (8,0);
  98.     move (15,85);
  99.     draw (65,85);
  100.     line_type (1,0);
  101.     move (15,95);
  102.     labelf ("type 9");
  103.     line_type (9,0);
  104.     move (15,95);
  105.     draw (65,95);
  106.     line_type (1,0);
  107.     move (15,105);
  108.     labelf ("type 10");
  109.     line_type (10,0);
  110.     move (15,105);
  111.     draw (65,105);
  112.     move (90,85);
  113.     exit(0);
  114.     }
  115.  
  116.