summaryrefslogtreecommitdiff
path: root/src/imports/location/tilesphere.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location/tilesphere.h')
-rw-r--r--src/imports/location/tilesphere.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/imports/location/tilesphere.h b/src/imports/location/tilesphere.h
new file mode 100644
index 00000000..e3a7647a
--- /dev/null
+++ b/src/imports/location/tilesphere.h
@@ -0,0 +1,58 @@
+#ifndef TILESPHERE_H
+#define TILESPHERE_H
+
+#include <QObject>
+
+class QGLSceneNode;
+class QGeometryData;
+
+class Tile;
+class TileCache;
+
+class TileSphere : public QObject
+{
+ Q_OBJECT
+public:
+ TileSphere(QObject *parent, TileCache *tileCache, int zoom = 4, double radius = 1.0);
+
+ void setZoom(int zoom);
+ int zoom() const;
+
+ void setRadius(double radius);
+ double radius() const;
+
+ void limitView(int x1, int y1, int x2, int y2);
+ void clearLimit();
+
+ QGLSceneNode* sphereSceneNode() const;
+
+public slots:
+ void update();
+
+private slots:
+ void prefetchingFinished();
+
+signals:
+ void sphereUpdated();
+
+private:
+ QGeometryData tileSpecToSphereQuad(int x, int y) const;
+ QGLSceneNode* tileToSceneNode(const Tile &tile) const;
+
+ void prefetchSphere() const;
+ void buildSphere() const;
+
+ TileCache *tileCache_;
+ int zoom_;
+ double radius_;
+
+ bool viewLimited_;
+ int viewX1_;
+ int viewY1_;
+ int viewX2_;
+ int viewY2_;
+
+ QGLSceneNode* sphereNode_;
+};
+
+#endif // TILESPHERE_H