1 #ifndef _LEO_LABELLER_H
2 #define _LEO_LABELLER_H
28 struct request *request;
33 enum request_type type;
51 struct request request;
53 struct osm_object *object;
60 struct point_variant *variants;
63 struct request_segment
65 struct request request;
72 struct point_variant *variant;
77 struct request request;
81 struct line_variant *variants;
82 struct request_segment *segments;
87 struct request request;
88 struct osm_multipolygon *o;
94 struct sym_line *line;
98 struct buffer_linelabel
101 struct sym_text *text;
108 struct graph_edge **edges;
117 struct graph_edge *prev;
118 struct graph_edge *next;
119 struct graph_node *n1;
120 struct graph_node *n2;
122 struct sym_text *text;
123 struct sym_line *sym;
129 struct graph_edge *first;
138 struct request *request;
147 struct placement *placements;
148 struct map_part **map;
152 void labeller_init(void);
153 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
154 void labeller_add_line(struct symbol *sym, z_index_t zindex);
155 void labeller_label(void);
156 void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
157 void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
159 void make_bitmap_icon(struct point_variant *v, struct sym_icon *si);
160 void make_bitmap_point(struct point_variant *v, struct sym_point *sp);
161 void make_bitmap_label(struct point_variant *v, struct sym_text *text);
163 void make_graph(void);
164 void label_graph(void);
165 void join_edge(struct graph_edge *e, int dir);
167 void make_segments(void);
169 void make_population(void);
170 bool shall_terminate(void);
174 void rank_population(void);
176 struct individual **perform_crossover(struct individual *parent1, struct individual *parent2);
177 void perform_mutation(struct individual *individual);
179 void init_placement(struct placement *p, struct request *r);
180 void gen_coords_point(struct placement *p);
181 void gen_coords(struct placement *p);
182 struct map_part **get_parts(struct placement *symbol, struct individual *individual);
184 int randint(int min, int max);
186 void get_closure(struct placement **closure, struct placement *placement, struct individual *parent1, struct individual *parent2);
187 void copy_symbols(struct placement **closure, struct individual *parent, struct individual *child);
188 void move_symbol(struct placement *p);
189 void move_symbol_point(struct placement *p);
191 struct placement **get_overlapping(struct placement *p);
192 void filter(struct placement **list, bool *pred);
194 int flip(int a, int b);
195 double randdouble(void);