Stacked tile removal zValue check, doxygen generating class diagrams
authorSami Rämö <sami.ramo@ixonos.com>
Fri, 30 Apr 2010 08:19:39 +0000 (11:19 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Fri, 30 Apr 2010 08:19:39 +0000 (11:19 +0300)
 - 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
doc/doxygen/README.txt [deleted file]
src/map/mapengine.cpp
src/map/mapfetcher.h
src/map/mapscene.cpp
src/map/mapscene.h

index 2b3dcdd..1665bc2 100644 (file)
--- 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 (file)
index e69de29..0000000
index ca52db5..2f60556 100644 (file)
@@ -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);
    }
 }
index 1ecd1c2..af3818d 100644 (file)
@@ -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
index 5c0fb59..a6597bb 100644 (file)
@@ -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<QGraphicsItem *> viewTiles = items(m_viewRect, Qt::IntersectsItemBoundingRect);
     QList<QGraphicsItem *> 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<MapTile *>(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);
+            }
+
         }
     }
 }
index 3096c61..33380fc 100644 (file)
@@ -55,8 +55,6 @@ public:
     */
     void addTile(MapTile *mapTile, QString hashKey);
 
-    void debugItemsCount();
-
     /**
     * @brief Enqueue stacked tiles removal request
     *