]> mj.ucw.cz Git - leo.git/blob - labeller.h
Labelling: Getting rid of GCC warnings
[leo.git] / labeller.h
1 #ifndef _LEO_LABELLER_H
2 #define _LEO_LABELLER_H
3
4 enum verbosity
5 {
6   VERBOSITY_NONE,
7   VERBOSITY_GENERAL,
8   VERBOSITY_POPULATION,
9   VERBOSITY_INDIVIDUAL,
10   VERBOSITY_PLACEMENT,
11   VERBOSITY_ALL,
12 };
13
14 enum edge_dir
15 {
16   DIR_INVALID,
17   DIR_UNSET,
18   DIR_CENTER,
19   DIR_FWD,
20   DIR_BWD,
21 };
22
23 enum request_type
24 {
25   REQUEST_INVALID,
26   REQUEST_POINT,
27   REQUEST_AREA,
28   REQUEST_LINE,
29   REQUEST_SECTION,
30   REQUEST_SEGMENT,
31 };
32
33 enum term_cond
34 {
35   TERM_COND_PENALTY,
36   TERM_COND_STAGNATION,
37   TERM_COND_ITERATIONS,
38 };
39
40 struct variant
41 {
42   int width;
43   int height;
44   int offset_x;
45   int offset_y;
46   bool *bitmap;
47 };
48
49 struct request
50 {
51   enum request_type type;
52   int ind;
53   struct variant *variants;
54 };
55
56 struct request_point
57 {
58   struct request request;
59   struct symbol *sym;
60   z_index_t zindex;
61   double x;
62   double y;
63   double offset_x;
64   double offset_y;
65   int num_variants;
66 };
67
68 struct request_segment
69 {
70   struct request request;
71   struct request_line *rl;
72   double x1;
73   double y1;
74   double x2;
75   double y2;
76   double slope;
77   struct symbol *label;
78   z_index_t zindex;
79 };
80
81 struct request_section
82 {
83   struct request request;
84   int num_segments;
85   struct request_segment *segments;
86 };
87
88 struct request_line
89 {
90   struct request request;
91   struct symbol *line;
92   int num_variants;
93   struct request_section *sections;
94 };
95
96 struct request_area
97 {
98   struct request request;
99   struct osm_multipolygon *o;
100   struct symbol *label;
101   z_index_t zindex;
102   double cx, cy;
103 };
104
105 struct buffer_line
106 {
107   struct sym_line *line;
108   z_index_t zindex;
109 };
110
111 struct buffer_linelabel
112 {
113   struct osm_way *way;
114   struct symbol *label;
115   z_index_t zindex;
116 };
117
118 struct graph_node
119 {
120   osm_id_t id;
121   struct osm_node *o;
122   struct graph_edge **edges;
123   int num;
124 };
125
126 struct graph_edge
127 {
128   osm_id_t id;
129   double length;
130   color_t color;
131   int visited;
132   struct graph_edge *prev;
133   struct graph_edge *next;
134   struct graph_node *n1;
135   struct graph_node *n2;
136   uns longline;
137   struct symbol *label;
138   struct sym_line *line;
139   z_index_t zindex;
140   enum edge_dir dir;
141   struct graph_node *anode;
142   struct graph_node *bnode; // DEBUG PRINT
143   int num; // DEBUG
144 };
145
146 struct longline
147 {
148   uns id;
149   struct graph_edge *first;
150 };
151
152 struct placement
153 {
154   struct request *request;
155   double x;
156   double y;
157   int variant_used;
158   int ind;
159   bool processed;
160   // FIXME: Replace with clist?
161   struct placement_link *map_links;
162   struct individual *individual;
163 };
164
165 struct placement_link
166 {
167   struct map_placement *mp;
168   struct placement_link *next;
169 };
170
171 struct map_placement
172 {
173   struct placement *placement;
174   struct map_placement *next;
175   struct map_placement *prev;
176 };
177
178 struct map_part
179 {
180   // FIXME: Replace with clist?
181   struct map_placement *placement;
182 };
183
184 struct individual
185 {
186   struct placement *placements;
187   struct map_part **map;
188   int penalty;
189 };
190
191 void labeller_init(void);
192 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
193 void labeller_add_line(struct symbol *sym, z_index_t zindex);
194 void labeller_label(void);
195 void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
196 void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
197
198 #endif