summaryrefslogtreecommitdiff
path: root/examples/map3d/tileview.h
blob: 517740872968b20c614c5fc1f839f71268525f80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TILEVIEW_H
#define TILEVIEW_H

#include <qglview.h>

#include "cameradata.h"
#include "map.h"

class QGLPainter;
class QGLSceneNode;
class TileCache;
class Tile;
class TileSpec;
class MapSphere;
class QGeoServiceProvider;
class ScriptEngine;

class TileView : public QGLView
{
    Q_OBJECT
public:
    explicit TileView(TileCache *tileCache, QWidget *parent = 0);
    ~TileView();

    Map *map();

    void paintGL(QGLPainter *painter);

protected:
    void showEvent(QShowEvent *);
    void resizeEvent(QResizeEvent *);
    void enterEvent(QEvent *);
    void leaveEvent(QEvent *e);
    void keyPressEvent(QKeyEvent *e);
    void closeEvent(QCloseEvent *);

    void wheelEvent(QWheelEvent *e);
    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);

private:
    void updateAspectRatio();

    QGeoServiceProvider *serviceProvider_;
    TileCache *tileCache_;
    Map *map_;
    QPoint mousePos_;
};

#endif // TILEVIEW_H