1 #ifndef _LEO_LABELLER_H
2 #define _LEO_LABELLER_H
7 * Requests for point refer directly to point symbols that should be placed.
8 * Line and area requests are in fact requests for labels (either symbols or
9 * textual labels) of such objects.
10 * Area requests are taken quite as-is,
11 * line requests are broken into section and segment requests -- each line
12 * is broken into sections of maximal length and each section is made of segments
13 * which correspond to OSM ways.
14 * For each line, exactly one segment of each section is labelled in the output.
31 int offset_x; // Desired offset of top-left corner with respect to
32 int offset_y; // actual coordinates of corresponding object
33 bool *bitmap; // Mask having 1s where the variant is not blank; used for overlap check
38 enum request_type type;
39 int ind; // Index used whenever request indexing is needed
40 struct variant *variants; // Growing array of all variants usable for this request
45 struct request request;
47 z_index_t zindex; // Needed when planning symbol
52 struct request_segment
54 struct request request;
56 double x1; // Start and end of segment
60 double slope; // Used to calculate label rotation
61 z_index_t zindex; // Needed when planning symbol
64 struct request_section
66 struct request request;
67 struct request_segment *segments; // Growing array
72 struct request request;
74 struct request_section *sections; // Growing array
79 struct request request;
80 struct osm_multipolygon *o;
83 double cx, cy; // Area center (coordinates average), used as reference coordinates
86 // Buffer for lines (osm_ways) added via labeller_notify_line,
87 // used to make graph and join lines which should be labelled as one object
90 struct sym_line *line;
93 // Buffer for line labes,
94 // used to label graph -- join logical lines with their labels
95 struct buffer_linelabel
104 struct request *request;
105 struct individual *individual;// FIXME: Is it needed?
106 double x; // Coordinates of variant top-left corner placement
108 int variant_used; // Variant chosen for request in this placement
109 int ind; // Index used whenever placement indexing is needed
110 bool processed; // FIXME: Is it needed?
111 // FIXME: Replace with clist?
112 struct map_placement *map_links;
117 struct placement *placement;
118 struct map_part *part;
119 struct map_placement *next_in_map;
120 struct map_placement *prev_in_map;
121 struct map_placement *next_in_placement;
122 struct map_placement *prev_in_placement;
127 // FIXME: Replace with clist?
128 struct map_placement *placement;
132 void labeller_conf(void);
133 void labeller_init(void);
134 void labeller_cleanup(void);
136 void labeller_label(void);
138 void labeller_add_point(struct symbol *sym, struct osm_object *object, z_index_t zindex);
139 void labeller_notify_line(struct symbol *sym, z_index_t zindex);
140 void labeller_add_label(struct symbol *sym, struct osm_object *o, z_index_t zindex);
142 extern struct request_point *requests_point;
143 extern struct request_line *requests_line;
144 extern struct request_area *requests_area;
146 extern struct longline *longlines;
147 extern struct buffer_line *buffer_line;
148 extern struct buffer_linelabel *buffer_linelabel;
150 extern int dbg_segments;
152 extern int dbg_requests;
153 extern int dbg_graph;
155 extern int dbg_map_parts;
156 extern int dbg_movement;
158 extern int dbg_overlaps;
160 extern int dbg_evolution;
161 extern int dbg_mutation;
162 extern int dbg_breeding;
164 extern int page_width_int;
165 extern int page_height_int;
167 extern int num_requests;
168 extern int num_placements;
170 extern int conf_map_part_width;
171 extern int conf_map_part_height;
173 extern uns num_map_parts_row;
174 extern uns num_map_parts_col;
175 extern uns num_map_parts;