diff options
Diffstat (limited to 'src/location/mapsgl/mapitem.h')
-rw-r--r-- | src/location/mapsgl/mapitem.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/location/mapsgl/mapitem.h b/src/location/mapsgl/mapitem.h index c9aa0da3..2c61bf07 100644 --- a/src/location/mapsgl/mapitem.h +++ b/src/location/mapsgl/mapitem.h @@ -46,6 +46,8 @@ #include <QSizeF> #include <QtOpenGL/qgl.h> +#include "intervaltree_p.h" + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -82,11 +84,19 @@ public: void setSceneNode(QGLSceneNode *sceneNode); QGLSceneNode* sceneNode() const; + void setBounds(const QRect &bounds); + QRect bounds() const; + + void setVisibleFromViewport(bool visible); + bool visibleFromViewport() const; + private: QGeoCoordinate coordinate_; QPointF anchor_; QSizeF size_; double zoom_; + QRect bounds_; + bool visible_; QGLSceneNode* sceneNode_; GLuint textureId_; bool textureDirty_; @@ -94,6 +104,28 @@ private: QGLMaterial* defaultMaterial_; }; +class Q_LOCATION_EXPORT MapItemTree +{ +public: + MapItemTree(); + ~MapItemTree(); + + void insert(MapItem *item); + void remove(MapItem *item); + + bool isEmpty() const; + int size() const; + + QList<MapItem*> items() const; + QList<MapItem*> itemsAt(const QPoint &point) const; + QList<MapItem*> itemsWithin(const QRect &viewport) const; + void makeVisible(const QRect& viewport, QList<MapItem*> &added, QList<MapItem*> &removed); +private: + + QRect viewport_; + AAInterval2DTree<MapItem*> *root_; +}; + QT_END_NAMESPACE QT_END_HEADER |