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;
126 struct graph_edge *prev;
127 struct graph_edge *next;
128 struct graph_node *n1;
129 struct graph_node *n2;
131 struct sym_text *text;
132 struct sym_line *sym;
135 struct graph_node *anode;
136 struct graph_node *bnode; // DEBUG PRINT
143 struct graph_edge *first;
152 struct request *request;
161 struct placement *placements;
162 struct map_part **map;
166 void labeller_init(void);
167 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
168 void labeller_add_line(struct symbol *sym, z_index_t zindex);
169 void labeller_label(void);
170 void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
171 void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
173 void make_bitmap_icon(struct point_variant *v, struct sym_icon *si);
174 void make_bitmap_point(struct point_variant *v, struct sym_point *sp);
175 void make_bitmap_label(struct point_variant *v, struct sym_text *text);
177 void make_graph(void);
178 void label_graph(void);
179 void join_edge(struct graph_edge *e, int dir);
181 void make_segments(void);
183 void make_population(void);
184 bool shall_terminate(void);
188 void rank_population(void);
190 struct individual **perform_crossover(struct individual *parent1, struct individual *parent2);
191 void perform_mutation(struct individual *individual);
193 void init_placement(struct placement *p, struct request *r);
194 void init_individual(struct individual *i);
195 void gen_coords_point(struct placement *p);
196 void gen_coords(struct placement *p);
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);