X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=labeller.h;h=cf30b0ee54fbddaa821c344067053d6db3475aaf;hb=df24604990174cde6413d9902b7521a5daffadaa;hp=f17bda5b406b8a754242f88602f0aecad794aa64;hpb=5ac436112370bca9a88fe9ed31f399197b6b08cf;p=leo.git diff --git a/labeller.h b/labeller.h index f17bda5..cf30b0e 100644 --- a/labeller.h +++ b/labeller.h @@ -1,18 +1,12 @@ #ifndef _LEO_LABELLER_H #define _LEO_LABELLER_H -enum label_type -{ - LABEL_POINT, - LABEL_LINE, - LABEL_AREA, -}; - enum request_type { + REQUEST_INVALID, REQUEST_POINT, - REQUEST_AREALABEL, - REQUEST_LINELABEL, + REQUEST_AREA, + REQUEST_LINE, REQUEST_SEGMENT, }; @@ -23,20 +17,6 @@ enum term_cond TERM_COND_ITERATIONS, }; -struct sym_placement -{ - double x; - double y; - int variant; - struct request *request; -}; - -struct request -{ - enum request_type type; - int ind; -}; - struct point_variant { double width; @@ -49,11 +29,16 @@ struct line_variant bool *masks; }; +struct request +{ + enum request_type type; + int ind; +}; + struct request_point { struct request request; struct symbol *sym; - struct osm_object *object; // FIXME: Linked also by sym z_index_t zindex; double x; double y; @@ -72,15 +57,15 @@ struct request_segment double y2; double k; struct sym_line *sym; + struct symbol *label; struct point_variant *variant; - struct sym_text *text; z_index_t zindex; }; struct request_line { struct request request; - struct symbol *sym; + struct symbol *line; int num_variants; int num_segments; struct line_variant *variants; @@ -91,9 +76,10 @@ struct request_area { struct request request; struct osm_multipolygon *o; - struct sym_text *sym; - struct point_variant *text_variant; + struct symbol *label; + struct point_variant *variants; z_index_t zindex; + double cx, cy; }; struct buffer_line @@ -105,7 +91,7 @@ struct buffer_line struct buffer_linelabel { struct osm_way *way; - struct sym_text *text; + struct symbol *label; z_index_t zindex; }; @@ -128,8 +114,8 @@ struct graph_edge struct graph_node *n1; struct graph_node *n2; uns longline; - struct sym_text *text; - struct sym_line *sym; + struct symbol *label; + struct sym_line *line; z_index_t zindex; int dir; struct graph_node *anode; @@ -145,11 +131,11 @@ struct longline struct placement { + struct request *request; double x; double y; int variant_used; bool processed; - struct request *request; }; struct map_part