* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
+/**
+ * SECTION:path
+ * @short_description: A generic map path (track, route)
+ * @stability: unstable
+ *
+ * #Path is track or route object for displaying tracks or routes on GtkMaps.
+ *
+ */
+
#include <config.h>
#include <string.h>
{
guint unitx, unity;
-latlon2unit(lat, lon, unitx, unity);
+latlon2unit(lat, lon, &unitx, &unity);
MACRO_PATH_INCREMENT_TAIL(*path);
path->tail->unitx=unitx;
path->tail->unity=unity;
{
guint unitx, unity;
-latlon2unit(lat, lon, unitx, unity);
+latlon2unit(lat, lon, &unitx, &unity);
if (abs((gint)unitx-path->tail->unitx) > path->sensitivity || abs((gint)unity-path->tail->unity) > path->sensitivity) {
if (path->tail->unity && path->tail->unitx) {
gdouble plat, plon;
- unit2latlon(path->tail->unitx, path->tail->unity, lat, lon);
+ unit2latlon(path->tail->unitx, path->tail->unity, &plat, &plon);
path->length+=calculate_distance(plat, plon, lat, lon);
}
MACRO_PATH_INCREMENT_TAIL(*path);
path->next_wpt=NULL;
path->next_wpt_dist_squared=-1;
-latlon2unit(lat, lon, p.unitx, p.unity);
+latlon2unit(lat, lon, &p.unitx, &p.unity);
path_update_nears(path, &p, FALSE);
}
g_return_val_if_fail(path, NULL);
-latlon2unit(lat, lon, pos.unitx, pos.unity);
+latlon2unit(lat, lon, &pos.unitx, &pos.unity);
wcurr=wnear=path->whead;
if (wcurr && wcurr->point && wcurr!=path->wtail) {
/* Skip _near_point in case we have already passed it. */
for (curr = path->near_point + 1; curr <= point; ++curr) {
if (curr->unity) {
- unit2latlon(curr->unitx, curr->unity, lat2, lon2);
+ unit2latlon(curr->unitx, curr->unity, &lat2, &lon2);
sum += calculate_distance(lat1, lon1, lat2, lon2);
lat1 = lat2;
lon1 = lon2;
/* Skip near_point in case we have already passed it. */
for (curr = path->near_point - 1; curr >= point; --curr) {
if (curr->unity) {
- unit2latlon(curr->unitx, curr->unity, lat2, lon2);
+ unit2latlon(curr->unitx, curr->unity, &lat2, &lon2);
sum += calculate_distance(lat1, lon1, lat2, lon2);
lat1 = lat2;
lon1 = lon2;
}
} else {
/* Waypoint _is_ the nearest point. */
- unit2latlon(path->near_point->unitx, path->near_point->unity, lat2, lon2);
+ unit2latlon(path->near_point->unitx, path->near_point->unity, &lat2, &lon2);
sum += calculate_distance(lat1, lon1, lat2, lon2);
}
return sum;
g_return_val_if_fail(lat, FALSE);
g_return_val_if_fail(lon, FALSE);
-unit2latlon(way->point->unitx, way->point->unity, tlat, tlon);
+unit2latlon(way->point->unitx, way->point->unity, &tlat, &tlon);
*lat=tlat;
*lon=tlon;
gchar tmp1[16], tmp2[16];
gdouble lat2, lon2;
-unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat2, lon2);
+unit2latlon(wcurr->point->unitx, wcurr->point->unity, &lat2, &lon2);
lat_format(_degformat, lat2, tmp1);
lon_format(_degformat, lon2, tmp2);
store=gtk_list_store_new(PATH_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
-unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat1, lon1);
+unit2latlon(wcurr->point->unitx, wcurr->point->unity, &lat1, &lon1);
while (wcurr!=path->wtail) {
if (!wcurr)
continue;
}
- unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat2, lon2);
+ unit2latlon(wcurr->point->unitx, wcurr->point->unity, &lat2, &lon2);
lat_format(degformat, lat2, tmp1);
lon_format(degformat, lon2, tmp2);