#include "roam.h"
#include "objects/gis-object.h"
+#include "objects/gis-tile.h"
#include "objects/gis-marker.h"
#include "objects/gis-callback.h"
px, py, pz);
}
-static void gis_opengl_set_height_func(GisViewer *_opengl, GisTile *tile,
+static void gis_opengl_set_height_func(GisViewer *_opengl, GisBounds *bounds,
RoamHeightFunc height_func, gpointer user_data, gboolean update)
{
GisOpenGL *opengl = GIS_OPENGL(_opengl);
- if (!tile)
- return;
/* TODO: get points? */
g_mutex_lock(opengl->sphere_lock);
GList *triangles = roam_sphere_get_intersect(opengl->sphere, TRUE,
- tile->edge.n, tile->edge.s, tile->edge.e, tile->edge.w);
+ bounds->n, bounds->s, bounds->e, bounds->w);
for (GList *cur = triangles; cur; cur = cur->next) {
RoamTriangle *tri = cur->data;
RoamPoint *points[] = {tri->p.l, tri->p.m, tri->p.r, tri->split};
for (int i = 0; i < G_N_ELEMENTS(points); i++) {
- if (tile->edge.n >= points[i]->lat && points[i]->lat >= tile->edge.s &&
- tile->edge.e >= points[i]->lon && points[i]->lon >= tile->edge.w) {
+ if (bounds->n >= points[i]->lat && points[i]->lat >= bounds->s &&
+ bounds->e >= points[i]->lon && points[i]->lon >= bounds->w) {
points[i]->height_func = height_func;
points[i]->height_data = user_data;
roam_point_update_height(points[i]);
/* Configurable stuff */
gis_viewer_set_offline(viewer, TRUE);
- //load_plugin(plugins, "elev", viewer, prefs, GTK_NOTEBOOK(config));
- //load_plugin(plugins, "env", viewer, prefs, GTK_NOTEBOOK(config));
+ load_plugin(plugins, "elev", viewer, prefs, GTK_NOTEBOOK(config));
+ load_plugin(plugins, "env", viewer, prefs, GTK_NOTEBOOK(config));
//load_plugin(plugins, "map", viewer, prefs, GTK_NOTEBOOK(config));
load_plugin(plugins, "sat", viewer, prefs, GTK_NOTEBOOK(config));
load_plugin(plugins, "test", viewer, prefs, GTK_NOTEBOOK(config));
/**
* gis_viewer_set_height_func:
* @viewer: the viewer
- * @tile: the area to set the height function for
+ * @bounds: the area to set the height function for
* @height_func: the height function
* @user_data: user data to pass to the height function
- * @update: %TRUE if the heights inside the tile should be updated.
+ * @update: %TRUE if the heights inside the bounds should be updated.
*
* Set the height function to be used for a given part of the surface..
*/
-void gis_viewer_set_height_func(GisViewer *viewer, GisTile *tile,
+void gis_viewer_set_height_func(GisViewer *viewer, GisBounds *bounds,
GisHeightFunc height_func, gpointer user_data,
gboolean update)
{
GisViewerClass *klass = GIS_VIEWER_GET_CLASS(viewer);
if (!klass->set_height_func)
g_warning("GisViewer: set_height_func - Unimplemented");
- klass->set_height_func(viewer, tile, height_func, user_data, update);
+ klass->set_height_func(viewer, bounds, height_func, user_data, update);
}
/**
#include "gis-plugin.h"
#include "gis-prefs.h"
#include "objects/gis-object.h"
-#include "objects/gis-tile.h"
struct _GisViewer {
GtkDrawingArea parent_instance;
gdouble *px, gdouble *py, gdouble *pz);
void (*clear_height_func)(GisViewer *viewer);
- void (*set_height_func) (GisViewer *viewer, GisTile *tile,
+ void (*set_height_func) (GisViewer *viewer, GisBounds *bounds,
GisHeightFunc height_func, gpointer user_data,
gboolean update);
gdouble *px, gdouble *py, gdouble *pz);
void gis_viewer_clear_height_func(GisViewer *viewer);
-void gis_viewer_set_height_func(GisViewer *viewer, GisTile *tile,
+void gis_viewer_set_height_func(GisViewer *viewer, GisBounds *bounds,
GisHeightFunc height_func, gpointer user_data,
gboolean update);
/* Do necessasairy processing */
/* TODO: Lock this and move to thread, can remove elev from _load then */
if (LOAD_BIL)
- gis_viewer_set_height_func(elev->viewer, tile, _height_func, elev, TRUE);
+ gis_viewer_set_height_func(elev->viewer, &tile->edge, _height_func, elev, TRUE);
/* Cleanup unneeded things */
if (!LOAD_BIL)