navit
0.5.1-trunk
|
Contains exported code for route.c. More...
Go to the source code of this file.
Data Structures | |
struct | route_crossing |
struct | route_crossings |
struct | street_data |
Information about a street. More... | |
Enumerations | |
enum | route_path_flags { route_path_flag_none =0, route_path_flag_cancel =1, route_path_flag_async =2, route_path_flag_no_rebuild =4 } |
enum | route_status { route_status_no_destination =0, route_status_destination_set =1, route_status_not_found =1|2, route_status_building_path =1|4, route_status_building_graph =1|4|8, route_status_path_done_new =1|16, route_status_path_done_incremental =1|32 } |
Functions | |
struct route * | route_new (struct attr *parent, struct attr **attrs) |
Creates a completely new route structure. More... | |
struct route * | route_dup (struct route *orig) |
Duplicates a route object. More... | |
void | route_set_mapset (struct route *this_, struct mapset *ms) |
Sets the mapset of the route passwd. More... | |
void | route_set_profile (struct route *this_, struct vehicleprofile *prof) |
Sets the vehicle profile of a route. More... | |
struct mapset * | route_get_mapset (struct route *this_) |
Returns the mapset of the route passed. More... | |
struct route_info * | route_get_pos (struct route *this_) |
Returns the current position within the route passed. More... | |
struct route_info * | route_get_dst (struct route *this_) |
Returns the destination of the route passed. More... | |
int | route_get_path_set (struct route *this_) |
Checks if the path is calculated for the route passed. More... | |
int | route_contains (struct route *this_, struct item *item) |
Checks if the route passed contains a certain item within the route path. More... | |
int | route_destination_reached (struct route *this_) |
Checks if a route has reached its destination. More... | |
void | route_set_position (struct route *this_, struct pcoord *pos) |
This sets the current position of the route passed. More... | |
void | route_set_position_from_tracking (struct route *this_, struct tracking *tracking, enum projection pro) |
Sets a route's current position based on coordinates from tracking. More... | |
struct map_selection * | route_rect (int order, struct coord *c1, struct coord *c2, int rel, int abs) |
Returns a single map selection. More... | |
void | route_set_destinations (struct route *this_, struct pcoord *dst, int count, int async) |
Sets the destination of a route. More... | |
int | route_get_destinations (struct route *this_, struct pcoord *pc, int count) |
int | route_get_destination_count (struct route *this_) |
Get the destinations count for the route. More... | |
void | route_get_distances (struct route *this_, struct coord *c, int count, int *distances) |
void | route_set_destination (struct route *this_, struct pcoord *dst, int async) |
Start a route given set of coordinates. More... | |
void | route_append_destination (struct route *this_, struct pcoord *dst, int async) |
Append a waypoint to the route. More... | |
void | route_remove_nth_waypoint (struct route *this_, int n) |
Remove the nth waypoint of the route. More... | |
void | route_remove_waypoint (struct route *this_) |
char * | route_get_destination_description (struct route *this_, int n) |
Returns a description for a waypoint as (type or street_name_systematic) + (label or WayID[osm_wayid]) More... | |
struct coord | route_get_coord_dist (struct route *this_, int dist) |
Returns a coordinate at a given distance. More... | |
struct street_data * | street_get_data (struct item *item) |
Gets street data for an item. More... | |
struct street_data * | street_data_dup (struct street_data *orig) |
Copies street data. More... | |
void | street_data_free (struct street_data *sd) |
Frees street data. More... | |
void | route_info_free (struct route_info *inf) |
Destroys a route_info. More... | |
struct street_data * | route_info_street (struct route_info *rinf) |
Returns street data for a route info. More... | |
struct map * | route_get_map (struct route *this_) |
Returns a new map containing the route path. More... | |
struct map * | route_get_graph_map (struct route *this_) |
Returns a new map containing the route graph. More... | |
enum route_path_flags | route_get_flags (struct route *this_) |
Returns the flags for the route. More... | |
int | route_has_graph (struct route *this_) |
Whether the route has a valid graph. More... | |
void | route_set_projection (struct route *this_, enum projection pro) |
int | route_set_attr (struct route *this_, struct attr *attr) |
int | route_add_attr (struct route *this_, struct attr *attr) |
int | route_remove_attr (struct route *this_, struct attr *attr) |
struct attr_iter * | route_attr_iter_new (void) |
void | route_attr_iter_destroy (struct attr_iter *iter) |
int | route_get_attr (struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
void | route_init (void) |
void | route_destroy (struct route *this_) |
Contains exported code for route.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 route.c and that is exported to other modules.
enum route_path_flags |
enum route_status |
References attr::callback, callback_list_add(), route::cbl2, attr::type, and attr::u.
Referenced by gui_gtk_init(), navigation_set_route(), navit_init(), and request_route_add_attr().
Append a waypoint to the route.
This appends a waypoint to the current route, targetting the street nearest to the coordinates passed, and updates the route.
this | The route to set the destination for |
dst | Coordinates of the new waypoint |
async | If set, do routing asynchronously |
References pcoord::pro, route_find_nearest_street(), route_get_dst(), route_graph_destroy(), route_info_distances(), route_path_update(), and route_set_destinations().
Referenced by navit_set_destination().
void route_attr_iter_destroy | ( | struct attr_iter * | iter | ) |
Referenced by NGQProxyRoute::dropIterFunc().
struct attr_iter* route_attr_iter_new | ( | void | ) |
Referenced by NGQProxyRoute::getIterFunc().
Checks if the route passed contains a certain item within the route path.
This function checks if a certain items exists in the path that navit will guide the user to his destination. It does not check if this item exists in the route graph!
this | The route to check for this item |
item | The item to search for |
References item_hash_lookup(), item_is_equal, and startup::pos.
Referenced by tracking_is_on_route().
Checks if a route has reached its destination.
this | The route to be checked |
References AF_ONEWAY, AF_ONEWAYREV, street_data::flags, street_data::item, item_is_equal, route_info::lenneg, route_info::lenpos, route_info::lp, startup::pos, projection_none, route_next_destination(), route_projection(), route_info::street, and transform_distance().
Referenced by navit_vehicle_update_position().
void route_destroy | ( | struct route * | this_ | ) |
References route::graph, route::graph_map, route::map, map_destroy(), route::path2, route::pos, route_clear_destinations(), route_graph_destroy(), route_info_free(), and route_path_destroy().
Referenced by navit_destroy(), and request_route_destroy().
Duplicates a route object.
References callback_list_new(), route::cbl2, route::destination_distance, route::flags, route::ms, navit_object_ref(), route_func, and route::vehicleprofile.
Referenced by request_route_dup().
int route_get_attr | ( | struct route * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
References route_info::c, dbg, route::destinations, attr_iter::list, lvl_debug, attr::map, route_path::next, attr::num, route_path::path, route::path2, route_path::path_len, route_path::path_time, route::pc, attr::pcoord, pcoord::pro, projection_mg, route_get_dst(), route_get_map(), route::route_status, route_status_path_done_incremental, route_status_path_done_new, type, attr::type, attr_iter::u, attr::u, route::v, attr::vehicle, attr::vehicleprofile, route::vehicleprofile, coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by NGQProxyRoute::getAttrFunc(), gui_gtk_route_callback(), gui_internal_cmd_pois(), gui_internal_populate_route_table(), map_route_occluded_rect_new(), navigation_set_route(), navigation_update(), pedestrian_draw_arrows(), pedestrian_navit_init(), and request_route_get_attr().
Returns a coordinate at a given distance.
This function returns the coordinate, where the user will be if he follows the current route for a certain distance.
this_ | The route we're driving upon |
dist | The distance in meters |
References route_path_segment::c, route_info::c, route_path_segment::data, int(), route_segment_data::len, route_path_segment::ncoords, route_path_segment::next, projection_none, route_get_dst(), route_projection(), transform_polyline_length(), coord::x, and coord::y.
Get the destinations count for the route.
this | The route instance |
Referenced by navit_get_destination_count(), navit_remove_nth_waypoint(), navit_remove_waypoint(), navit_set_destination(), and navit_vehicle_update_position().
Returns a description for a waypoint as (type or street_name_systematic) + (label or WayID[osm_wayid])
this | The route instance |
n | The nth waypoint |
References _, attr_to_text(), item::id_hi, item::id_lo, item, street_data::item, item_attr_get(), item_to_name(), label, item::map, map_rect_destroy(), map_rect_get_item_byid(), map_rect_new(), route_info::street, item::type, type, and attr::type.
Referenced by navit_get_destination_description(), and navit_vehicle_update_position().
References route_info::c, pcoord::pro, projection_mg, coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by navit_get_destinations(), navit_set_destination(), navit_vehicle_update_position(), and route_set_profile().
References route_path_get_distances().
Referenced by gui_internal_cmd_pois_item().
struct route_info* route_get_dst | ( | struct route * | this | ) |
Returns the destination of the route passed.
this | The route to get the destination for |
Referenced by rm_coord_get(), route_append_destination(), route_get_attr(), route_get_coord_dist(), route_projection(), route_remove_nth_waypoint(), and route_set_destinations().
enum route_path_flags route_get_flags | ( | struct route * | this_ | ) |
Returns a new map containing the route graph.
This function returns a new map containing the route graph.
Do not map_destroy() this!
this_ | The route to get the map of |
References route::graph_map, and route_get_map_helper().
Referenced by navigation_itm_new(), and navit_init().
Returns a new map containing the route path.
This function returns a new map containing the route path.
Do not map_destroy() this!
this_ | The route to get the map of |
References route::map, and route_get_map_helper().
Referenced by gui_internal_cmd2_route_height_profile(), gui_internal_select_waypoint(), navigation_update(), navit_init(), navit_zoom_to_route(), route_get_attr(), route_get_map_py(), and vehicle_demo_timer().
Returns the mapset of the route passed.
this | The route to get the mapset of |
Checks if the path is calculated for the route passed.
this | The route to check |
Referenced by navit_check_route().
struct route_info* route_get_pos | ( | struct route * | this | ) |
Returns the current position within the route passed.
this | The route to get the position for |
References startup::pos.
Whether the route has a valid graph.
References route::graph.
Referenced by navigation_update_idle().
void route_info_free | ( | struct route_info * | inf | ) |
Destroys a route_info.
info | The route info to be destroyed |
References route_info::street, and street_data_free().
Referenced by route_clear_destinations(), route_destroy(), route_remove_nth_waypoint(), route_remove_waypoint(), route_set_position_flags(), and route_set_position_from_tracking().
struct street_data* route_info_street | ( | struct route_info * | rinf | ) |
Returns street data for a route info.
rinf | The route info to return the street data for |
References route_info::street.
void route_init | ( | void | ) |
References route_graph_map_new(), and route_map_new().
Referenced by main_real().
Creates a completely new route structure.
attrs | Not used |
References attr_generic_get_attr(), callback_list_new(), navit_object_ref(), attr::num, route_func, and attr::u.
struct map_selection* route_rect | ( | int | order, |
struct coord * | c1, | ||
struct coord * | c2, | ||
int | rel, | ||
int | abs | ||
) |
Returns a single map selection.
References map_selection::c_rect, dbg, coord_rect::lu, lvl_debug, item_range::max, map_selection::next, map_selection::order, map_selection::range, coord_rect::rl, route_item_first, route_item_last, map_selection::u, coord::x, and coord::y.
Referenced by route_find_nearest_street(), route_rect_add(), and tracking_doupdate_lines().
References attr::callback, callback_list_remove(), route::cbl2, dbg, lvl_debug, attr::type, attr::u, and route::v.
Referenced by navigation_set_route(), and request_route_remove_attr().
Remove the nth waypoint of the route.
this | The route instance |
n | The waypoint to remove |
References route_get_dst(), route_graph_destroy(), route_info_free(), and route_path_update().
Referenced by navit_remove_nth_waypoint().
void route_remove_waypoint | ( | struct route * | this_ | ) |
References route_path::path, route_graph_flood(), route_graph_reset(), route_info_free(), route_path_destroy(), and route_status_no_destination.
Referenced by navit_remove_waypoint(), and navit_vehicle_update_position().
References attr_to_name(), callback_list_call_attr_2, route::cbl2, attr::coord_geo, dbg, lvl_error, attr::num, attr::pcoord, pcoord::pro, projection_mg, route_path_flag_async, route_path_flag_no_rebuild, route_set_destination(), route_set_position(), route_set_position_flags(), route::route_status, transform_from_geo(), attr::type, attr::u, route::v, attr::vehicle, vehicle_get_attr(), coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by request_route_set_attr(), route_graph_update(), route_path_update_done(), route_set_destinations(), and NGQProxyRoute::setAttrFunc().
Start a route given set of coordinates.
this | The route instance |
dst | The coordinate to start routing to |
async | Set to 1 to do route calculation asynchronously |
References route_set_destinations().
Referenced by navit_add_former_destinations_from_file(), navit_set_destination(), and route_set_attr().
Sets the destination of a route.
This sets the destination of a route to the street nearest to the coordinates passed and updates the route.
this | The route to set the destination for |
dst | Points to an array of coordinates to set as destinations, which will be visited in the order in which they appear in the array (the last one is the final destination) |
count | Number of items in dst
|
async | If set, do routing asynchronously |
References callback_list_call_attr_1, attr::num, pcoord::pro, profile, route_clear_destinations(), route_find_nearest_street(), route_get_dst(), route_graph_destroy(), route_info_distances(), route_path_update(), route_set_attr(), route_status_destination_set, route_status_no_destination, attr::type, and attr::u.
Referenced by NGQProxyRoute::addDestination(), navit_add_former_destinations_from_file(), navit_set_destinations(), route_append_destination(), route_set_destination(), and route_set_profile().
Sets the mapset of the route passwd.
this | The route to set the mapset for |
ms | The mapset to set for this route |
Referenced by navit_init().
This sets the current position of the route passed.
This will set the current position of the route passed to the street that is nearest to the passed coordinates. It also automatically updates the route.
this | The route to set the position of |
pos | Coordinates to set as position |
References route_path_flag_async, and route_set_position_flags().
Referenced by navit_set_position(), navit_vehicle_update_position(), and route_set_attr().
void route_set_position_from_tracking | ( | struct route * | this, |
struct tracking * | tracking, | ||
enum projection | pro | ||
) |
Sets a route's current position based on coordinates from tracking.
this | The route to set the current position of |
tracking | The tracking to get the coordinates from |
References street_data::c, route_info::c, c, street_data::count, dbg, item::id_hi, item::id_lo, street_data::item, route_info::lenneg, route_info::lenpos, route_info::lp, lvl_debug, lvl_info, startup::pos, route_info::pos, route_info_distances(), route_info_free(), route_path_update(), route_info::street, street_data_dup(), route_info::street_direction, tracking_get_pos(), tracking_get_segment_pos(), tracking_get_street_data(), tracking_get_street_direction(), coord::x, and coord::y.
Referenced by navit_vehicle_update_position().
void route_set_profile | ( | struct route * | this, |
struct vehicleprofile * | prof | ||
) |
Sets the vehicle profile of a route.
this | The route to set the profile for |
prof | The vehicle profile |
References route_get_destinations(), and route_set_destinations().
Referenced by navit_set_vehicle(), and navit_set_vehicleprofile().
void route_set_projection | ( | struct route * | this_, |
enum projection | pro | ||
) |
Referenced by navit_init().
struct street_data* street_data_dup | ( | struct street_data * | orig | ) |
Copies street data.
orig | The street data to copy |
References size.
Referenced by route_set_position_from_tracking().
void street_data_free | ( | struct street_data * | sd | ) |
Frees street data.
sd | Street data to be freed |
Referenced by NGQPoint::_coordName(), item_get_heightline(), map_route_occluded_buildings_free(), map_route_occluded_get_item(), map_route_occluded_rect_destroy(), route_find_nearest_street(), route_info_free(), tracking_doupdate_lines(), and tracking_flush().
struct street_data* street_get_data | ( | struct item * | item | ) |
Gets street data for an item.
item | The item to get the data for |
References AF_SPEED_LIMIT, street_data::c, c, street_data::count, street_data::flags, item, street_data::item, item_attr_get(), item_coord_get(), item_get_default_flags(), street_data::maxspeed, attr::num, item::type, and attr::u.
Referenced by route_find_nearest_street().