gsurf.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*!
  2. \file gsurf.h
  3. \brief OGSF library - main header
  4. GRASS OpenGL gsurf OGSF Library
  5. (C) 1999-2008 by the GRASS Development Team
  6. This program is free software under the
  7. GNU General Public License (>=v2).
  8. Read the file COPYING that comes with GRASS
  9. for details.
  10. \author Bill Brown USACERL (January 1993)
  11. */
  12. #ifndef _GSURF_H
  13. #define _GSURF_H
  14. #define GS_UNIT_SIZE 1000.
  15. #define BETWEEN(x, a, b) (((x) > (a) && (x) < (b)) || ((x) > (b) && (x) < (a)))
  16. #define GS_NEAR_EQUAL(x, y, ratio) ((x) == (y) || ((x) == 0.0? \
  17. GS_BETWEEN((x), (y)+(y)*(ratio), (y)-(y)*(ratio)):\
  18. GS_BETWEEN((y), (x)+(x)*(ratio), (x)-(x)*(ratio))))
  19. /* current maximums */
  20. #define MAX_SURFS 12
  21. #define MAX_VECTS 50
  22. #define MAX_SITES 50
  23. #define MAX_VOLS 12 /* should match MAX_VOL_FILES below ? */
  24. #define MAX_DSP 12
  25. #define MAX_ATTS 7
  26. #define MAX_LIGHTS 3
  27. #define MAX_CPLANES 6
  28. #define MAX_ISOSURFS 12
  29. #define MAX_SLICES 12
  30. /* for gvl_file.c */
  31. #define MAX_VOL_SLICES 4
  32. #define MAX_VOL_FILES 100
  33. /* surface display modes */
  34. #define DM_GOURAUD 0x00000100
  35. #define DM_FLAT 0x00000200 /* defined for symmetry */
  36. #define DM_FRINGE 0x00000010
  37. #define DM_WIRE 0x00000001
  38. #define DM_COL_WIRE 0x00000002
  39. #define DM_POLY 0x00000004
  40. #define DM_WIRE_POLY 0x00000008
  41. #define DM_GRID_WIRE 0x00000400
  42. #define DM_GRID_SURF 0x00000800
  43. #define WC_COLOR_ATT 0xFF000000
  44. #define IFLAG unsigned int
  45. /* surface attribute ***descriptors*** */
  46. #define ATT_NORM 0 /* library use only */
  47. #define ATT_TOPO 1
  48. #define ATT_COLOR 2
  49. #define ATT_MASK 3
  50. #define ATT_TRANSP 4
  51. #define ATT_SHINE 5
  52. #define ATT_EMIT 6
  53. #define LEGAL_ATT(a) (a >= 0 && a < MAX_ATTS)
  54. /* surface attribute **sources** */
  55. #define NOTSET_ATT 0
  56. #define MAP_ATT 1
  57. #define CONST_ATT 2
  58. #define FUNC_ATT 3
  59. #define LEGAL_SRC(s) (s==NOTSET_ATT||s==MAP_ATT||s==CONST_ATT||s==FUNC_ATT)
  60. /* site markers */
  61. #define ST_X 1
  62. #define ST_BOX 2
  63. #define ST_SPHERE 3
  64. #define ST_CUBE 4
  65. #define ST_DIAMOND 5
  66. #define ST_DEC_TREE 6
  67. #define ST_CON_TREE 7
  68. #define ST_ASTER 8
  69. #define ST_GYRO 9
  70. #define ST_HISTOGRAM 10
  71. /* Buffer modes */
  72. #define GSD_FRONT 1
  73. #define GSD_BACK 2
  74. #define GSD_BOTH 3
  75. /* fence colormodes */
  76. #define FC_OFF 0
  77. #define FC_ABOVE 1
  78. #define FC_BELOW 2
  79. #define FC_BLEND 3
  80. #define FC_GREY 4
  81. /* legend types */
  82. #define LT_DISCRETE 0x00000100
  83. #define LT_CONTINUOUS 0x00000200
  84. #define LT_LIST 0x00000010
  85. /* list automatically discrete */
  86. #define LT_RANGE_LOWSET 0x00000001
  87. #define LT_RANGE_HISET 0x00000002
  88. #define LT_RANGE_LOW_HI 0x00000003
  89. #define LT_INVERTED 0x00000008
  90. #define LT_SHOW_VALS 0x00001000
  91. #define LT_SHOW_LABELS 0x00002000
  92. /* types of volume files */
  93. #define VOL_FTYPE_G3D 0
  94. /* types of volume values */
  95. #define VOL_DTYPE_FLOAT 0
  96. #define VOL_DTYPE_DOUBLE 1
  97. #endif /* _GSURF_H */