00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Sami Rämö - sami.ramo@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef MAPSCENE_H 00023 #define MAPSCENE_H 00024 00025 #include <QGraphicsScene> 00026 00027 #include "maptile.h" 00028 00034 class MapScene : public QGraphicsScene 00035 { 00036 Q_OBJECT 00037 public: 00044 MapScene(QObject *parent = 0); 00045 00046 /******************************************************************************* 00047 * MEMBER FUNCTIONS AND SLOTS 00048 ******************************************************************************/ 00049 public: 00056 void addTile(MapTile *mapTile, QString hashKey); 00057 00065 void enqueueRemoveStackedTiles(MapTile *newTile); 00066 00073 bool isTileInScene(QString hashKey); 00074 00079 void removeOutOfViewTiles(); 00080 00093 void removeStackedTiles(MapTile *newTile); 00094 00101 void removeTile(MapTile *tile); 00102 00109 void setTilesDrawingLevels(int zoomLevel); 00110 00121 void viewRectUpdated(QRect viewRect); 00122 00123 private slots: 00128 void runNextStackedTilesRemoval(); 00129 00130 /******************************************************************************* 00131 * DATA MEMBERS 00132 ******************************************************************************/ 00133 private: 00134 bool m_isRemoveStackedTilesRunning; 00135 QHash<QString, MapTile *> m_mapTilesInScene; 00136 QList<MapTile *> m_removeStackedTilesList; 00137 QRect m_viewRect; 00138 }; 00139 00140 #endif // MAPSCENE_H