vikrouting

vikrouting — the routing framework

Functions

Description

This module handles the list of VikRoutingEngine. It also handles the "default" functions.

Functions

vik_routing_default_find ()

gboolean
vik_routing_default_find (VikTrwLayer *vt,
                          struct LatLon start,
                          struct LatLon end);

Route computation with default engine.

Return indicates success or not


vik_routing_prefs_init ()

void
vik_routing_prefs_init ();

Initialize the preferences of the routing feature.


vik_routing_register ()

void
vik_routing_register (VikRoutingEngine *engine);

Register a new routing engine.

Parameters

engine

new routing engine to register

 

vik_routing_unregister_all ()

void
vik_routing_unregister_all ();

Unregister all registered routing engines.


vik_routing_foreach_engine ()

void
vik_routing_foreach_engine (GFunc func,
                            gpointer user_data);

Loop over all registered routing engines.

Parameters

func

the function to run on each element

 

user_data

user's data to give to each call of func

 

Predicate ()

gboolean
(*Predicate) (gpointer data,
              gpointer user_data);

vik_routing_ui_selector_new ()

GtkWidget *
vik_routing_ui_selector_new (Predicate func,
                             gpointer user_data);

Creates a combo box to allow selection of a routing engine.

We use GObject data hashtable to store and retrieve the VikRoutingEngine associated to the selection.

Parameters

func

user function to decide if an engine has to be added or not

 

user_data

user data for previous function

 

Returns

the combo box


vik_routing_ui_selector_get_nth ()

VikRoutingEngine *
vik_routing_ui_selector_get_nth (GtkWidget *combo,
                                 int pos);

Retrieve the VikRoutingEngine stored in a list attached to combo via the "engines" property.

Parameters

combo

the GtkWidget combobox

 

pos

the selected position

 

Returns

the VikRoutingEngine object associated to pos


vik_routing_default_engine ()

VikRoutingEngine *
vik_routing_default_engine (void);

Retrieve the default engine, based on user's preferences.

Returns

the default engine