vizual.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #include "vizual2.h"
  2. #include <GL/gl.h>
  3. #include <grass/gis.h>
  4. #define WITHIN(a,x,b) (((a) <= (x) && (x) <= (b)) ? 1 : 0)
  5. #define INSIDE 0
  6. #define OUTSIDE 1
  7. extern file_info Headfax; /* contains info about data itself */
  8. extern file_info G3header; /* contains info about data itself */
  9. extern int G_sign;
  10. extern int X_sign;
  11. extern long D_offset; /*offset to data in grid3 file */
  12. struct poly_info
  13. {
  14. int vnum; /* the number of vertices in this polygon (= number of sides ) */
  15. double data[18];
  16. double verts[18];
  17. };
  18. struct color_entry
  19. {
  20. float data;
  21. short color[3];
  22. };
  23. struct dspec
  24. {
  25. int Thresh;
  26. int t[MAXTHRESH]; /* an array of index numbers */
  27. int nt; /* number of indexes chosen (cumulative) */
  28. int xrot, yrot, zrot; /* angle in degrees */
  29. int Xrot, Yrot, Zrot; /* indicates if do autorotate */
  30. float xscale, yscale, zscale; /* scaling factor for each dimension */
  31. float ztrans;
  32. int B[3]; /* sets the minimum dim to be displayed along this axis */
  33. /* the default is 0 */
  34. int E[3]; /* sets the maximum dim to be displayed along this axis */
  35. /* the default is xdim, ydim or zdim */
  36. float Xtran, Ytran, Ztran; /* translation of object */
  37. int c_flag; /* reset flag */
  38. int Swap_buf;
  39. int low, hi; /* outside threshold indexes */
  40. int in_out; /* fill contours between thresholds or outside */
  41. /* INSIDE 0 OUTSIDE 1 */
  42. /* Light model options */
  43. float Specular;
  44. int plane; /* which plane we are looking at */
  45. float p[6][3][3]; /*using the bounding box vertices for plane normals */
  46. cmndln_info threshes[2];
  47. struct color_entry ctable[101];
  48. FILE *cfile;
  49. int grid;
  50. };
  51. /*
  52. GLOBAL struct dspec D_spec;
  53. */
  54. /*
  55. ** Structure to support drawing end caps
  56. */
  57. struct Cap
  58. {
  59. float *D_buff; /* 2 dim data buffer */
  60. int reverse; /* is it a mirror image? if so, polygons
  61. ** should be drawn counter-clockwise */
  62. /* 1 means do reverse */
  63. int minx, miny; /* sets the minimum dim to be displayed along this axis */
  64. /* the default is 0 */
  65. int maxx, maxy; /* sets the maximum dim to be displayed along this axis */
  66. /* the default is Rows, Cols */
  67. int z; /* this is the axis that is a constant */
  68. int side; /* which side 0 - 5 */
  69. int Cols, Rows; /* Dims of current data in buffer */
  70. };
  71. /*
  72. struct Nodes {
  73. int used;
  74. float x[2];
  75. float y[2];
  76. };
  77. */
  78. #define X 0
  79. #define Y 1
  80. #define Z 2
  81. #define DRAW_BBOX 1
  82. #define DRAW_ISO 2
  83. #define DRAW_SOLID 4
  84. #define DRAW_CAP 8 /* needs top half w/ side flags set */
  85. /* i.e. for side two use: ((1 << 2) << 16 ) | DRAW_CAP */
  86. /* for side three use: ((1 << 3) << 16 ) | DRAW_CAP */
  87. /* for side two and three use: (((1<<2)|(1<<3)) << 16 ) | DRAW_CAP */
  88. /*
  89. extern short carray[129][3];
  90. extern int carray_max;
  91. */