vector.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* Modified by: Janne Soimasuo August 1994; line_cat added
  2. * Modified by: Radim Blazek Jan 2000; acolor, label added
  3. * Modified by: Morten Hulden Mar 2004; cols added to vector
  4. * Modified by: Hamish Bowman Sept 2005; sizecol added to LAYER
  5. */
  6. #include <grass/gis.h>
  7. #include "clr.h"
  8. #define PI M_PI
  9. /* #define MAXVECTORS 20 */
  10. /* layer type */
  11. #define VPOINTS 0
  12. #define VLINES 1
  13. #define VAREAS 2
  14. /* line justification */
  15. #define LINE_REF_CENTER 0
  16. #define LINE_REF_LEFT 1
  17. #define LINE_REF_RIGHT 2
  18. /* draw line */
  19. #define LINE_DRAW_LINE 1
  20. #define LINE_DRAW_HIGHLITE 2
  21. /* construct_path() */
  22. #define START_PATH 0
  23. #define ADD_TO_PATH 1
  24. #define CLOSE_PATH 2
  25. #define WHOLE_PATH 3
  26. /* line end style */
  27. #define LINECAP_BUTT 0
  28. #define LINECAP_ROUND 1
  29. #define LINECAP_EXTBUTT 2
  30. typedef struct
  31. {
  32. /* All types */
  33. int type; /* layer type: VPOINTS, VLINES, VAREAS */
  34. char *name;
  35. char *mapset;
  36. char masked;
  37. char *label; /* label in legend */
  38. int lpos; /* position in legend: -1 not specified, 0 do not display, > 0 position in legend */
  39. double width; /* width of line, boundary or icon outline */
  40. PSCOLOR color; /* color of line, boundary or icon outline */
  41. int field; /* category field */
  42. char *cats; /* list of categories */
  43. /* struct cat_list *clist; *//* list of categories */
  44. char *where; /* SQL where condition (without WHERE key word) */
  45. /* Lines */
  46. double cwidth; /* category width */
  47. double offset; /* offset */
  48. double coffset; /* category offset */
  49. int ref; /* justification */
  50. char *linestyle; /* line or boundary style */
  51. char *setdash; /* line style converted to PS setdash format */
  52. int linecap; /* line end style */
  53. double hwidth; /* line or boundary highlight line width */
  54. PSCOLOR hcolor;
  55. /* Areas */
  56. char *pat; /* name of eps file for pattern */
  57. double scale; /* scale of pattern */
  58. double pwidth; /* pattern width */
  59. /* Points */
  60. double size; /* icon size */
  61. char *sizecol; /* Column used for symbol size */
  62. char *rgbcol; /* column used for symbol rgb color */
  63. /* already defined in Areas section above, so don't need it twice */
  64. /* double scale; *//* Scale factor for dynamic sizing */
  65. double rotate; /* symbol rotation */
  66. char *rotcol; /* column used for symbol rotation */
  67. char *symbol; /* symbol name */
  68. char *symbol_ps; /* symbol name in PS */
  69. char *epspre; /* first part of EPS file name */
  70. char *epssuf; /* second part of EPS file name */
  71. int epstype; /* 0 - no eps, 1 - common eps, 2 - eps for each category */
  72. /* Points + Line */
  73. int ltype; /* point/centroid or line/boundary */
  74. /* Points + Areas */
  75. PSCOLOR fcolor; /* fill color */
  76. } LAYER;
  77. struct vector
  78. {
  79. int cur; /* currently processed vector */
  80. int count; /* number of recorded layers */
  81. int alloc; /* allocated space */
  82. double x, y; /* legend position */
  83. int fontsize; /* legend font size */
  84. char *font; /* legend font */
  85. double width; /* width of legend symbols */
  86. int cols; /* number of columns */
  87. PSCOLOR border; /* border color */
  88. double span; /* column separation in inches */
  89. LAYER *layer;
  90. };
  91. extern struct vector vector;