X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fgis-tile.h;h=d21b771477076aaa51406d66d1f7c0f713f52ba1;hb=8f2f3918e1bc04ac40a9ba0a24452c1b1b0183ac;hp=12d397d66cc6d3697f71bf8e8b385d441a5ee663;hpb=2e575e2c348f44d3c723ac344b7296492c76f77a;p=grits diff --git a/src/gis-tile.h b/src/gis-tile.h index 12d397d..d21b771 100644 --- a/src/gis-tile.h +++ b/src/gis-tile.h @@ -18,7 +18,6 @@ #ifndef __GIS_TILE_H__ #define __GIS_TILE_H__ -#include #include typedef struct _GisTile GisTile; @@ -47,6 +46,9 @@ struct _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 */ @@ -59,6 +61,20 @@ GisTile *gis_tile_new(GisTile *parent, /* 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);