navit  0.5.3-trunk
map.h File Reference

Contains exported functions / structures for map.c. More...

#include "coord.h"
#include "point.h"
#include "layer.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  map_selection
 Used to select data from a map. More...
 
struct  map_methods
 Holds all functions a map plugin has to implement to be usable. More...
 

Macros

#define WORLD_BOUNDINGBOX_MIN_X   -20000000
 
#define WORLD_BOUNDINGBOX_MAX_X   20000000
 
#define WORLD_BOUNDINGBOX_MIN_Y   -20000000
 
#define WORLD_BOUNDINGBOX_MAX_Y   20000000
 

Functions

static int map_selection_contains_point (struct map_selection *sel, struct coord *c)
 Checks if a coordinate is within a map selection. More...
 
static int map_selection_contains_polyline (struct map_selection *sel, struct coord *c, int count)
 Checks if a polyline is within a map selection. More...
 
static int map_selection_contains_rect (struct map_selection *sel, struct coord_rect *r)
 Checks if a rectangle is within a map selection. More...
 
static int map_selection_contains_polygon (struct map_selection *sel, struct coord *c, int count)
 Checks if a polygon is within a map selection. More...
 
struct mapmap_new (struct attr *parent, struct attr **attrs)
 Opens a new map. More...
 
struct mapmap_ref (struct map *m)
 
void map_unref (struct map *m)
 
int map_get_attr (struct map *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 Gets an attribute from a map. More...
 
int map_set_attr (struct map *this_, struct attr *attr)
 Sets an attribute of a map. More...
 
void map_add_callback (struct map *this_, struct callback *cb)
 Registers a new callback for attribute-change. More...
 
void map_remove_callback (struct map *this_, struct callback *cb)
 Removes a callback from the list of attribute-change callbacks. More...
 
int map_requires_conversion (struct map *this_)
 Checks if strings from a map have to be converted. More...
 
char * map_convert_string_tmp (struct map *this_, char *str)
 Converts a string from a map into a temporary allocated buffer. Conversion is not performed and original string is returned if map doesn't require conversion. So lifetime of returned value is very limited. More...
 
char * map_convert_string (struct map *this_, char *str)
 Converts a string from a map. More...
 
char * map_convert_dup (char *str)
 
void map_convert_free (char *str)
 Frees the memory allocated for a converted string. More...
 
enum projection map_projection (struct map *this_)
 Returns the projection of a map. More...
 
void map_set_projection (struct map *this_, enum projection pro)
 Sets the projection of a map. More...
 
void map_destroy (struct map *m)
 Destroys an opened map. More...
 
struct map_rectmap_rect_new (struct map *m, struct map_selection *sel)
 Creates a new map rect. More...
 
struct itemmap_rect_get_item (struct map_rect *mr)
 Gets the next item from a map rect. More...
 
struct itemmap_rect_get_item_byid (struct map_rect *mr, int id_hi, int id_lo)
 Returns the item specified by the ID. More...
 
struct itemmap_rect_create_item (struct map_rect *mr, enum item_type type_)
 
void map_rect_destroy (struct map_rect *mr)
 Destroys a map rect. More...
 
struct map_searchmap_search_new (struct map *m, struct item *item, struct attr *search_attr, int partial)
 Starts a search on a map. More...
 
struct itemmap_search_get_item (struct map_search *this_)
 Returns an item from a map search. More...
 
void map_search_destroy (struct map_search *this_)
 Destroys a map search struct. More...
 
struct map_selectionmap_selection_rect_new (struct pcoord *center, int distance, int order)
 Creates a new rectangular map selection. More...
 
struct map_selectionmap_selection_dup_pro (struct map_selection *sel, enum projection from, enum projection to)
 Duplicates a map selection, transforming coordinates. More...
 
struct map_selectionmap_selection_dup (struct map_selection *sel)
 Duplicates a map selection. More...
 
void map_selection_destroy (struct map_selection *sel)
 Destroys a map selection. More...
 
int map_selection_contains_item_rect (struct map_selection *sel, struct item *item)
 Checks if a selection contains a rectangle containing an item. More...
 
int map_selection_contains_item_range (struct map_selection *sel, int follow, struct item_range *range, int count)
 Checks if a selection contains a item range. More...
 
int map_selection_contains_item (struct map_selection *sel, int follow, enum item_type type)
 Checks if a selection contains a item. More...
 
int map_priv_is (struct map *map, struct map_priv *priv)
 Checks if a pointer points to the private data of a map. More...
 
void map_dump_filedesc (struct map *map, FILE *out)
 
void map_dump_file (struct map *map, const char *file)
 
void map_dump (struct map *map)
 
void map_destroy_do (struct map *m)
 
struct mapsmaps_new (struct attr *parent, struct attr **attrs)
 

Detailed Description

Contains exported functions / structures for map.c.

Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This file contains code that works together with map.c and that is exported to other modules.

Macro Definition Documentation

◆ WORLD_BOUNDINGBOX_MAX_X

#define WORLD_BOUNDINGBOX_MAX_X   20000000

◆ WORLD_BOUNDINGBOX_MAX_Y

#define WORLD_BOUNDINGBOX_MAX_Y   20000000

◆ WORLD_BOUNDINGBOX_MIN_X

#define WORLD_BOUNDINGBOX_MIN_X   -20000000

◆ WORLD_BOUNDINGBOX_MIN_Y

#define WORLD_BOUNDINGBOX_MIN_Y   -20000000

Function Documentation

◆ map_add_callback()

void map_add_callback ( struct map this_,
struct callback cb 
)

Registers a new callback for attribute-change.

This function registers a new callback function that should be called if the attributes of the map change.

Parameters
this_The map to associate the callback with
cbThe callback to add

References map::attr_cbl, and callback_list_add().

Referenced by gui_internal_button_map_attr_new(), and navit_init().

◆ map_convert_dup()

◆ map_convert_free()

◆ map_convert_string()

char* map_convert_string ( struct map this_,
char *  str 
)

Converts a string from a map.

Parameters
this_The map the string to be converted is from
strThe string to be converted
Returns
The converted string. It has to be map_convert_free()d after use.

References map_convert_dup(), map_convert_string_tmp(), and attr::str.

Referenced by NGQPoint::_coordName(), attr_to_text_ext(), do_draw(), Backend::get_pois(), NGQPoint::getPOI(), graphics_process_selection_item(), gui_internal_cmd_pois(), navigation_itm_new(), navigation_way_init(), phase1_map(), search_list_common_new(), search_list_house_number_new(), search_list_street_new(), and search_list_town_new().

◆ map_convert_string_tmp()

char* map_convert_string_tmp ( struct map this_,
char *  str 
)

Converts a string from a map into a temporary allocated buffer. Conversion is not performed and original string is returned if map doesn't require conversion. So lifetime of returned value is very limited.

Parameters
this_The map the string to be converted is from
strThe string to be converted
Returns
The converted string. Don't care about it after use.

References map_methods::charset, dbg, lvl_error, map_converted_string_tmp, map::meth, and attr::str.

Referenced by get_icon(), gui_internal_cmd_bookmarks(), gui_internal_cmd_pois(), gui_internal_cmd_pois_item_selected(), gui_internal_cmd_position_do(), gui_internal_cmd_view_in_browser(), gui_internal_compose_item_address_string(), gui_internal_poi_icon(), gui_internal_populate_route_table(), gui_internal_select_waypoint(), map_convert_string(), request_navit_route_export_geojson(), and request_navit_route_export_gpx().

◆ map_destroy()

void map_destroy ( struct map m)

◆ map_destroy_do()

void map_destroy_do ( struct map m)

◆ map_dump()

void map_dump ( struct map map)

References map_dump_filedesc().

◆ map_dump_file()

void map_dump_file ( struct map map,
const char *  file 
)

◆ map_dump_filedesc()

void map_dump_filedesc ( struct map map,
FILE *  out 
)

◆ map_get_attr()

int map_get_attr ( struct map this_,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

Gets an attribute from a map.

Parameters
this_The map the attribute should be read from
typeThe type of the attribute to be read
attrPointer to an attrib-structure where the attribute should be written to
iter(NOT IMPLEMENTED) Used to iterate through all attributes of a type. Set this to NULL to get the first attribute, set this to an attr_iter to get the next attribute
Returns
True if the attribute type was found, false if not

References attr_generic_get_attr(), map_methods::map_get_attr, map::meth, attr::num, map::priv, attr::type, type, and attr::u.

Referenced by attr_to_text_ext(), Backend::get_maps(), gui_gtk_maps_init(), gui_internal_button_map_attr_new(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd2_setting_maps(), mapset_get_map_by_name(), mapset_next(), mapset_search_get_item(), navit_destroy(), navit_map_progress(), osd_route_guard_init(), osd_speed_cam_draw(), popup_show_item(), request_map_get_attr(), traffic_location_get_matching_points(), traffic_location_populate_route_graph(), and traffic_message_restore_segments().

◆ map_new()

struct map* map_new ( struct attr parent,
struct attr **  attrs 
)

Opens a new map.

This function opens a new map based on the attributes passed. This function takes the attribute "attr_type" to determine which type of map to open and passes all attributes to the map plugin's function that was specified in the plugin_register_new_map_type()-call.

Note that every plugin should accept an attribute of type "attr_data" to be passed with the filename of the map to be opened as value.

Parameters
attrsAttributes specifying which map to open, see description
Returns
The opened map or NULL on failure

References map::attr_cbl, attr_list_dup(), attr_search(), attr::attrs, callback_list_new(), cbl, dbg, lvl_error, map_destroy(), map_func, map::meth, navit_object_ref(), map::priv, and type.

Referenced by bookmarks_new(), Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel(), map_filter_new(), map_new_py(), maptype_register(), navigation_get_map(), navit_get_search_results_map(), parse_option(), pedestrian_navit_init(), read_former_destinations_from_file(), route_get_map_helper(), tracking_get_map(), and traffic_get_map().

◆ map_priv_is()

int map_priv_is ( struct map map,
struct map_priv priv 
)

Checks if a pointer points to the private data of a map.

Parameters
mapThe map whose private data should be checked.
privThe private data that should be checked.
Returns
True if priv is the private data of map

References map::priv.

Referenced by binmap_search_new(), and map_search_setup().

◆ map_projection()

◆ map_rect_create_item()

struct item* map_rect_create_item ( struct map_rect mr,
enum item_type  type_ 
)

◆ map_rect_destroy()

void map_rect_destroy ( struct map_rect mr)

Destroys a map rect.

Parameters
mrThe map rect to be destroyed

References map_rect::m, map_methods::map_rect_destroy, map::meth, and map_rect::priv.

Referenced by NGQPoint::_coordName(), bookmarks_clear_hash(), bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), do_draw(), Backend::get_pois(), NGQPoint::getInformation(), graphics_process_selection_item(), gui_gtk_destinations_update(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd_delete_waypoint(), gui_internal_cmd_formerdests(), gui_internal_cmd_map_download_do(), gui_internal_cmd_pois(), gui_internal_cmd_position_do(), gui_internal_cmd_view_attribute_details(), gui_internal_cmd_view_attributes(), gui_internal_cmd_view_in_browser(), gui_internal_dbus_signal(), gui_internal_populate_route_table(), gui_internal_select_waypoint(), gui_qml_dbus_signal(), item_coord_get_within_range(), map_dump_filedesc(), map_filter_rect_destroy(), map_rect_destroy_py(), map_route_occluded_bbox(), map_route_occluded_get_buildings(), map_route_occluded_rect_destroy(), model_poi(), navigation_get_attr(), navigation_itm_new(), navigation_itm_ways_update(), navigation_update_done(), navigation_way_get_max_delta(), navigation_way_init(), navit_add_former_destinations_from_file(), navit_cmd_map_add_curr_pos(), navit_cmd_map_item_set_attr(), navit_populate_search_results_map(), navit_speak(), navit_window_roadbook_update(), navit_zoom_to_route(), osd_nav_next_turn_draw(), osd_speed_cam_draw(), osd_text_draw(), pedestrian_draw_arrows(), phase1_map(), popup_item_dump(), popup_show_item(), read_former_destination_map_as_list(), request_navit_route_export_gpx(), route_find_nearest_street(), route_get_destination_description(), route_graph_build_done(), route_graph_build_next_map(), statusbar_route_update(), tm_add_item(), tm_dump_to_textfile(), tm_item_unref(), tracking_doupdate_lines(), tracking_get_attr(), traffic_location_get_matching_points(), traffic_location_populate_route_graph(), traffic_message_restore_segments(), traffic_point_match_segment_attributes(), and vehicle_demo_timer().

◆ map_rect_get_item()

struct item* map_rect_get_item ( struct map_rect mr)

Gets the next item from a map rect.

Returns an item from a map rect and advances the "item pointer" one step further, so that at the next call the next item is returned. Returns NULL if there are no more items.

Parameters
mrThe map rect to return an item from
Returns
An item from the map rect

References dbg_assert, map_rect::m, item::map, map_methods::map_rect_get_item, map::meth, and map_rect::priv.

Referenced by NGQPoint::_coordName(), bookmarks_load_hash(), do_draw(), Backend::get_pois(), NGQPoint::getPOI(), gui_gtk_bookmarks_update(), gui_gtk_destinations_update(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd_delete_waypoint(), gui_internal_cmd_formerdests(), gui_internal_cmd_map_download_do(), gui_internal_cmd_pois(), gui_internal_populate_route_table(), gui_internal_select_waypoint(), map_dump_filedesc(), map_filter_rect_get_item(), map_route_occluded_bbox(), map_route_occluded_get_buildings(), map_route_occluded_get_item(), model_poi(), navigation_get_attr(), navigation_itm_new(), navigation_itm_ways_update(), navigation_update_idle(), navit_add_former_destinations_from_file(), navit_populate_search_results_map(), navit_speak(), navit_window_roadbook_update(), navit_zoom_to_route(), osd_nav_next_turn_draw(), osd_route_guard_init(), osd_speed_cam_draw(), osd_text_draw(), pedestrian_draw_arrows(), phase1_map(), read_former_destination_map_as_list(), request_navit_route_export_geojson(), request_navit_route_export_gpx(), route_find_nearest_street(), route_graph_build_idle(), statusbar_route_update(), tm_dump_to_textfile(), tm_find_item(), tm_item_unref(), tracking_doupdate_lines(), traffic_location_get_matching_points(), traffic_location_populate_route_graph(), traffic_message_restore_segments(), and vehicle_demo_timer().

◆ map_rect_get_item_byid()

struct item* map_rect_get_item_byid ( struct map_rect mr,
int  id_hi,
int  id_lo 
)

Returns the item specified by the ID.

Map drivers may or may not allow multiple items with identical IDs. This function is not guaranteed to be suitable for iterating over multiple items with identical IDs in the same manner as map_rect_get_item(), as multiple subsequent calls may return items which were already returned by earlier calls.

If you are working with maps which allow multiple items with identical IDs, the only portable way to iterate over all items with a given ID is to use map_rect_get_item() and skip all items with non-matching IDs.

Parameters
mrThe map rect to search for the item
id_hiHigh part of the ID to be found
id_loLow part of the ID to be found
Returns
The item with the specified ID or NULL if not found

References dbg_assert, item::id_hi, item::id_lo, map_rect::m, item::map, map_methods::map_rect_get_item_byid, map::meth, and map_rect::priv.

Referenced by bookmarks_get_item(), get_icon(), NGQPoint::getInformation(), graphics_process_selection_item(), gui_internal_cmd_position_do(), gui_internal_cmd_view_attribute_details(), gui_internal_cmd_view_attributes(), gui_internal_cmd_view_in_browser(), gui_internal_dbus_signal(), gui_internal_poi_icon(), gui_qml_dbus_signal(), item_coord_get_within_range(), map_filter_rect_get_item_byid(), navigation_itm_new(), navigation_way_get_max_delta(), navigation_way_init(), navit_cmd_map_item_set_attr(), popup_item_dump(), popup_show_item(), popup_traffic_distortion(), route_get_destination_description(), tracking_get_attr(), and traffic_point_match_segment_attributes().

◆ map_rect_new()

struct map_rect* map_rect_new ( struct map m,
struct map_selection sel 
)

Creates a new map rect.

This creates a new map rect, which can be used to retrieve items from a map. If sel is a linked-list of selections, all of them will be used. If you pass NULL as sel, this means "get me the whole map".

Parameters
mThe map to build the rect on
selMap selection to choose the rectangle - may be NULL, see description
Returns
A new map rect

References map_rect::m, map_methods::map_rect_new, map::meth, map::priv, and map_rect::priv.

Referenced by NGQPoint::_coordName(), bookmarks_load_hash(), do_draw(), get_icon(), Backend::get_pois(), NGQPoint::getInformation(), NGQPoint::getPOI(), graphics_process_selection_item(), gui_gtk_bookmarks_update(), gui_gtk_destinations_update(), gui_internal_cmd2_route_height_profile(), gui_internal_cmd_delete_waypoint(), gui_internal_cmd_formerdests(), gui_internal_cmd_map_download_do(), gui_internal_cmd_pois(), gui_internal_cmd_position_do(), gui_internal_cmd_view_attribute_details(), gui_internal_cmd_view_attributes(), gui_internal_cmd_view_in_browser(), gui_internal_dbus_signal(), gui_internal_poi_icon(), gui_internal_populate_route_table(), gui_internal_select_waypoint(), gui_qml_dbus_signal(), item_coord_get_within_range(), map_dump_filedesc(), map_filter_rect_new(), map_rect_new_py(), map_route_occluded_bbox(), map_route_occluded_get_buildings(), map_route_occluded_rect_new(), model_poi(), navigation_get_attr(), navigation_itm_new(), navigation_itm_ways_update(), navigation_update(), navigation_way_get_max_delta(), navigation_way_init(), navit_add_former_destinations_from_file(), navit_cmd_map_add_curr_pos(), navit_cmd_map_item_set_attr(), navit_populate_search_results_map(), navit_speak(), navit_window_roadbook_update(), navit_zoom_to_route(), osd_nav_next_turn_draw(), osd_route_guard_init(), osd_speed_cam_draw(), osd_text_draw(), pedestrian_draw_arrows(), phase1_map(), popup_item_dump(), popup_show_item(), popup_traffic_distortion(), read_former_destination_map_as_list(), request_navit_route_export_geojson(), request_navit_route_export_gpx(), route_find_nearest_street(), route_get_destination_description(), route_graph_build_next_map(), statusbar_route_update(), tm_add_item(), tm_dump_to_textfile(), tm_item_unref(), tracking_doupdate_lines(), tracking_get_attr(), traffic_location_open_map_rect(), traffic_message_restore_segments(), traffic_point_match_segment_attributes(), and vehicle_demo_timer().

◆ map_ref()

struct map* map_ref ( struct map m)

◆ map_remove_callback()

void map_remove_callback ( struct map this_,
struct callback cb 
)

Removes a callback from the list of attribute-change callbacks.

This function removes one callback from the list of callbacks functions that should be called when attributes of the map change.

Parameters
this_The map to remove the callback from
cbThe callback to remove

References map::attr_cbl, and callback_list_remove().

Referenced by gui_internal_button_map_attr_new().

◆ map_requires_conversion()

int map_requires_conversion ( struct map this_)

Checks if strings from a map have to be converted.

Parameters
this_Map to be checked for the need to convert strings
Returns
True if strings from the map have to be converted, false otherwise

References map_methods::charset, and map::meth.

Referenced by do_draw().

◆ map_search_destroy()

void map_search_destroy ( struct map_search this_)

Destroys a map search struct.

Parameters
this_The map search struct to be destroyed

References map_methods::charset, country_search_destroy(), map_search::m, map_methods::map_search_destroy, map::meth, map_search::priv, map_search::search_attr, attr::str, attr::type, and attr::u.

Referenced by mapset_search_get_item().

◆ map_search_get_item()

struct item* map_search_get_item ( struct map_search this_)

Returns an item from a map search.

This returns an item of the result of a search on a map and advances the "item pointer" one step, so that at the next call the next item will be returned. If there are no more items in the result NULL is returned.

Parameters
this_Map search struct of the search
Returns
One item of the result

References country_search_get_item(), map_search::m, item::map, map_methods::map_search_get_item, map::meth, map_search::priv, map_search::search_attr, and attr::type.

Referenced by mapset_search_get_item().

◆ map_search_new()

struct map_search* map_search_new ( struct map m,
struct item item,
struct attr search_attr,
int  partial 
)

Starts a search on a map.

This function starts a search on a map. What attributes one can search for depends on the map plugin.

The OSM/binfile plugin currently supports: attr_town_name, attr_street_name The MG plugin currently supports: ttr_town_postal, attr_town_name, attr_street_name

If you enable partial matches bear in mind that the search matches only the begin of the strings - a search for a street named "street" would match to "streetfoo", but not to "somestreet". Search is case insensitive.

The item passed to this function specifies a "superior item" to "search within" - e.g. a town in which we want to search for a street, or a country in which to search for a town.

Please also note that the search for countries is not handled by map plugins but by navit internally - have a look into country.c for details. Because of that every map plugin has to accept a country item to be passed as "superior item".

Note: If you change something here, please make sure to also update the documentation of mapset_search_new() in mapset.c!

Parameters
mThe map that should be searched
itemSpecifies a superior item to "search within" (see description)
search_attrAttribute specifying what to search for. See description.
partialSet this to true to also have partial matches. See description.
Returns
A new map search struct for this search

References map_methods::charset, country_search_new(), dbg, lvl_debug, map_search::m, map_methods::map_search_new, map::meth, map::priv, map_search::priv, map_search::search_attr, attr::str, attr::type, and attr::u.

Referenced by mapset_search_get_item().

◆ map_selection_contains_item()

int map_selection_contains_item ( struct map_selection sel,
int  follow,
enum item_type  type 
)

Checks if a selection contains a item.

This function checks if a selection contains a item type

Parameters
selThe selection to be checked
followWhether the next pointer of the selection should be followed
itemThe item type to be checked
Returns
True if there is a match, false otherwise

References item_range_contains_item(), map_selection::next, map_selection::range, and type.

Referenced by poly_get(), street_get(), and town_get().

◆ map_selection_contains_item_range()

int map_selection_contains_item_range ( struct map_selection sel,
int  follow,
struct item_range range,
int  count 
)

Checks if a selection contains a item range.

This function checks if a selection contains at least one of the items in range

Parameters
selThe selection to be checked
followWhether the next pointer of the selection should be followed
rangesThe item ranges to be checked @count the number of elements in ranges
Returns
True if there is a match, false otherwise

References item_range_intersects_range(), map_selection::next, and map_selection::range.

Referenced by file_next().

◆ map_selection_contains_item_rect()

int map_selection_contains_item_rect ( struct map_selection sel,
struct item item 
)

Checks if a selection contains a rectangle containing an item.

This function checks if a selection contains a rectangle which exactly contains an item. The rectangle is automatically built around the given item.

Parameters
selThe selection to be checked
itemThe item that the rectangle should be built around
Returns
True if the rectangle is within the selection, false otherwise

References c, coord_rect_extend(), item_coord_get(), coord_rect::lu, map_selection_contains_rect(), and coord_rect::rl.

Referenced by binmap_search_get_item().

◆ map_selection_contains_point()

static int map_selection_contains_point ( struct map_selection sel,
struct coord c 
)
inlinestatic

Checks if a coordinate is within a map selection.

Checks if a coordinate is within a map selection. Note that since a selection of NULL means "select everything", with sel = NULL this will always return true. If there are more than one selection in a linked-list, it is sufficient if only one of the selections contains the coordinate.

Parameters
selThe selection to check if the point is within
cCoordinate to check if it is within the selection
Returns
True if the coordinate is within one of the selections, False otherwise

References c, map_selection::c_rect, coord_rect::lu, map_selection::next, coord_rect::rl, map_selection::u, coord::x, pcoord::x, coord::y, and pcoord::y.

◆ map_selection_contains_polygon()

static int map_selection_contains_polygon ( struct map_selection sel,
struct coord c,
int  count 
)
inlinestatic

Checks if a polygon is within a map selection.

See also
Please refer to map_selection_contains_point()
Parameters
selThe selection to check if the polygon is within
cPointer to coordinates of the polygon
countNumber of coordinates in c
Returns
True if the polygon is within one of the selections, False otherwise

References c, coord_rect::lu, map_selection_contains_rect(), coord_rect::rl, coord::x, pcoord::x, coord::y, and pcoord::y.

◆ map_selection_contains_polyline()

static int map_selection_contains_polyline ( struct map_selection sel,
struct coord c,
int  count 
)
inlinestatic

Checks if a polyline is within a map selection.

See also
Please refer to map_selection_contains_point()
Parameters
selThe selection to check if the polyline is within
cCoordinates of the polyline to check if it is within the selection
countNumber of coordinates in c
Returns
True if the polyline is within one of the selections, False otherwise

References c, map_selection::c_rect, coord_rect::lu, map_selection::next, coord_rect::rl, map_selection::u, coord::x, pcoord::x, coord::y, and pcoord::y.

◆ map_selection_contains_rect()

static int map_selection_contains_rect ( struct map_selection sel,
struct coord_rect r 
)
inlinestatic

Checks if a rectangle is within a map selection.

See also
Please refer to map_selection_contains_point()
Parameters
selThe selection to check if the rectangle is within
rRectangle to be checked for
Returns
True if the rectangle is within one of the selections, False otherwise

References map_selection::c_rect, dbg_assert, coord_rect::lu, map_selection::next, coord_rect::rl, map_selection::u, coord::x, and coord::y.

Referenced by map_selection_contains_item_rect(), and map_selection_contains_polygon().

◆ map_selection_destroy()

◆ map_selection_dup()

struct map_selection* map_selection_dup ( struct map_selection sel)

Duplicates a map selection.

Parameters
selThe map selection to duplicate
Returns
The duplicated map selection

References map_selection_dup_pro(), and projection_none.

Referenced by transform_dup(), transform_get_selection(), and transform_set_screen_selection().

◆ map_selection_dup_pro()

struct map_selection* map_selection_dup_pro ( struct map_selection sel,
enum projection  from,
enum projection  to 
)

Duplicates a map selection, transforming coordinates.

This duplicates a map selection and at the same time transforms the internal coordinates of the selection from one projection to another.

Parameters
selThe map selection to be duplicated
fromThe projection used for the selection at the moment
toThe projection that should be used for the duplicated selection
Returns
A duplicated, transformed map selection

References map_selection::c_rect, coord_rect::lu, map_selection::next, next, projection_none, coord_rect::rl, transform_from_to(), and map_selection::u.

Referenced by Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd_pois(), map_selection_dup(), and model_poi().

◆ map_selection_rect_new()

struct map_selection* map_selection_rect_new ( struct pcoord center,
int  distance,
int  order 
)

Creates a new rectangular map selection.

Parameters
centerCoordinates of the center of the new rectangle
distanceDistance of the rectangle's borders from the center
orderDesired order of the new selection
Returns
The new map selection

References map_selection::c_rect, center, item_range_all, coord_rect::lu, map_selection::order, map_selection::range, coord_rect::rl, map_selection::u, coord::x, and coord::y.

Referenced by Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd_pois(), and model_poi().

◆ map_set_attr()

int map_set_attr ( struct map this_,
struct attr attr 
)

Sets an attribute of a map.

This sets an attribute of a map, overwriting an attribute of the same type if it already exists. This function also calls all the callbacks that are registred to be called when attributes change.

Parameters
this_The map to set the attribute of
attrThe attribute to set
Returns
True if the attr could be set, false otherwise

References map::attr_cbl, attr_generic_set_attr(), callback_list_call_attr_2, map_methods::map_set_attr, map::meth, map::priv, and attr::type.

Referenced by gui_gtk_action_toggled(), gui_internal_button_map_attr_new(), map_set_attr_py(), navit_init(), pedestrian_navit_init(), and request_map_set_attr().

◆ map_set_projection()

void map_set_projection ( struct map this_,
enum projection  pro 
)

Sets the projection of a map.

Parameters
this_The map to set the projection of
proThe projection to be set

References map::meth, and map_methods::pro.

◆ map_unref()

void map_unref ( struct map m)

◆ maps_new()

struct maps* maps_new ( struct attr parent,
struct attr **  attrs 
)