map.h (navit-0.5.5) | : | map.h (navit-0.5.6) | ||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
#include "debug.h" | #include "debug.h" | |||
#define WORLD_BOUNDINGBOX_MIN_X -20000000 | #define WORLD_BOUNDINGBOX_MIN_X -20000000 | |||
#define WORLD_BOUNDINGBOX_MAX_X 20000000 | #define WORLD_BOUNDINGBOX_MAX_X 20000000 | |||
#define WORLD_BOUNDINGBOX_MIN_Y -20000000 | #define WORLD_BOUNDINGBOX_MIN_Y -20000000 | |||
#define WORLD_BOUNDINGBOX_MAX_Y 20000000 | #define WORLD_BOUNDINGBOX_MAX_Y 20000000 | |||
/** | /** | |||
* @brief Used to select data from a map | * @brief Used to select data from a map | |||
* | * | |||
* This struct is used to select data from a map. This one the one hand builds a | * A map selection is a map query, used to select data from a map. It builds a c | |||
* rectangle on the map and on the other hand selects an order for items of each | oordinate rectangle on the map and | |||
* layer. Note that passing NULL instead of a pointer to such a struct often mea | * selects a range of item types to query the map for. | |||
ns | ||||
* "get me everything". | ||||
* | * | |||
* It's possible to link multiple selections in a linked list, see below. | * Multiple rectangular areas and/or non-contiguous ranges of item types can be | |||
specified by concatenating multiple map | ||||
* selections in a linked list. | ||||
* | ||||
* Note that passing NULL instead of a pointer to such a struct often means "get | ||||
me everything". | ||||
*/ | */ | |||
struct map_selection { | struct map_selection { | |||
struct map_selection *next; /**< Linked-List pointer */ | struct map_selection *next; /**< Linked-List pointer */ | |||
union { | union { | |||
struct coord_rect c_rect; /**< For building the rectangle based on coordinates */ | struct coord_rect c_rect; /**< For building the rectangle based on coordinates */ | |||
struct point_rect p_rect; /**< For building the rectangle based on points */ | struct point_rect p_rect; /**< For building the rectangle based on points */ | |||
} u; | } u; | |||
int order; /**< Holds the order */ | int order; /**< Holds the order */ | |||
struct item_range range; /**< Range of items which should be deliv ered */ | struct item_range range; /**< Range of items which should be deliv ered */ | |||
}; | }; | |||
skipping to change at line 238 | skipping to change at line 239 | |||
return map_selection_contains_rect(sel, &r); | return map_selection_contains_rect(sel, &r); | |||
} | } | |||
/* prototypes */ | /* prototypes */ | |||
enum attr_type; | enum attr_type; | |||
enum projection; | enum projection; | |||
struct attr; | struct attr; | |||
struct attr_iter; | struct attr_iter; | |||
struct callback; | struct callback; | |||
struct item; | struct item; | |||
/** | ||||
* @brief Holds information about a map | ||||
* | ||||
* A map holds data used for screen display, search and routing. Maps can come i | ||||
n different forms, such as stored in | ||||
* files or created on the fly in memory. Flat-file maps typically hold the data | ||||
commonly found in a road map, such as | ||||
* roads, land uses, buildings and POIs. In-memory maps are used internally for | ||||
data which changes at runtime, such as | ||||
* information on the currently active route or traffic reports. | ||||
* | ||||
* To read data from a map (or add data if the map driver supports it), you need | ||||
to obtain a map rectangle by calling | ||||
* the map’s `map_rect_new` method. By passing a map selection it is possible to | ||||
restrict the items retrieved from the | ||||
* map to a certain region or to certain item types. | ||||
*/ | ||||
struct map; | struct map; | |||
/** | ||||
* @brief Implementation-specific map data. | ||||
* | ||||
* This struct is defined individually by each map driver and not ment to be acc | ||||
essed outside the map driver. | ||||
*/ | ||||
struct map_priv; | struct map_priv; | |||
/** | ||||
* @brief Describes an extract of a map | ||||
* | ||||
* A map rectangle is the result of a map query. It can be obtained from the map | ||||
by calling `map_rect_new` and passing | ||||
* a map selection. The resulting map rectangle can be queried for items. Contra | ||||
ry to its name, a map rectangle does | ||||
* not necessarily correspond to a rectangle: depending on the map selection it | ||||
was created from, it can hold data from | ||||
* multiple rectangular areas (which may or may not overlap) or from the entire | ||||
map. | ||||
* | ||||
* Map rectangles are not guaranteed to be thread-safe, i.e. a map rectangle sho | ||||
uld never be accessed by more than one | ||||
* thread without proper external synchronization. It is recommended that each t | ||||
hread obtain a separate map rectangle. | ||||
* | ||||
* Map implementations must ensure, however, that accesses to different map rect | ||||
angles of the same map by different | ||||
* threads are properly synchronized. Most importantly, they must ensure that th | ||||
reads reading from one map rectangle | ||||
* receive consistent data while another thread is writing to another (which may | ||||
also happen when reloading data from a | ||||
* stored map). | ||||
*/ | ||||
struct map_rect; | struct map_rect; | |||
/** | ||||
* @brief Holds information about a search on a map | ||||
* | ||||
* This structure holds information about a search performed on a map. This can | ||||
be | ||||
* used as "handle" to retrieve items from a search. | ||||
*/ | ||||
struct map_search; | struct map_search; | |||
struct map_selection; | struct map_selection; | |||
struct pcoord; | struct pcoord; | |||
struct map *map_new(struct attr *parent, struct attr **attrs); | struct map *map_new(struct attr *parent, struct attr **attrs); | |||
struct map *map_ref(struct map* m); | struct map *map_ref(struct map* m); | |||
void map_unref(struct map* m); | void map_unref(struct map* m); | |||
int map_get_attr(struct map *this_, enum attr_type type, struct attr *attr, stru ct attr_iter *iter); | int map_get_attr(struct map *this_, enum attr_type type, struct attr *attr, stru ct attr_iter *iter); | |||
int map_set_attr(struct map *this_, struct attr *attr); | int map_set_attr(struct map *this_, struct attr *attr); | |||
void map_add_callback(struct map *this_, struct callback *cb); | void map_add_callback(struct map *this_, struct callback *cb); | |||
void map_remove_callback(struct map *this_, struct callback *cb); | void map_remove_callback(struct map *this_, struct callback *cb); | |||
int map_requires_conversion(struct map *this_); | int map_requires_conversion(struct map *this_); | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 69 lines changed or added |