MapScene Class Reference

Map scene for storing MapTile items. More...

#include <mapscene.h>

List of all members.

Public Member Functions

 MapScene (QObject *parent=0)
 Constructor.
void addTile (MapTile *mapTile, QString hashKey)
 Add MapTile item to scene.
void enqueueRemoveStackedTiles (MapTile *newTile)
 Enqueue stacked tiles removal request.
bool isTileInScene (QString hashKey)
 Returns if tile mathcing hash key is already in the scene.
void removeOutOfViewTiles ()
 Remove tiles which are out of view bounds.
void removeStackedTiles (MapTile *newTile)
 Remove tiles which are stacked.
void removeTile (MapTile *tile)
 Remove tile.
void setTilesDrawingLevels (int zoomLevel)
 Set drawing order of all tiles in the scene.
void viewRectUpdated (QRect viewRect)
 Save new view rect.

Private Slots

void runNextStackedTilesRemoval ()
 Slot for running next queued removal of stacked tiles.

Private Attributes

bool m_isRemoveStackedTilesRunning
 Is singleshot timer already running.
QHash< QString, MapTile * > m_mapTilesInScene
 List of map tiles in map scene.
QList< MapTile * > m_removeStackedTilesList
 "Queue" for stacked tiles removal requests
QRect m_viewRect
 Current viewable area.

Detailed Description

Map scene for storing MapTile items.

Author:
Sami Rämö - sami.ramo (at) ixonos.com

Constructor & Destructor Documentation

MapScene::MapScene ( QObject *  parent = 0  ) 

Constructor.

Scene size is set to the amount of pixels on closest zoom level

Parameters:
parent Parent

Member Function Documentation

void MapScene::addTile ( MapTile mapTile,
QString  hashKey 
)

Add MapTile item to scene.

Parameters:
mapTile Map tile item to be added
hashKey Hash key for the tile
void MapScene::enqueueRemoveStackedTiles ( MapTile newTile  ) 

Enqueue stacked tiles removal request.

Removal is triggered after events have been processed so the UI stays more responsive

Parameters:
newTile New tile, which area under it is inspected
bool MapScene::isTileInScene ( QString  hashKey  ) 

Returns if tile mathcing hash key is already in the scene.

Parameters:
hashKey 
Returns:
True if tile was in the scene, otherwise false
void MapScene::removeStackedTiles ( MapTile newTile  ) 

Remove tiles which are stacked.

Iterate through tiles which are under this map tile and remove tiles which are fully obscured by this new tile. Tiles which are only partially obscured by this new tile are not checked, and thus deleted, because of the required complexity of the algorithm and processing power. Those tiles will be removed when they go out of the view area caused by scrolling or zooming in enough.

Parameters:
newTile new tile covering old tiles
void MapScene::removeTile ( MapTile tile  ) 

Remove tile.

Removes tile from scene and list of current tiles in scene.

Parameters:
tile MapTile to remove
void MapScene::setTilesDrawingLevels ( int  zoomLevel  ) 

Set drawing order of all tiles in the scene.

Check MapTile::setSceneLevel for more information.

Parameters:
zoomLevel Current zoom level
void MapScene::viewRectUpdated ( QRect  viewRect  ) 

Save new view rect.

View rect must be saved to local scope whenever it changes because it is used by removal algorithms and some of the algorithms are run delayed so the actual view rect may change before the cleanup algorithm is run.

Parameters:
viewRect New view rect

The documentation for this class was generated from the following files:

Generated on Thu Jun 10 09:44:04 2010 for Situare client for Maemo by  doxygen 1.6.1