home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m242 / 1.ddi / SOURCE.ZIP / BAREXT.C next >
Encoding:
C/C++ Source or Header  |  1989-10-16  |  4.9 KB  |  129 lines

  1. #include "eg_proto.h"
  2.  
  3. /* value for the bottom unit of the bar, if you have many bar, you need
  4.     change the value */
  5. float    td_large=60.0;
  6. float td_medim=45.0;
  7. float td_small=30.0;
  8.  
  9. /* height of the base, if set to zero which means no base */
  10. float    td_baseh=0.0;
  11.  
  12. /* colors around bars */
  13. int wall_c=0;                  /* color to be used for the solid fill of the frame */
  14. int grid_c=12;                  /* color to be used for the boundary of the frame */
  15. int base_c=0;                  /* color to be used for the solid fill of the base area */
  16.  
  17. /* default color for the bar */
  18. int td_t_c=15;                  /* top or bottom color */
  19. int td_l_c=9;                  /* left side color */
  20. int td_r_c=1;                  /* right side color */
  21. int td_b_c=4;                  /* boundary color of the bar */
  22.  
  23. /* total bars will be */
  24. int td_ttbar;                  /* count from 1, not 0 */
  25.  
  26. /* flag for using labels or not */
  27. int tdlab_flag[6]={0,0,0,0,0,0};          /* 0: base left */
  28.                                                   /*    1: base right */
  29.                                                   /* 2: xy plane left */
  30.                                                   /*    3: xy plane right */
  31.                                                   /*    4: xz plane */
  32.                                                   /*    5: yz plane    */
  33.  
  34. /* draw middle plane flag */
  35. int mid_pl_c=0;                  /* color to be used for the solid fill of the middle plane */
  36. int draw_midp_flag=0;        /* 1- draw the middle plane, 0- not drawing it */
  37. float middlep_value=0.0;    /* value for the middle plane */
  38.  
  39. /* store information of labels */
  40. tdlabels tdbarlab[6];    /* 6 different kinds labels */
  41.  
  42. /* store data for bar */
  43. baritem *_esbar;            /* holding permantly */
  44. coord3d *_tdpts;            /* holding each bars vertex' points */
  45. int *barptr;                /* point to which bar's value should use */
  46. stack_cr *_stackc;        /* colors of stack bar */
  47.  
  48. /* the attribute for the bar chart */
  49. int tdbarkind=-9999;        /* 0- cubebar 1- pyramid 2- octahedron 3- stacked bar */
  50. int td_barx;                /* how many bars along the X axis */
  51. int td_bary;                /* how many bars along the Y axis */
  52. int tdstkseg=1;            /* how many segments in the stack bars */
  53. int tdlegndf=0;            /* flag for the legend (only for bar); 0- no legend, 1- yes */
  54. int tdtitlef=0;            /* flag for the title; 0- no title, 1- yes */
  55.  
  56. /* temporarily save the viewport */
  57. int tempeview[4]={-9999,-9999,-9999,-9999};
  58. int tempeviewflag=0;
  59.  
  60. /* for the legend */
  61. tdlegend *_legend;    
  62.  
  63. /* for 3D pie */
  64. td_htpie *_espie;        /* holding whole data for stacked bars */
  65. int td_ttpie=-9999;    /* count from 1, not 0; also is flag, just make sure
  66.                                 tdpieset() was called */
  67. int pie_top;            /* top of the pie; which ma should around 90 */
  68. int pie_bot;            /* top of the pie; which ma should around 270 */
  69. int pie_left;            /* left of the pie; which ma should around 180 */
  70.                             /* right of the pie is always 0 */
  71. int td_top;                /* the biggest Y value in this pie */
  72. int td_bot;                /* the smallest Y value in this pie */
  73. int td_right;            /* the biggest X value in this pie */
  74. int td_left;            /* the smallest Y value in this pie */
  75. int tdpiefn;            /* font number to use for the labels */
  76. int labelgap=5;        /* gap between each labels (horizontally) */
  77. int pielabgap=9;        /* gap between the border (eg td_top, td_left..) and 
  78.                                 labels that will be either right or left adjustified 
  79.                                 (it depends on radius) */
  80. int exp_pixel=40;        /* how many pixels between label and td_??? */
  81. int tdpiepos;            /* position of the labels */
  82. int tdpielocation;    /* location of the legend */
  83. int tdpiestyle;        /* style of the legend */
  84. int tdlabelc=12;        /* labels' color */
  85. int tdlablnc=12;         /* label's line color */
  86. int td_width=0;        /* width of the pie (default is 2D) */
  87. int label_height;        /* the height of the label */
  88. int need_adjust_no=5;/* if more than this number, then adjustified anyway */
  89.  
  90. /* size around the 3D frame */
  91. float tdbasex,tdbasey;    /* the bottom size for each bar */
  92. float tdbasez=60.0;         /* grid length in Z-axis */    
  93.  
  94. /* array for 3D perspective */
  95. float v[4][4];          /* define the 4 * 4 matrix (for perspective) */
  96.  
  97. /* coordinate for 3D between real world and screen */
  98. sphr_crd coord_s;        /* theta, phi, rho and sd */
  99. coord3d objcp;            /* center point for the real world */
  100.  
  101. /* for the relationship between label and frame */
  102. int reverse_flag=0;    /* 0- do not reverse (0<=theta<90) */
  103.                             /* 1- reverse new xy plane left (90<=theta<180) */
  104.                             /* 2- reverse new xy plane both sides (180<=theta<270) */
  105.                             /* 3- reverse new xy plane right (270<=theta<360) */
  106.  
  107. /* space between graph and viewport (The values will be changed in tdbarset()
  108.     because of the resolution.  Also can call the function td_graph_dim() to
  109.     change it.) */
  110. float size_to_bottom=60.0;
  111. float size_to_top=20.0;
  112. float size_to_left=40.0,size_to_right=40.0;
  113.  
  114. /* label between each plane */
  115. float label_xyplane=10.0;
  116. float label_xzplane=8.0;
  117. float label_yzplane=8.0;
  118.  
  119. /* save the original world & viewport */
  120. int per_view[4];
  121. int per_world[4];
  122.  
  123. void bar_ext() 
  124.  tdlegndf=0;            /* flag for the legend (only for bar); 0- no legend, 1- yes */
  125.  tdtitlef=0;            /* flag for the title; 0- no title, 1- yes */
  126.  tempeviewflag=0;
  127. }
  128.