]> mj.ucw.cz Git - leo.git/blobdiff - labeller.c
Labelling: Bugfixes in get_closure
[leo.git] / labeller.c
index 6185108a46dc6e3cbb9a14bbf70d5fb33a56c492..c386574556d50d638816518ea330ed7fcb27852f 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <math.h>
 #include <ucw/lib.h>
 #include <stdio.h>
 #include <math.h>
 #include <ucw/lib.h>
+#include <ucw/conf.h>
 
 #include "leo.h"
 #include "sym.h"
 
 #include "leo.h"
 #include "sym.h"
@@ -47,6 +48,15 @@ uns num_map_parts_row = 0;
 uns num_map_parts_col = 0;
 uns num_map_parts = 0;
 
 uns num_map_parts_col = 0;
 uns num_map_parts = 0;
 
+static struct cf_section labelling_cf = {
+  CF_ITEMS {
+    CF_DOUBLE("MaxSectionLenght", &conf_max_section_length),
+    CF_DOUBLE("MaxSectionOverlay", &conf_max_section_overlay),
+    CF_DOUBLE("BitmapGranularity", &bitmap_granularity),
+    CF_END
+  }
+};
+
 static void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 static void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 
 static void labeller_add_linelabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 static void labeller_add_arealabel(struct symbol *sym, struct osm_object *o, z_index_t zindex);
 
@@ -57,6 +67,9 @@ static void compute_sizes(void)
   page_width_int = floor(page_width);
   page_height_int = floor(page_height);
 
   page_width_int = floor(page_width);
   page_height_int = floor(page_height);
 
+  page_width_gran = page_width * bitmap_granularity;
+  page_height_gran = page_height * bitmap_granularity;
+
   num_map_parts_row = (page_width_int + conf_map_part_width) / conf_map_part_width;
   num_map_parts_col = (page_height_int + conf_map_part_height) / conf_map_part_height;
   num_map_parts = num_map_parts_row * num_map_parts_col;
   num_map_parts_row = (page_width_int + conf_map_part_width) / conf_map_part_width;
   num_map_parts_col = (page_height_int + conf_map_part_height) / conf_map_part_height;
   num_map_parts = num_map_parts_row * num_map_parts_col;
@@ -65,8 +78,8 @@ static void compute_sizes(void)
 
 void labeller_conf(void)
 {
 
 void labeller_conf(void)
 {
+  cf_declare_section("Labelling", &labelling_cf, 0);
   evolution_conf();
   evolution_conf();
-  lines_conf();
 }
 
 void labeller_init(void)
 }
 
 void labeller_init(void)
@@ -98,10 +111,6 @@ void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t
   r->sym = sym;
   r->zindex = zindex;
 
   r->sym = sym;
   r->zindex = zindex;
 
-  r->offset_x = 0;
-  r->offset_y = 0;
-
-  r->num_variants = 1;
   GARY_INIT(r->request.variants, 0);
 
   struct variant *v = GARY_PUSH(r->request.variants);
   GARY_INIT(r->request.variants, 0);
 
   struct variant *v = GARY_PUSH(r->request.variants);
@@ -130,7 +139,6 @@ 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;
   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;
 }
 
 void labeller_add_label(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)