1 #ifndef GRASS_SYMBOL_H 2 #define GRASS_SYMBOL_H 3 4 /* definitions and structures */ 5 6 /* Warning : structure is not exactly the same as format. */ 7 8 #define S_NONE 0 /* no object (used for reading) */ 9 10 /* elements */ 11 #define S_LINE 1 /* line */ 12 #define S_ARC 2 /* arc */ 13 14 /* parts */ 15 #define S_STRING 1 16 #define S_POLYGON 2 17 18 #define S_COL_DEFAULT 1 /* default color */ 19 #define S_COL_NONE 2 /* no color */ 20 #define S_COL_DEFINED 3 /* color defined in symbol file */ 21 22 typedef struct 23 { 24 int color; /* reset default */ 25 int r, g, b; 26 double fr, fg, fb; 27 } SYMBCOLOR; 28 29 /* symbol element: line or arc */ 30 typedef struct 31 { 32 int type; /* S_LINE or S_ARC */ 33 union 34 { 35 struct 36 { 37 int count, alloc; 38 double *x, *y; 39 } line; 40 struct 41 { 42 int clock; /* 1 clockwise, 0 counter clockwise */ 43 double x, y, r, a1, a2; 44 } arc; 45 } coor; 46 } SYMBEL; 47 48 /* string of elements */ 49 typedef struct 50 { 51 int count, alloc; /* number of elements */ 52 SYMBEL **elem; /* array of elements */ 53 int scount, salloc; /* number of points in stroked version */ 54 double *sx, *sy; /* coordinates in stroked version */ 55 } SYMBCHAIN; 56 57 /* part */ 58 typedef struct 59 { 60 int type; /* S_STRING or S_POLYGON */ 61 SYMBCOLOR color; 62 SYMBCOLOR fcolor; 63 int count, alloc; /* number of rings */ 64 SYMBCHAIN **chain; /* array strings */ 65 } SYMBPART; 66 67 typedef struct 68 { 69 double scale; /* to get symbol of size 1, each vertex must be multiplied by this scale */ 70 double yscale; /* scale in x dimension */ 71 double xscale; /* scale in y dimension */ 72 int count, alloc; /* numer of parts */ 73 SYMBPART **part; /* objects ( parts ) */ 74 } SYMBOL; 75 76 #include <grass/defs/symbol.h> 77 78 #endif 79