• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

marble

Marble::MarbleModel

Marble::MarbleModel Class Reference

The data model (not based on QAbstractModel) for a MarbleWidget. More...

#include <MarbleModel.h>

Inheritance diagram for Marble::MarbleModel:
Inheritance graph
[legend]

List of all members.

Public Slots

void clearPersistentTileCache ()
void clearVolatileTileCache ()
void paintTile (TextureTile *tile, int x, int y, int level, Marble::GeoSceneTexture *textureLayer, bool requestTileUpdate)
void setVolatileTileCacheLimit (quint64 kiloBytes)
void update ()

Signals

void creatingTilesStart (TileCreator *, const QString &name, const QString &description)
void downloadTile (const QUrl &sourceUrl, const QString &destinationFileName, const QString &id) const
void modelChanged ()
void pluginSettingsChanged ()
void repaintNeeded (QRegion dirtyRegion=QRegion())
void themeChanged (QString mapTheme)
void timeout ()

Public Member Functions

 MarbleModel (QObject *parent)
virtual ~MarbleModel ()
void addPlacemarkData (const QString &data, const QString &key="data")
void addPlacemarkFile (const QString &filename)
QList< AbstractDataPlugin * > dataPlugins () const
ExtDateTime * dateTime () const
HttpDownloadManager * downloadManager () const
FileViewModel * fileViewModel () const
QList< AbstractFloatItem * > floatItems () const
GpsLayer * gpsLayer () const
GpxFileModel * gpxFileModel () const
MergedLayerDecorator * layerDecorator () const
Marble::GeoSceneDocument * mapTheme () const
QString mapThemeId () const
void openGpxFile (const QString &filename)
void paintGlobe (GeoPainter *painter, int width, int height, ViewParams *viewParams, bool redrawBackground, const QRect &dirtyRect)
PlacemarkLayout * placemarkLayout () const
QAbstractItemModel * placemarkModel () const
QItemSelectionModel * placemarkSelectionModel () const
Planet * planet () const
QString planetName () const
qreal planetRadius () const
void reloadMap () const
void removePlacemarkKey (const QString &key)
QList< RenderPlugin * > renderPlugins () const
void setDownloadManager (HttpDownloadManager *downloadManager)
void setMapTheme (Marble::GeoSceneDocument *mapTheme, Projection currentProjection)
void setShowGps (bool visible)
void setupTextureMapper (Projection projection)
void setupVectorComposer ()
bool showGps () const
void startPolling (int time=1000)
void stopPolling ()
SunLocator * sunLocator () const
TextureColorizer * textureColorizer () const
AbstractScanlineTextureMapper * textureMapper () const
int tileZoomLevel () const
VectorComposer * vectorComposer () const
quint64 volatileTileCacheLimit () const
QVector< QModelIndex > whichFeatureAt (const QPoint &) const
QList< AbstractDataPluginItem * > whichItemAt (const QPoint &curpos) const

Detailed Description

The data model (not based on QAbstractModel) for a MarbleWidget.

This class provides a data storage and indexer that can be displayed in a MarbleWidget. It contains 3 different datatypes: tiles which provide the background, vectors which provide things like country borders and coastlines and placemarks which can show points of interest, such as cities, mountain tops or the poles.

The tiles provide the background of the image and can be for instance height and depth fields, magnetic strength, topographic data or anything else that is area based.

The vectors provide things like country borders and coastlines. They are stored in separate files and can be added or removed at anytime.

The placemarks contain points of interest, such as cities, mountain tops or the poles. These are sorted by size (for cities) and category (capitals, other important cities, less important cities, etc) and are displayed with different color or shape like square or round.

See also:
MarbleWidget

Definition at line 101 of file MarbleModel.h.


Constructor & Destructor Documentation

Marble::MarbleModel::MarbleModel ( QObject *  parent  )  [explicit]

Construct a new MarbleModel.

Parameters:
parent the parent widget

Definition at line 147 of file MarbleModel.cpp.

Marble::MarbleModel::~MarbleModel (  )  [virtual]

Definition at line 227 of file MarbleModel.cpp.


Member Function Documentation

void Marble::MarbleModel::addPlacemarkData ( const QString &  data,
const QString &  key = "data" 
)

Definition at line 722 of file MarbleModel.cpp.

void Marble::MarbleModel::addPlacemarkFile ( const QString &  filename  ) 

Definition at line 715 of file MarbleModel.cpp.

void Marble::MarbleModel::clearPersistentTileCache (  )  [slot]

Definition at line 795 of file MarbleModel.cpp.

void Marble::MarbleModel::clearVolatileTileCache (  )  [slot]

Definition at line 779 of file MarbleModel.cpp.

void Marble::MarbleModel::creatingTilesStart ( TileCreator *  ,
const QString &  name,
const QString &  description 
) [signal]

Signal that the MarbleModel has started to create a new set of tiles.

Parameters:
@see zoomView()
QList< AbstractDataPlugin * > Marble::MarbleModel::dataPlugins (  )  const

Returns a list of all DataPlugins on the layer.

Returns:
the list of DataPlugins

Definition at line 866 of file MarbleModel.cpp.

ExtDateTime * Marble::MarbleModel::dateTime (  )  const

Definition at line 762 of file MarbleModel.cpp.

HttpDownloadManager * Marble::MarbleModel::downloadManager (  )  const

Return the downloadmanager to load missing tiles.

Returns:
the HttpDownloadManager instance.

Definition at line 521 of file MarbleModel.cpp.

void Marble::MarbleModel::downloadTile ( const QUrl &  sourceUrl,
const QString &  destinationFileName,
const QString &  id 
) const [signal]
FileViewModel * Marble::MarbleModel::fileViewModel (  )  const

Definition at line 703 of file MarbleModel.cpp.

QList< AbstractFloatItem * > Marble::MarbleModel::floatItems (  )  const

Returns a list of all FloatItems in the model.

Returns:
the list of the floatItems

Definition at line 861 of file MarbleModel.cpp.

GpsLayer * Marble::MarbleModel::gpsLayer (  )  const

Definition at line 693 of file MarbleModel.cpp.

GpxFileModel * Marble::MarbleModel::gpxFileModel (  )  const

Definition at line 698 of file MarbleModel.cpp.

MergedLayerDecorator * Marble::MarbleModel::layerDecorator (  )  const

Definition at line 774 of file MarbleModel.cpp.

GeoSceneDocument * Marble::MarbleModel::mapTheme (  )  const

Definition at line 286 of file MarbleModel.cpp.

QString Marble::MarbleModel::mapThemeId (  )  const

Return the name of the current map theme.

Returns:
the identifier of the current MapTheme. To ensure that a unique identifier is being used the theme does NOT get represented by its name but the by relative location of the file that specifies the theme:

Example: maptheme = "earth/bluemarble/bluemarble.dgml"

Definition at line 276 of file MarbleModel.cpp.

void Marble::MarbleModel::modelChanged (  )  [signal]

Signal that the MarbleModel has changed in general.

void Marble::MarbleModel::openGpxFile ( const QString &  filename  ) 

Definition at line 708 of file MarbleModel.cpp.

void Marble::MarbleModel::paintGlobe ( GeoPainter *  painter,
int  width,
int  height,
ViewParams *  viewParams,
bool  redrawBackground,
const QRect &  dirtyRect 
)

Paint the model into the view.

Parameters:
painter the QPainter used to paint the view
width the width of the widget
height the height of the widget
viewParams the view parameters controlling the paint process
redrawBackground a boolean controlling if the background should be redrawn in addition to the globe itself
dirtyRect the rectangle of the widget that needs redrawing.

The model has the responsibility to actually paint into the MarbleWidget. This function is called by MarbleWidget when it receives a paintEvent and should repaint whole or part of the widget's contents based on the parameters.

NOTE: This function will probably move to MarbleWidget in KDE 4.1, making the MarbleModel/MarbleWidget pair truly follow the Model/View paradigm.

Definition at line 549 of file MarbleModel.cpp.

void Marble::MarbleModel::paintTile ( TextureTile *  tile,
int  x,
int  y,
int  level,
Marble::GeoSceneTexture *  textureLayer,
bool  requestTileUpdate 
) [slot]

Definition at line 838 of file MarbleModel.cpp.

PlacemarkLayout * Marble::MarbleModel::placemarkLayout (  )  const

Definition at line 688 of file MarbleModel.cpp.

QAbstractItemModel * Marble::MarbleModel::placemarkModel (  )  const

Return the list of Placemarks as a QAbstractItemModel *.

Returns:
a list of all Placemarks in the MarbleModel.

Definition at line 663 of file MarbleModel.cpp.

QItemSelectionModel * Marble::MarbleModel::placemarkSelectionModel (  )  const

Definition at line 668 of file MarbleModel.cpp.

Planet * Marble::MarbleModel::planet (  )  const

Returns the planet object for the current map.

Returns:
the planet object for the current map

Definition at line 876 of file MarbleModel.cpp.

QString Marble::MarbleModel::planetName (  )  const

Definition at line 757 of file MarbleModel.cpp.

qreal Marble::MarbleModel::planetRadius (  )  const

Definition at line 752 of file MarbleModel.cpp.

void Marble::MarbleModel::pluginSettingsChanged (  )  [signal]

This signal is emit when the settings of a plugin changed.

void Marble::MarbleModel::reloadMap (  )  const

Definition at line 889 of file MarbleModel.cpp.

void Marble::MarbleModel::removePlacemarkKey ( const QString &  key  ) 

Definition at line 729 of file MarbleModel.cpp.

QList< RenderPlugin * > Marble::MarbleModel::renderPlugins (  )  const

Returns a list of all RenderPlugins in the model, this includes float items.

Returns:
the list of RenderPlugins

Definition at line 856 of file MarbleModel.cpp.

void Marble::MarbleModel::repaintNeeded ( QRegion  dirtyRegion = QRegion()  )  [signal]

This signal is emitted when the repaint of the view was requested.

If available with the dirtyRegion which is the region the view will change in. If dirtyRegion.isEmpty() returns true, the whole viewport has to be repainted.

void Marble::MarbleModel::setDownloadManager ( HttpDownloadManager *  downloadManager  ) 

Set the downloadmanager to load missing tiles.

Parameters:
downloadManager the HttpDownloadManager instance

This function sets the downloadmanager to load tiles that are missing locally. The desctruction of the instance will be handled by MarbleModel.

Definition at line 527 of file MarbleModel.cpp.

void Marble::MarbleModel::setMapTheme ( Marble::GeoSceneDocument *  mapTheme,
Projection  currentProjection 
)

Set a new map theme to use.

Parameters:
selectedMap the identifier of the selected map theme
currentProjection the current projection

This function sets the map theme, i.e. combination of tile set and color scheme to use. If the map theme is not previously used, some basic tiles are created and a progress dialog is shown.

NOTE: The currentProjection parameters will disappear soon.

The ID of the new maptheme. To ensure that a unique identifier is being used the theme does NOT get represented by its name but the by relative location of the file that specifies the theme:

Example: maptheme = "earth/bluemarble/bluemarble.dgml"

Definition at line 300 of file MarbleModel.cpp.

void Marble::MarbleModel::setShowGps ( bool  visible  ) 

Set whether the Gps Data is visible.

Parameters:
visible visibility of the Gps Data.

Definition at line 261 of file MarbleModel.cpp.

void Marble::MarbleModel::setupTextureMapper ( Projection  projection  ) 

Set the Projection used for the map.

Parameters:
projection projection type (e.g. Spherical, Equirectangular, Mercator)

Definition at line 486 of file MarbleModel.cpp.

void Marble::MarbleModel::setupVectorComposer (  ) 

Setup the Vector Composer.

Definition at line 508 of file MarbleModel.cpp.

void Marble::MarbleModel::setVolatileTileCacheLimit ( quint64  kiloBytes  )  [slot]

Set the limit of the volatile (in RAM) tile cache.

Parameters:
kilobytes The limit in kilobytes.

Definition at line 790 of file MarbleModel.cpp.

bool Marble::MarbleModel::showGps (  )  const

Return whether the Gps Data is visible.

Returns:
The Gps Data visibility.

Definition at line 256 of file MarbleModel.cpp.

void Marble::MarbleModel::startPolling ( int  time = 1000  ) 

Start the model's timer polling.

Parameters:
time the amount of milliseconds between each poll

This is default behaviour so does not need to be started unless it was previously stopped

Definition at line 266 of file MarbleModel.cpp.

void Marble::MarbleModel::stopPolling (  ) 

stop the model from polling

Definition at line 271 of file MarbleModel.cpp.

SunLocator * Marble::MarbleModel::sunLocator (  )  const

Definition at line 769 of file MarbleModel.cpp.

TextureColorizer * Marble::MarbleModel::textureColorizer (  )  const

Returns the map's TextureColorizer.

Warning:
The TextureColorizer pointer may be null since it is only initialized if the map theme requires it. Check for this possibility.
Returns:
A pointer to the TextureColorizer

Definition at line 678 of file MarbleModel.cpp.

AbstractScanlineTextureMapper * Marble::MarbleModel::textureMapper (  )  const

Definition at line 683 of file MarbleModel.cpp.

void Marble::MarbleModel::themeChanged ( QString  mapTheme  )  [signal]

Signal that the map theme has changed, and to which theme.

Parameters:
mapTheme the identifier of the new map theme.
See also:
mapTheme
setMapTheme
int Marble::MarbleModel::tileZoomLevel (  )  const

Return the current tile zoom level.

For example for OpenStreetMap possible values are 1..18, for BlueMarble 0..6.

Definition at line 881 of file MarbleModel.cpp.

void Marble::MarbleModel::timeout (  )  [signal]

Signal that a timer has gone off.

This is currently used only for GPS things right now, but will likely be used for more things in the future.

void Marble::MarbleModel::update (  )  [slot]

Update the model.

Definition at line 746 of file MarbleModel.cpp.

VectorComposer * Marble::MarbleModel::vectorComposer (  )  const

Definition at line 673 of file MarbleModel.cpp.

quint64 Marble::MarbleModel::volatileTileCacheLimit (  )  const

Returns the limit of the volatile (in RAM) tile cache.

Returns:
the cache limit in kilobytes

Definition at line 785 of file MarbleModel.cpp.

QVector< QModelIndex > Marble::MarbleModel::whichFeatureAt ( const QPoint &  curpos  )  const

Definition at line 736 of file MarbleModel.cpp.

QList< AbstractDataPluginItem * > Marble::MarbleModel::whichItemAt ( const QPoint &  curpos  )  const

Returns all widgets of dataPlugins on the position curpos.

Definition at line 871 of file MarbleModel.cpp.


The documentation for this class was generated from the following files:
  • MarbleModel.h
  • MarbleModel.cpp

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal