GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
symbol.h
Go to the documentation of this file.
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 */
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
double * y
Definition: symbol.h:38
int color
Definition: symbol.h:24
double y
Definition: symbol.h:43
SYMBCHAIN ** chain
Definition: symbol.h:64
double fr
Definition: symbol.h:26
int count
Definition: symbol.h:37
double scale
Definition: symbol.h:69
Definition: symbol.h:67
int count
Definition: symbol.h:63
double yscale
Definition: symbol.h:70
SYMBPART ** part
Definition: symbol.h:73
#define x
double b
Definition: r_raster.c:39
SYMBCOLOR fcolor
Definition: symbol.h:62
int type
Definition: symbol.h:32
SYMBCOLOR color
Definition: symbol.h:61
float g
Definition: named_colr.c:8
int clock
Definition: symbol.h:42
int count
Definition: symbol.h:72
double * sy
Definition: symbol.h:54
int count
Definition: symbol.h:51
int type
Definition: symbol.h:60
int scount
Definition: symbol.h:53
int r
Definition: symbol.h:25
SYMBEL ** elem
Definition: symbol.h:52
double xscale
Definition: symbol.h:71
double r
Definition: r_raster.c:39
Definition: symbol.h:30