1 #ifndef _LEO_LABELLER_H
2 #define _LEO_LABELLER_H
44 enum request_type type;
50 struct request request;
58 struct point_variant *variants;
61 struct request_segment
63 struct request request;
64 struct request_line *rl;
71 struct point_variant *variant;
75 struct request_section
77 struct request request;
79 struct request_segment *segments;
84 struct request request;
87 struct line_variant *variants;
88 struct request_section *sections;
93 struct request request;
94 struct osm_multipolygon *o;
96 struct point_variant *variants;
103 struct sym_line *line;
107 struct buffer_linelabel
110 struct symbol *label;
118 struct graph_edge **edges;
128 struct graph_edge *prev;
129 struct graph_edge *next;
130 struct graph_node *n1;
131 struct graph_node *n2;
133 struct symbol *label;
134 struct sym_line *line;
137 struct graph_node *anode;
138 struct graph_node *bnode; // DEBUG PRINT
145 struct graph_edge *first;
150 struct request *request;
163 struct placement *placements;
164 struct map_part **map;
168 void labeller_init(void);
169 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
170 void labeller_add_line(struct symbol *sym, z_index_t zindex);
171 void labeller_label(void);
172 void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
173 void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
175 void make_bitmap_icon(struct point_variant *v, struct sym_icon *si);
176 void make_bitmap_point(struct point_variant *v, struct sym_point *sp);
177 void make_bitmap_label(struct point_variant *v, struct sym_text *text);
179 void make_graph(void);
180 void label_graph(void);
181 void join_edge(struct graph_edge *e, int dir);
182 void bfs(uns longline);
183 void make_segments(void);
185 void make_population(void);
186 bool shall_terminate(void);
190 void rank_population(void);
192 struct individual **perform_crossover(struct individual *parent1, struct individual *parent2);
193 void perform_mutation(struct individual *individual);
195 void init_placement(struct placement *p, struct request *r);
196 void init_individual(struct individual *i);
197 struct map_part **get_parts(struct placement *symbol, struct individual *individual);
199 int randint(int min, int max);
201 struct placement **get_closure(struct placement *placement, struct individual *parent1, struct individual *parent2);
202 void copy_symbols(struct placement **closure, struct individual *parent, struct individual *child);
203 void move_symbol(struct placement *p);
204 void move_symbol_point(struct placement *p);
206 struct placement **get_overlapping(struct placement *p);
207 void filter(struct placement **list, bool *pred);
209 int flip(int a, int b);
210 double randdouble(void);
214 void copy_individual(struct individual *src, struct individual *dest);