]> mj.ucw.cz Git - leo.git/blobdiff - labeller.h
Labelling: Mostly backup of current state
[leo.git] / labeller.h
index cf30b0ee54fbddaa821c344067053d6db3475aaf..d8d4db6f62647cf25b1e2f090e7c5f03492903d8 100644 (file)
@@ -1,12 +1,22 @@
 #ifndef _LEO_LABELLER_H
 #define _LEO_LABELLER_H
 
+enum edge_dir
+{
+  DIR_INVALID,
+  DIR_UNSET,
+  DIR_CENTER,
+  DIR_FWD,
+  DIR_BWD,
+};
+
 enum request_type
 {
   REQUEST_INVALID,
   REQUEST_POINT,
   REQUEST_AREA,
   REQUEST_LINE,
+  REQUEST_SECTION,
   REQUEST_SEGMENT,
 };
 
@@ -19,8 +29,8 @@ enum term_cond
 
 struct point_variant
 {
-  double width;
-  double height;
+  int width;
+  int height;
   bool *bitmap;
 };
 
@@ -51,25 +61,31 @@ struct request_point
 struct request_segment
 {
   struct request request;
+  struct request_line *rl;
   double x1;
   double y1;
   double x2;
   double y2;
-  double k;
-  struct sym_line *sym;
+  double angle;
   struct symbol *label;
   struct point_variant *variant;
   z_index_t zindex;
 };
 
+struct request_section
+{
+  struct request request;
+  int num_segments;
+  struct request_segment *segments;
+};
+
 struct request_line
 {
   struct request request;
   struct symbol *line;
   int num_variants;
-  int num_segments;
   struct line_variant *variants;
-  struct request_segment *segments;
+  struct request_section *sections;
 };
 
 struct request_area
@@ -108,7 +124,7 @@ struct graph_edge
   osm_id_t id;
   double length;
   color_t color;
-  bool visited;
+  int visited;
   struct graph_edge *prev;
   struct graph_edge *next;
   struct graph_node *n1;
@@ -117,7 +133,7 @@ struct graph_edge
   struct symbol *label;
   struct sym_line *line;
   z_index_t zindex;
-  int dir;
+  enum edge_dir dir;
   struct graph_node *anode;
   struct graph_node *bnode; // DEBUG PRINT
   int num; // DEBUG
@@ -163,7 +179,7 @@ void make_bitmap_label(struct point_variant *v, struct sym_text *text);
 void make_graph(void);
 void label_graph(void);
 void join_edge(struct graph_edge *e, int dir);
-void bfs(void);
+void bfs(uns longline);
 void make_segments(void);
 
 void make_population(void);
@@ -178,8 +194,6 @@ void perform_mutation(struct individual *individual);
 
 void init_placement(struct placement *p, struct request *r);
 void init_individual(struct individual *i);
-void gen_coords_point(struct placement *p);
-void gen_coords(struct placement *p);
 struct map_part **get_parts(struct placement *symbol, struct individual *individual);
 
 int randint(int min, int max);