double get_omittment(struct placement *p);
double individual_omittment(struct individual *individual);
+void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
+void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
+
struct individual **perform_crossover(struct individual *parent1, struct individual *parent2);
void perform_mutation(struct individual *individual);
void init_placement(struct placement *p, struct individual *individual, struct request *r);
DEBUG(dbg_requests, VERBOSITY_PLACEMENT, "Inited point to [%.2f; %.2f] on %u\n", r->x, r->y, r->zindex);
}
-void labeller_add_line(struct symbol *sym, z_index_t zindex)
+void labeller_notify_line(struct symbol *sym, z_index_t zindex)
{
DEBUG(dbg_requests, VERBOSITY_PLACEMENT, "Adding line on %u\n", zindex);
struct buffer_line *b = GARY_PUSH(buffer_line);
b->line = (struct sym_line *) sym;
b->zindex = zindex;
- sym_plan(sym, zindex);
+}
+
+void labeller_add_label(struct symbol *sym, struct osm_object *o, z_index_t zindex)
+{
+ switch (o->type)
+ {
+ case OSM_TYPE_WAY:
+ if (osm_way_cyclic_p((struct osm_way *) o))
+ labeller_add_arealabel(sym, o, zindex);
+ else
+ labeller_add_linelabel(sym, o, zindex);
+ break;
+ default:
+ ;
+ }
}
void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex)
void labeller_cleanup(void);
void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
-void labeller_add_line(struct symbol *sym, z_index_t zindex);
+void labeller_notify_line(struct symbol *sym, z_index_t zindex);
void labeller_label(void);
-void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
-void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
+void labeller_add_label(struct symbol *sym, struct osm_object *o, z_index_t zindex);
#endif
if (o->type == OSM_TYPE_WAY)
{
- if (casing)
- sym_plan(&sl->s, sym_zindex(o, si, 2));
- else
- labeller_add_line(&sl->s, sym_zindex(o, si, casing ? 2 : 3));
+ if (!casing)
+ labeller_notify_line(&sl->s, sym_zindex(o, si, casing ? 2 : 3));
+ sym_plan(&sl->s, sym_zindex(o, si, casing ? 2 : 3));
}
}
}
st->x -= st->tw / 2;
st->y += st->th - (st->th + st->td) / 2;
text_fix_placement(st);
- if (o->type == OSM_TYPE_WAY && !osm_way_cyclic_p((struct osm_way *) o))
- {
- labeller_add_linelabel(&st->s, o, sym_zindex(o, si, 4.9));
- }
- else
- {
- labeller_add_arealabel(&st->s, o, sym_zindex(o, si, 4.9));
- }
+ labeller_add_label(&st->s, o, sym_zindex(o, si, 4.9));
}
static void sym_text_way(struct osm_object *o, struct style_info *si, osm_val_t text)