From 0fe377f3dada419c54a4260aa4c9d508482029c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Fri, 30 Apr 2010 11:19:39 +0300 Subject: [PATCH] Stacked tile removal zValue check, doxygen generating class diagrams - Doxyfile modifications, enabled drawing UML class diagrams by using Graphviz - some cleanup - check that new tile is above tile to be removed when removing stacked tiles --- Doxyfile | 10 +++++----- src/map/mapengine.cpp | 2 -- src/map/mapfetcher.h | 8 +++++++- src/map/mapscene.cpp | 33 ++++++++++----------------------- src/map/mapscene.h | 2 -- 5 files changed, 22 insertions(+), 33 deletions(-) delete mode 100644 doc/doxygen/README.txt diff --git a/Doxyfile b/Doxyfile index 2b3dcdd..1665bc2 100644 --- a/Doxyfile +++ b/Doxyfile @@ -739,7 +739,7 @@ VERBATIM_HEADERS = YES # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. -ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns @@ -948,12 +948,12 @@ ENUM_VALUES_PER_LINE = 4 # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. -USE_INLINE_TREES = NO +USE_INLINE_TREES = YES # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree @@ -1352,7 +1352,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This @@ -1400,7 +1400,7 @@ GROUP_GRAPHS = YES # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. -UML_LOOK = NO +UML_LOOK = YES # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. diff --git a/doc/doxygen/README.txt b/doc/doxygen/README.txt deleted file mode 100644 index e69de29..0000000 diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp index ca52db5..2f60556 100644 --- a/src/map/mapengine.cpp +++ b/src/map/mapengine.cpp @@ -110,8 +110,6 @@ void MapEngine::mapImageReceived(const QUrl &url, const QPixmap &pixmap) m_mapScene->addTile(mapTile, hashKey); - m_mapScene->debugItemsCount(); - m_mapScene->enqueueRemoveStackedTiles(mapTile); } } diff --git a/src/map/mapfetcher.h b/src/map/mapfetcher.h index 1ecd1c2..af3818d 100644 --- a/src/map/mapfetcher.h +++ b/src/map/mapfetcher.h @@ -33,15 +33,21 @@ class QUrl; * @brief MapFetcher handles requests to get map tiles. * * @author Jussi Laitinen jussi.laitinen@ixonos.com +* @author Sami Rämö sami.ramo@ixonos.com */ class MapFetcher : public QObject { Q_OBJECT /** - * @brief Struct for download requests + * @brief Type for download requests * * @typedef Request + */ + /** + * @brief Struct for download requests + * + * @struct _Request */ typedef struct _Request { bool cacheChecked; ///< Is this request already checked from the cache diff --git a/src/map/mapscene.cpp b/src/map/mapscene.cpp index 5c0fb59..a6597bb 100644 --- a/src/map/mapscene.cpp +++ b/src/map/mapscene.cpp @@ -41,13 +41,6 @@ void MapScene::addTile(MapTile *mapTile, QString hashKey) addItem(mapTile); } -void MapScene::debugItemsCount() -{ -#ifndef Q_WS_MAEMO_5 - qDebug() << __PRETTY_FUNCTION__ << "ITEM ADDED:" << items().count(); -#endif // Q_WS_MAEMO_5 -} - void MapScene::enqueueRemoveStackedTiles(MapTile *newTile) { qDebug() << __PRETTY_FUNCTION__; @@ -79,9 +72,8 @@ void MapScene::runNextStackedTilesRemoval() } else { m_isRemoveStackedTilesRunning = false; -#ifndef Q_WS_MAEMO_5 - qDebug() << __PRETTY_FUNCTION__ << "STACKED END:" << items().count(); -#endif // Q_WS_MAEMO_5 + qDebug() << __PRETTY_FUNCTION__ << "Stacked tiles removal queue processing finished," + << "items count:" << items().count(); } } @@ -92,11 +84,6 @@ void MapScene::removeOutOfViewTiles() QList viewTiles = items(m_viewRect, Qt::IntersectsItemBoundingRect); QList allTiles = items(); -#ifndef Q_WS_MAEMO_5 - qDebug() << __PRETTY_FUNCTION__ << "OUT OF VIEW START:" << items().count(); -#endif // Q_WS_MAEMO_5 - - qDebug() << __PRETTY_FUNCTION__ << "All tiles:" << allTiles.count(); qDebug() << __PRETTY_FUNCTION__ << "Tiles in view area:" << viewTiles.count(); @@ -112,10 +99,7 @@ void MapScene::removeOutOfViewTiles() removeTile(tileToRemove); } -#ifndef Q_WS_MAEMO_5 - qDebug() << __PRETTY_FUNCTION__ << "OUT OF VIEW END:" << items().count(); -#endif // Q_WS_MAEMO_5 - + qDebug() << __PRETTY_FUNCTION__ << "finished, items count:" << items().count(); } void MapScene::removeStackedTiles(MapTile *newTile) @@ -129,10 +113,13 @@ void MapScene::removeStackedTiles(MapTile *newTile) foreach (QGraphicsItem *collidingItem, collidingItems) { MapTile *collidingTile = dynamic_cast(collidingItem); if (collidingTile) { - // remove tile if it is fully obscured by new tile - QRectF collidingTileSceneRect = collidingTile->sceneBoundingRect(); - if (newTileSceneRect.contains(collidingTileSceneRect)) - removeTile(collidingTile); + if (newTile->zValue() > collidingTile->zValue()) { + // remove tile if it is fully obscured by new tile + QRectF collidingTileSceneRect = collidingTile->sceneBoundingRect(); + if (newTileSceneRect.contains(collidingTileSceneRect)) + removeTile(collidingTile); + } + } } } diff --git a/src/map/mapscene.h b/src/map/mapscene.h index 3096c61..33380fc 100644 --- a/src/map/mapscene.h +++ b/src/map/mapscene.h @@ -55,8 +55,6 @@ public: */ void addTile(MapTile *mapTile, QString hashKey); - void debugItemsCount(); - /** * @brief Enqueue stacked tiles removal request * -- 1.7.9.5