From 60a8b689083ecf55eecf8893fa20b1df41805e49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Mon, 19 Apr 2010 15:27:57 +0300 Subject: [PATCH] Finalised review and removed review comments --- src/map/mapengine.cpp | 8 +------- src/map/mapfetcher.h | 4 ++-- src/map/maptile.cpp | 7 +++---- src/map/mapview.cpp | 2 +- tests/map/mapscene/testmapscene.pro | 8 ++++++-- tests/map/maptile/testmaptile.pro | 10 ++++++++-- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp index 2518944..f05a470 100644 --- a/src/map/mapengine.cpp +++ b/src/map/mapengine.cpp @@ -201,15 +201,12 @@ void MapEngine::removeTilesOutOfView() { //qDebug() << __PRETTY_FUNCTION__; - /// @todo Jussi: convertTi.... returns QPoint DONE QPoint topLeft = convertTileNumberToSceneCoordinate(m_zoomLevel, m_viewGrid.topLeft()); QPoint bottomRight = convertTileNumberToSceneCoordinate(m_zoomLevel, m_viewGrid.bottomRight() + QPoint(1, 1)); qreal width = bottomRight.x() - topLeft.x(); qreal height = bottomRight.y() - topLeft.y(); - /// @todo Jussi: insert comments DONE - // QList viewTiles = m_mapScene->items(topLeft.x(), topLeft.y(), width, height, Qt::ContainsItemBoundingRect); QList allTiles = m_mapScene->items(); @@ -229,8 +226,6 @@ void MapEngine::removeStackedTiles(MapTile *newTile) { //qDebug() << __PRETTY_FUNCTION__; - /// @todo Jussi: use sceneBoundingRect DONE -// QRectF newTileSceneRect = newTile->mapRectToScene(newTile->boundingRect()); QRectF newTileSceneRect = newTile->sceneBoundingRect(); QList collidingTiles = newTile->collidingItems(Qt::IntersectsItemBoundingRect); @@ -302,7 +297,6 @@ void MapEngine::zoomIn() // remove unused tiles after zooming is done QTimer::singleShot(ZOOM_TIME*2, this, SLOT(removeTilesOutOfView())); } - /// @todo DONE: Sami: return only to end } void MapEngine::zoomOut() @@ -317,7 +311,6 @@ void MapEngine::zoomOut() getTiles(m_sceneCoordinate); } - /// @todo DONE: Sami: return } void MapEngine::setTilesDrawingLevels() @@ -346,6 +339,7 @@ QString MapEngine::tilePath(int zoomLevel, int x, int y) void MapEngine::scalingFactorChanged(qreal scaleFactor) { qDebug() << __PRETTY_FUNCTION__; + Q_UNUSED(scaleFactor); } QPoint MapEngine::convertSceneCoordinateToTileNumber(int zoomLevel, QPoint sceneCoordinate) diff --git a/src/map/mapfetcher.h b/src/map/mapfetcher.h index 81571da..dbfef0d 100644 --- a/src/map/mapfetcher.h +++ b/src/map/mapfetcher.h @@ -112,8 +112,8 @@ signals: * DATA MEMBERS ******************************************************************************/ private: - static const int MAX_PARALLEL_DOWNLOADS = 2; - static const int DOWNLOAD_QUEUE_SIZE = 50; + static const int MAX_PARALLEL_DOWNLOADS = 2; ///< Max simultaneous parallel downloads + static const int DOWNLOAD_QUEUE_SIZE = 50; ///< Max downloads waiting in queue QList m_currentDownloads; ///< List of current downloads QQueue m_downloadQueue; ///< Queue of pending requests diff --git a/src/map/maptile.cpp b/src/map/maptile.cpp index cc68743..0bae905 100644 --- a/src/map/maptile.cpp +++ b/src/map/maptile.cpp @@ -51,7 +51,6 @@ void MapTile::setZoomLevel(int zoomLevel) void MapTile::setSceneLevel(int currentZoomLevel) { - /// @todo DONE Sami: bbb if (currentZoomLevel < m_zoomLevel) { qreal z = static_cast(MIN_MAP_SCENE_NORMAL_LEVEL + currentZoomLevel - (m_zoomLevel - currentZoomLevel)) + 0.5; @@ -81,11 +80,11 @@ void MapTile::setPosition() const int maxTileNumber = (1 << m_zoomLevel) - 1; if ((m_zoomLevel >= MIN_MAP_ZOOM_LEVEL) && (m_zoomLevel <= MAX_MAP_ZOOM_LEVEL) && - (m_tileNumber.x() >= 0) && (m_tileNumber.x() <= maxTileNumber) && - (m_tileNumber.y() >= 0) && (m_tileNumber.y() <= maxTileNumber)) { + (m_tileNumber.x() >= 0) && (m_tileNumber.x() <= maxTileNumber) && + (m_tileNumber.y() >= 0) && (m_tileNumber.y() <= maxTileNumber)) { + setPos(MapEngine::convertTileNumberToSceneCoordinate(m_zoomLevel, m_tileNumber)); //qDebug() << __PRETTY_FUNCTION__ << "tile position:" << pos(); - /// @todo DONE Sami: return } else { setPos(UNDEFINED, UNDEFINED); diff --git a/src/map/mapview.cpp b/src/map/mapview.cpp index 6ecc2b9..cf8c27c 100644 --- a/src/map/mapview.cpp +++ b/src/map/mapview.cpp @@ -51,7 +51,7 @@ void MapView::setZoomLevel(int zoomLevel) { m_zoomTargetScale = pow(2, zoomLevel - MAX_MAP_ZOOM_LEVEL); m_zoomScaleDelta = (m_zoomTargetScale - currentScale()) / (ZOOM_FPS * (ZOOM_TIME / 1000)); -/// @todo DONE Sami: starts new timer + if (m_timerID) killTimer(m_timerID); diff --git a/tests/map/mapscene/testmapscene.pro b/tests/map/mapscene/testmapscene.pro index 4c5bd24..0058538 100644 --- a/tests/map/mapscene/testmapscene.pro +++ b/tests/map/mapscene/testmapscene.pro @@ -12,6 +12,10 @@ INCLUDEPATH += . \ # Input SOURCES += testmapscene.cpp \ ../../../src/map/mapscene.cpp \ - ../../../src/map/maptile.cpp + ../../../src/map/maptile.cpp \ + ../../../src/map/mapengine.cpp \ + ../../../src/map/mapfetcher.cpp HEADERS += ../../../src/map/mapscene.h \ - ../../../src/map/maptile.h + ../../../src/map/maptile.h \ + ../../../src/map/mapengine.h \ + ../../../src/map/mapfetcher.h diff --git a/tests/map/maptile/testmaptile.pro b/tests/map/maptile/testmaptile.pro index 8526f70..5b54264 100644 --- a/tests/map/maptile/testmaptile.pro +++ b/tests/map/maptile/testmaptile.pro @@ -11,5 +11,11 @@ INCLUDEPATH += . \ # Input SOURCES += testmaptile.cpp \ - ../../../src/map/maptile.cpp -HEADERS += ../../../src/map/maptile.h + ../../../src/map/maptile.cpp \ + ../../../src/map/mapfetcher.cpp \ + ../../../src/map/mapengine.cpp \ + ../../../src/map/mapscene.cpp +HEADERS += ../../../src/map/maptile.h \ + ../../../src/map/mapfetcher.h \ + ../../../src/map/mapengine.h \ + ../../../src/map/mapscene.h -- 1.7.9.5