GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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  int color; /* reset default */
24  int r, g, b;
25  double fr, fg, fb;
26 } SYMBCOLOR;
27 
28 /* symbol element: line or arc */
29 typedef struct {
30  int type; /* S_LINE or S_ARC */
31  union {
32  struct {
33  int count, alloc;
34  double *x, *y;
35  } line;
36  struct {
37  int clock; /* 1 clockwise, 0 counter clockwise */
38  double x, y, r, a1, a2;
39  } arc;
40  } coor;
41 } SYMBEL;
42 
43 /* string of elements */
44 typedef struct {
45  int count, alloc; /* number of elements */
46  SYMBEL **elem; /* array of elements */
47  int scount, salloc; /* number of points in stroked version */
48  double *sx, *sy; /* coordinates in stroked version */
49 } SYMBCHAIN;
50 
51 /* part */
52 typedef struct {
53  int type; /* S_STRING or S_POLYGON */
56  int count, alloc; /* number of rings */
57  SYMBCHAIN **chain; /* array strings */
58 } SYMBPART;
59 
60 typedef struct {
61  double scale; /* to get symbol of size 1, each vertex must be multiplied by
62  this scale */
63  double yscale; /* scale in x dimension */
64  double xscale; /* scale in y dimension */
65  int count, alloc; /* number of parts */
66  SYMBPART **part; /* objects ( parts ) */
67 } SYMBOL;
68 
69 #include <grass/defs/symbol.h>
70 
71 #endif
int count
float g
Definition: named_colr.c:7
double r
Definition: r_raster.c:39
int alloc
Definition: symbol.h:45
SYMBEL ** elem
Definition: symbol.h:46
int salloc
Definition: symbol.h:47
double * sx
Definition: symbol.h:48
int b
Definition: symbol.h:24
double fb
Definition: symbol.h:25
int color
Definition: symbol.h:23
Definition: symbol.h:29
int type
Definition: symbol.h:30
double * x
Definition: symbol.h:34
int alloc
Definition: symbol.h:33
double a1
Definition: symbol.h:38
int clock
Definition: symbol.h:37
Definition: symbol.h:60
double scale
Definition: symbol.h:61
double xscale
Definition: symbol.h:64
double yscale
Definition: symbol.h:63
int alloc
Definition: symbol.h:65
SYMBPART ** part
Definition: symbol.h:66
int alloc
Definition: symbol.h:56
SYMBCHAIN ** chain
Definition: symbol.h:57
SYMBCOLOR fcolor
Definition: symbol.h:55
SYMBCOLOR color
Definition: symbol.h:54
int type
Definition: symbol.h:53
#define x