1 #ifndef _LEO_LABELLER_H
2 #define _LEO_LABELLER_H
31 struct request *request;
36 enum request_type type;
54 struct request request;
56 struct osm_object *object; // FIXME: Linked also by sym
63 struct point_variant *variants;
66 struct request_segment
68 struct request request;
75 struct point_variant *variant;
76 struct sym_text *text;
82 struct request request;
86 struct line_variant *variants;
87 struct request_segment *segments;
92 struct request request;
93 struct osm_multipolygon *o;
95 struct point_variant *text_variant;
101 struct sym_line *line;
105 struct buffer_linelabel
108 struct sym_text *text;
116 struct graph_edge **edges;
125 struct graph_edge *prev;
126 struct graph_edge *next;
127 struct graph_node *n1;
128 struct graph_node *n2;
130 struct sym_text *text;
131 struct sym_line *sym;
138 struct graph_edge *first;
147 struct request *request;
156 struct placement *placements;
157 struct map_part **map;
161 void labeller_init(void);
162 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
163 void labeller_add_line(struct symbol *sym, z_index_t zindex);
164 void labeller_label(void);
165 void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
166 void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
168 void make_bitmap_icon(struct point_variant *v, struct sym_icon *si);
169 void make_bitmap_point(struct point_variant *v, struct sym_point *sp);
170 void make_bitmap_label(struct point_variant *v, struct sym_text *text);
172 void make_graph(void);
173 void label_graph(void);
174 void join_edge(struct graph_edge *e, int dir);
176 void make_segments(void);
178 void make_population(void);
179 bool shall_terminate(void);
183 void rank_population(void);
185 struct individual **perform_crossover(struct individual *parent1, struct individual *parent2);
186 void perform_mutation(struct individual *individual);
188 void init_placement(struct placement *p, struct request *r);
189 void init_individual(struct individual *i);
190 void gen_coords_point(struct placement *p);
191 void gen_coords(struct placement *p);
192 struct map_part **get_parts(struct placement *symbol, struct individual *individual);
194 int randint(int min, int max);
196 struct placement **get_closure(struct placement *placement, struct individual *parent1, struct individual *parent2);
197 void copy_symbols(struct placement **closure, struct individual *parent, struct individual *child);
198 void move_symbol(struct placement *p);
199 void move_symbol_point(struct placement *p);
201 struct placement **get_overlapping(struct placement *p);
202 void filter(struct placement **list, bool *pred);
204 int flip(int a, int b);
205 double randdouble(void);
209 void copy_individual(struct individual *src, struct individual *dest);