]> Pileus Git - grits/blobdiff - src/gis-tile.h
Add Blue Marble Next Gen plugin and tile rendering code
[grits] / src / gis-tile.h
index 12d397d66cc6d3697f71bf8e8b385d441a5ee663..cda4442be6de3450be53b4da2ec638f41e4c6650 100644 (file)
@@ -47,6 +47,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 +62,17 @@ 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);
+
+/* 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);