path->points=0;
}
-gboolean
+static gboolean
path_resize(Path *path, guint size)
{
g_return_val_if_fail(path, FALSE);
return FALSE;
}
-gboolean
+static gboolean
path_wresize(Path *path, guint wsize)
{
g_return_val_if_fail(path, FALSE);
}
/**
+ * path_add_waypoint:
+ * @path
+ * @lat
+ * @lon
+ * @desc
+ *
* Append a waypoint to path at given lat, lon with description desc
+ *
+ * Returns: TRUE
*/
gboolean
path_add_waypoint(Path *path, gdouble lat, gdouble lon, gchar *desc)
}
/**
+ * path_add_point:
+ * @path
+ * @gps
+ *
* Append a path point to path
*
* Returns: TRUE if the new point was added. FALSE is returned if new point distance was under sensitivity setting.
return FALSE;
}
+/**
+ * path_add_break:
+ * @path
+ *
+ * Add a break point to the path.
+ *
+ * Returns: TRUE if break was added, FALSE if last point was a break already.
+ */
gboolean
path_add_break(Path *path)
{
g_return_val_if_fail(path->tail, FALSE);
if (path->tail->unity && path->tail->unitx) {
- guint x1, y1;
-
/* To mark a "break" in a track, we'll add a (0, 0) point and then
another instance of the most recent track point. */
return FALSE;
}
+/**
+ * path_has_points:
+ * @path
+ *
+ * Checks if given path has any path points
+ *
+ * Returns: TRUE if there are points, FALSE otherwise
+ */
gboolean
path_has_points(Path *path)
{
return path->head==path->tail ? FALSE : TRUE;
}
+/**
+ * path_has_waypoints:
+ *
+ * Checks if given path has any waypoints
+ *
+ * Returns: TRUE if there are waypoints, FALSE otherwise
+ */
gboolean
path_has_waypoints(Path *path)
{
return path->whead==path->wtail ? FALSE : TRUE;
}
+/**
+ * path_find_last_point:
+ * @path
+ *
+ * Returns: The last path point or NULL if path is empty
+ */
Point *
path_find_last_point(Path *path)
{
* the entire list (starting from near_point) is searched. Otherwise, we
* stop searching when we find a point that is farther away.
*/
-gboolean
+static gboolean
path_update_nears(Path *path, Point *point, gboolean quick)
{
gboolean ret = FALSE;
}
/**
+ * path_find_nearest_point:
+ *
* Reset the near_point data by searching the entire path for the nearest point and waypoint.
*/
void
}
+/**
+ * path_find_nearest_waypoint:
+ *
+ */
WayPoint *
path_find_nearest_waypoint(Path *path, guint unitx, guint unity)
{
}
if (wnear && wnear->point) {
- if (abs(unitx - wnear->point->unitx) < pixel2unit(3 * path->sensitivity) && abs(unity - wnear->point->unity) < pixel2unit(3 * path->sensitivity))
+ if (abs(unitx - wnear->point->unitx) < path->sensitivity && abs(unity - wnear->point->unity) < path->sensitivity)
return wnear;
}
}
/**
- * Check if we should announce upcoming waypoint.
+ * path_check_waypoint_announce:
+ * @path
+ * @gps
+ *
+ * Check if we should announce upcoming waypoint.
+ *
*/
-void
-path_check_waypoint_announce(Path *route, GpsData *gps)
+static void
+path_check_waypoint_announce(Path *path, GpsData *gps)
{
-guint a_thres_near, a_thre_at;
+guint a_thres_near, a_thres_at;
g_return_if_fail(path);
g_return_if_fail(gps);
if (path->next_way_dist_squared<(a_thres_near * a_thres_near) && path->next_way!=path->announced_waypoint) {
g_signal_emit(G_OBJECT(path), signals[NEAR_WAYPOINT], 0, NULL);
- announced_waypoint=route->next_way;
+ path->announced_waypoint=path->next_way;
} else if (path->next_way_dist_squared<(a_thres_at * a_thres_at) && path->next_way!=path->announced_waypoint) {
g_signal_emit(G_OBJECT(path), signals[REACHED_WAYPOINT], 0, NULL);
- announced_waypoint=route->next_way;
+ path->announced_waypoint=path->next_way;
+}
}
/******************************************************************************/
return TRUE;
}
+/**
+ * path_get_waypoint_latlon:
+ * @way
+ * @lat
+ * @lon
+ *
+ * Get the real latitude and longitude of given waypoint
+ *
+ * Returns: TRUE if waypoint was valid, FALSE otherwise.
+ */
gboolean
path_get_waypoint_latlon(WayPoint *way, gdouble *lat, gdouble *lon)
{
}
/**
- * Add a text description at current point
- *
+ * path_insert_mark_text:
+ * @path
+ * @text
+ *
+ * Add a new waypoint to path with given text.
+ *
*/
void
path_insert_mark_text(Path *path, gchar *text)
g_signal_emit(G_OBJECT(path), signals[NEW_WAYPOINT], 0, NULL);
}
+/**
+ * path_insert_mark_autonumber:
+ * @path
+ *
+ * Add autonumbered waypoint to given path
+ *
+ */
void
path_insert_mark_autonumber(Path *path)
{