navit
0.5.3-trunk
|
Contains code that makes navit able to load maps. More...
#include <glib.h>
#include <string.h>
#include "debug.h"
#include "coord.h"
#include "projection.h"
#include "item.h"
#include "map.h"
#include "maptype.h"
#include "transform.h"
#include "plugin.h"
#include "callback.h"
#include "country.h"
#include "xmlconfig.h"
Data Structures | |
struct | map |
struct | map_rect |
struct | map_search |
Functions | |
struct map * | map_new (struct attr *parent, struct attr **attrs) |
Opens a new map. More... | |
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_rect * | map_rect_new (struct map *m, struct map_selection *sel) |
Creates a new map rect. More... | |
struct item * | map_rect_get_item (struct map_rect *mr) |
Gets the next item from a map rect. More... | |
struct item * | map_rect_get_item_byid (struct map_rect *mr, int id_hi, int id_lo) |
Returns the item specified by the ID. More... | |
void | map_rect_destroy (struct map_rect *mr) |
Destroys a map rect. More... | |
struct map_search * | map_search_new (struct map *m, struct item *item, struct attr *search_attr, int partial) |
Starts a search on a map. More... | |
struct item * | map_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_selection * | map_selection_rect_new (struct pcoord *center, int distance, int order) |
Creates a new rectangular map selection. More... | |
struct map_selection * | map_selection_dup_pro (struct map_selection *sel, enum projection from, enum projection to) |
Duplicates a map selection, transforming coordinates. More... | |
struct map_selection * | map_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) |
struct item * | map_rect_create_item (struct map_rect *mr, enum item_type type_) |
Variables | |
char * | map_converted_string_tmp =NULL |
struct object_func | map_func |
Contains code that makes navit able to load maps.
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 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 General Public License for more details.
You should have received a copy of the GNU 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 the code that makes navit able to load maps. Because navit is able to open maps in different formats, this code does not handle any map format itself. This is done by map plugins which register to this code by calling plugin_register_category_map().
When opening a new map, the map plugin will return a pointer to a map_priv struct, which can be defined by the map plugin and contains whatever private data the map plugin needs to access the map. This pointer will also be used as a "handle" to access the map opened.
A common task is to create a "map rect". A map rect is a rectangular part of the map, that one can for example retrieve items from. It is not possible to retrieve items directly from the complete map. Creating a map rect returns a pointer to a map_rect_priv, which contains private data for the map rect and will be used as "handle" for this map rect.
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.
this_ | The map to associate the callback with |
cb | The callback to add |
References map::attr_cbl, and callback_list_add().
Referenced by gui_internal_button_map_attr_new(), and navit_init().
char* map_convert_dup | ( | char * | str | ) |
References map_converted_string_tmp, and attr::str.
Referenced by map_convert_string(), search_list_house_number_dup(), search_list_street_dup(), and search_list_town_dup().
void map_convert_free | ( | char * | str | ) |
Frees the memory allocated for a converted string.
str | The string to be freed |
References attr::str.
Referenced by NGQPoint::_coordName(), attr_to_text_ext(), do_draw(), NGQPoint::getPOI(), graphics_process_selection_item(), navigation_destroy_itms_cmds(), navigation_itm_ways_clear(), phase1_map(), search_list_common_new(), search_list_house_number_destroy(), search_list_street_destroy(), and search_list_town_destroy().
char* map_convert_string | ( | struct map * | this_, |
char * | str | ||
) |
Converts a string from a map.
this_ | The map the string to be converted is from |
str | The string to be converted |
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().
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.
this_ | The map the string to be converted is from |
str | The string to be converted |
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().
void map_destroy | ( | struct map * | m | ) |
Destroys an opened map.
m | The map to be destroyed |
References map::attr_cbl, attr_list_free(), callback_list_destroy(), map_methods::map_destroy, map::meth, and map::priv.
Referenced by bookmarks_destroy(), map_destroy_py(), map_filter_destroy(), map_new(), navit_destroy(), osm_read_input_data(), and route_destroy().
void map_dump | ( | struct map * | map | ) |
References map_dump_filedesc().
void map_dump_file | ( | struct map * | map, |
const char * | file | ||
) |
References dbg, lvl_error, and map_dump_filedesc().
Referenced by map_dump_file_py(), map_route_occluded_rect_destroy(), and map_route_occluded_rect_new().
void map_dump_filedesc | ( | struct map * | map, |
FILE * | out | ||
) |
References item, item_dump_filedesc(), map_rect_destroy(), map_rect_get_item(), and map_rect_new().
Referenced by map_dump(), map_dump_file(), and request_map_dump().
int map_get_attr | ( | struct map * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
Gets an attribute from a map.
this_ | The map the attribute should be read from |
type | The type of the attribute to be read |
attr | Pointer 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 |
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().
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.
attrs | Attributes specifying which map to open, see description |
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().
Checks if a pointer points to the private data of a map.
map | The map whose private data should be checked. |
priv | The private data that should be checked. |
References map::priv.
Referenced by binmap_search_new(), and map_search_setup().
enum projection map_projection | ( | struct map * | this_ | ) |
Returns the projection of a map.
this_ | The map to return the projection of |
Referenced by bookmarks_append_destinations(), do_draw(), Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd_formerdests(), gui_internal_cmd_pois(), gui_internal_populate_route_table(), gui_internal_select_waypoint(), item_coord_get_pro(), model_poi(), navigation_analyze_roundabout(), navit_add_former_destinations_from_file(), route_find_nearest_street(), route_graph_add_street(), route_path_new(), search_house_number_coordinate(), search_list_street_new(), search_list_town_new(), tracking_doupdate_lines(), tracking_map_item_coord_get(), traffic_location_open_map_rect(), traffic_location_populate_route_graph(), and traffic_message_restore_segments().
Referenced by navit_cmd_map_add_curr_pos(), navit_populate_search_results_map(), and tm_add_item().
void map_rect_destroy | ( | struct map_rect * | mr | ) |
Destroys a map rect.
mr | The 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().
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.
mr | The map rect to return an item from |
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().
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.
mr | The map rect to search for the item |
id_hi | High part of the ID to be found |
id_lo | Low part of the ID to be 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().
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".
m | The map to build the rect on |
sel | Map selection to choose the rectangle - may be NULL, see description |
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().
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.
this_ | The map to remove the callback from |
cb | The callback to remove |
References map::attr_cbl, and callback_list_remove().
Referenced by gui_internal_button_map_attr_new().
int map_requires_conversion | ( | struct map * | this_ | ) |
Checks if strings from a map have to be converted.
this_ | Map to be checked for the need to convert strings |
References map_methods::charset, and map::meth.
Referenced by do_draw().
void map_search_destroy | ( | struct map_search * | this_ | ) |
Destroys a map search struct.
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().
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.
this_ | Map search struct of the search |
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().
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!
m | The map that should be searched |
item | Specifies a superior item to "search within" (see description) |
search_attr | Attribute specifying what to search for. See description. |
partial | Set this to true to also have partial matches. See description. |
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().
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
sel | The selection to be checked |
follow | Whether the next pointer of the selection should be followed |
item | The item type to be checked |
References item_range_contains_item(), map_selection::next, map_selection::range, and type.
Referenced by poly_get(), street_get(), and town_get().
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
sel | The selection to be checked |
follow | Whether the next pointer of the selection should be followed |
ranges | The item ranges to be checked @count the number of elements in ranges |
References item_range_intersects_range(), map_selection::next, and map_selection::range.
Referenced by file_next().
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.
sel | The selection to be checked |
item | The item that the rectangle should be built around |
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().
void map_selection_destroy | ( | struct map_selection * | sel | ) |
Destroys a map selection.
sel | The map selection to be destroyed |
References map_selection::next, and next.
Referenced by do_draw(), Backend::get_pois(), NGQPoint::getPOI(), gui_internal_cmd_pois(), gui_internal_cmd_position_do(), model_poi(), route_find_nearest_street(), tm_rect_new(), tracking_doupdate_lines(), traffic_location_get_matching_points(), traffic_location_open_map_rect(), traffic_location_populate_route_graph(), traffic_message_restore_segments(), traffic_process_messages_int(), transform_destroy(), and transform_set_screen_selection().
struct map_selection* map_selection_dup | ( | struct map_selection * | sel | ) |
Duplicates a map selection.
sel | The map selection to duplicate |
References map_selection_dup_pro(), and projection_none.
Referenced by transform_dup(), transform_get_selection(), and transform_set_screen_selection().
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.
sel | The map selection to be duplicated |
from | The projection used for the selection at the moment |
to | The projection that should be used for the duplicated 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().
struct map_selection* map_selection_rect_new | ( | struct pcoord * | center, |
int | distance, | ||
int | order | ||
) |
Creates a new rectangular map selection.
center | Coordinates of the center of the new rectangle |
distance | Distance of the rectangle's borders from the center |
order | Desired order of the new 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().
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.
this_ | The map to set the attribute of |
attr | The attribute to set |
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().
void map_set_projection | ( | struct map * | this_, |
enum projection | pro | ||
) |
Sets the projection of a map.
this_ | The map to set the projection of |
pro | The projection to be set |
References map::meth, and map_methods::pro.
char* map_converted_string_tmp =NULL |
Referenced by map_convert_dup(), and map_convert_string_tmp().
struct object_func map_func |
Referenced by map_new(), and object_func_lookup().