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

marble/src

MarbleModel Class Reference

#include <MarbleModel.h>

Inheritance diagram for MarbleModel:

Inheritance graph
[legend]

List of all members.


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 91 of file MarbleModel.h.


Signals

void creatingTilesStart (TileCreator *, const QString &name, const QString &description)
void themeChanged (QString mapTheme)
void modelChanged ()
void regionChanged (BoundingBox rect)
void timeout ()

Public Member Functions

 MarbleModel (QWidget *parent)
virtual ~MarbleModel ()
void paintGlobe (ClipPainter *painter, int width, int height, ViewParams *viewParams, bool redrawBackground, const QRect &dirtyRect)
QAbstractItemModel * placeMarkModel () const
QItemSelectionModel * placeMarkSelectionModel () const
QString mapTheme () const
MapTheme * mapThemeObject () const
void setMapTheme (const QString &selectedMap, QWidget *parent, Projection currentProjection)
int minimumZoom () const
int maximumZoom () const
HttpDownloadManager * downloadManager () const
void setDownloadManager (HttpDownloadManager *downloadManager)
void addPlaceMarkFile (const QString &filename)
QVector< QPersistentModelIndex > whichFeatureAt (const QPoint &) const
PlaceMarkLayout * placeMarkLayout () const
VectorComposer * vectorComposer () const
TextureColorizer * textureColorizer () const
AbstractScanlineTextureMapper * textureMapper () const
GpsLayer * gpsLayer () const
GpxFileModel * gpxFileModel () const
FileViewModel * fileViewModel () const
bool showGps () const
void setShowGps (bool visible)
void startPolling (int time=1000)
void stopPolling ()

Constructor & Destructor Documentation

MarbleModel::MarbleModel ( QWidget *  parent  ) 

Construct a new MarbleModel.

Parameters:
parent the parent widget

Definition at line 75 of file MarbleModel.cpp.

MarbleModel::~MarbleModel (  )  [virtual]

Definition at line 151 of file MarbleModel.cpp.


Member Function Documentation

void MarbleModel::paintGlobe ( ClipPainter *  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 339 of file MarbleModel.cpp.

QAbstractItemModel * MarbleModel::placeMarkModel (  )  const

Return the list of PlaceMarks as a QAbstractItemModel *.

Returns:
a list of all PlaceMarks in the MarbleModel.

Definition at line 473 of file MarbleModel.cpp.

QItemSelectionModel * MarbleModel::placeMarkSelectionModel (  )  const

Definition at line 478 of file MarbleModel.cpp.

QString MarbleModel::mapTheme (  )  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 = "bluemarble/bluemarble.dgml"

Definition at line 188 of file MarbleModel.cpp.

MapTheme * MarbleModel::mapThemeObject (  )  const

Definition at line 194 of file MarbleModel.cpp.

void MarbleModel::setMapTheme ( const QString &  selectedMap,
QWidget *  parent,
Projection  currentProjection 
)

Set a new map theme to use.

Parameters:
selectedMap the identifier of the selected map theme
parent the parent widget
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. This is what the parent parameter is used for.

NOTE: Both the parent and 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 = "bluemarble/bluemarble.dgml"

Definition at line 210 of file MarbleModel.cpp.

int MarbleModel::minimumZoom (  )  const

Return the minimum zoom for the current map theme.

Definition at line 300 of file MarbleModel.cpp.

int MarbleModel::maximumZoom (  )  const

Return the maximum zoom for the current map theme.

Definition at line 305 of file MarbleModel.cpp.

HttpDownloadManager * MarbleModel::downloadManager (  )  const

Return the downloadmanager to load missing tiles.

Returns:
the HttpDownloadManager instance.

Definition at line 310 of file MarbleModel.cpp.

void 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 316 of file MarbleModel.cpp.

void MarbleModel::addPlaceMarkFile ( const QString &  filename  ) 

Definition at line 518 of file MarbleModel.cpp.

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

Definition at line 525 of file MarbleModel.cpp.

PlaceMarkLayout * MarbleModel::placeMarkLayout (  )  const

Definition at line 498 of file MarbleModel.cpp.

VectorComposer * MarbleModel::vectorComposer (  )  const

Definition at line 483 of file MarbleModel.cpp.

TextureColorizer * MarbleModel::textureColorizer (  )  const

Definition at line 488 of file MarbleModel.cpp.

AbstractScanlineTextureMapper * MarbleModel::textureMapper (  )  const

Definition at line 493 of file MarbleModel.cpp.

GpsLayer * MarbleModel::gpsLayer (  )  const

Definition at line 503 of file MarbleModel.cpp.

GpxFileModel * MarbleModel::gpxFileModel (  )  const

Definition at line 508 of file MarbleModel.cpp.

FileViewModel * MarbleModel::fileViewModel (  )  const

Definition at line 513 of file MarbleModel.cpp.

bool MarbleModel::showGps (  )  const

Return whether the Gps Data is visible.

Returns:
The Gps Data visibility.

Definition at line 168 of file MarbleModel.cpp.

void MarbleModel::setShowGps ( bool  visible  ) 

Set whether the Gps Data is visible.

Parameters:
visible visibility of the Gps Data.

Definition at line 173 of file MarbleModel.cpp.

void 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 178 of file MarbleModel.cpp.

void MarbleModel::stopPolling (  ) 

stop the model from polling

Definition at line 183 of file MarbleModel.cpp.

void 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()

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

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

Parameters:
name the identifier of the new map theme.
See also:
mapTheme

setMapTheme

void MarbleModel::modelChanged (  )  [signal]

Signal that the MarbleModel has changed in general.

void MarbleModel::regionChanged ( BoundingBox  rect  )  [signal]

Signal that a region of the earth has changed.

Parameters:
rect the region that changed.
This is currently used only for gpx files, but will likely be used for more things in the future.

void 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.


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

marble/src

Skip menu "marble/src"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
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