Logo Search packages:      
Sourcecode: navit version File versions

static struct route_graph* route_graph_build ( struct mapset ms,
struct coord c1,
struct coord c2,
struct callback done_cb,
int  async 
) [static, read]

Builds a new route graph from a mapset.

This function builds a new route graph from a map. Please note that this function does not add any routing information to the route graph - this has to be done via the route_graph_flood() function.

The function does not create a graph covering the whole map, but only covering the rectangle between c1 and c2.

ms The mapset to build the route graph from
c1 Corner 1 of the rectangle to use from the map
c2 Corner 2 of the rectangle to use from the map
done_cb The callback which will be called when graph is complete
The new route graph.

Definition at line 2168 of file route.c.

References route_graph::busy, route_graph::done_cb, route_graph::h, route_graph::idle_cb, route_graph::idle_ev, mapset_open(), route_calc_selection(), and route_graph::sel.

Referenced by route_graph_update().

      struct route_graph *ret=g_new0(struct route_graph, 1);


      ret->sel=route_calc_selection(c1, c2);
      if (route_graph_build_next_map(ret)) {
            if (async) {
                  ret->idle_cb=callback_new_1(callback_cast(route_graph_build_idle), ret);
                  ret->idle_ev=event_add_idle(50, ret->idle_cb);
      } else
            route_graph_build_done(ret, 0);

      return ret;

Generated by  Doxygen 1.6.0   Back to index