/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
+ * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef __GIS_TILE_H__
#define __GIS_TILE_H__
-#include <config.h>
#include <glib.h>
typedef struct _GisTile GisTile;
/* Pointers to parent/child nodes */
GisTile *parent;
GisTile *children[2][2];
+
+ /* Last access time (for garbage collection) */
+ time_t atime;
};
/* Path to string table, keep in sync with tile->children */
/* Return a string representation of the tile's path */
gchar *gis_tile_get_path(GisTile *child);
+/* Update a root tile */
+/* Based on eye distance (lat,lon,elev) */
+void gis_tile_update(GisTile *root,
+ gdouble res, gint width, gint height,
+ gdouble lat, gdouble lon, gdouble elev,
+ GisTileLoadFunc load_func, gpointer user_data);
+
+/* Find the leaf tile containing lat-lon */
+GisTile *gis_tile_find(GisTile *root, gdouble lat, gdouble lon);
+
+/* Delete nodes that haven't been accessed since atime */
+GisTile *gis_tile_gc(GisTile *root, time_t atime,
+ GisTileFreeFunc free_func, gpointer user_data);
+
/* Free a tile and all it's children */
void gis_tile_free(GisTile *root,
GisTileFreeFunc free_func, gpointer user_data);