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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
MergedLayerDecorator.cpp
Go to the documentation of this file.
1 // Copyright 2008 David Roberts <dvdr18@gmail.com>
2 // Copyright 2009 Jens-Michael Hoffmann <jensmh@gmx.de>
3 // Copyright 2011 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 
19 #include "MergedLayerDecorator.h"
20 
21 #include "blendings/Blending.h"
22 #include "blendings/BlendingFactory.h"
23 #include "SunLocator.h"
24 #include "MarbleGlobal.h"
25 #include "MarbleMath.h"
26 #include "MarbleDebug.h"
27 #include "GeoSceneTypes.h"
28 #include "GeoSceneDocument.h"
29 #include "GeoSceneHead.h"
30 #include "GeoSceneMap.h"
31 #include "GeoSceneTextureTile.h"
32 #include "GeoSceneVectorTile.h"
33 #include "ImageF.h"
34 #include "MapThemeManager.h"
35 #include "StackedTile.h"
36 #include "TileLoaderHelper.h"
37 #include "Planet.h"
38 #include "TextureTile.h"
39 #include "TileCreator.h"
40 #include "TileCreatorDialog.h"
41 #include "TileLoader.h"
42 
43 #include "GeoDataCoordinates.h"
44 
45 #include <QMutexLocker>
46 #include <QPointer>
47 #include <QPainter>
48 
49 using namespace Marble;
50 
51 class MergedLayerDecorator::Private
52 {
53 public:
54  Private( TileLoader *tileLoader, const SunLocator *sunLocator );
55 
56  static int maxDivisor( int maximum, int fullLength );
57 
58  StackedTile *createTile( const QVector<QSharedPointer<TextureTile> > &tiles ) const;
59 
60  void renderGroundOverlays( QImage *tileImage, const QVector<QSharedPointer<TextureTile> > &tiles ) const;
61  void paintSunShading( QImage *tileImage, const TileId &id ) const;
62  void paintTileId( QImage *tileImage, const TileId &id ) const;
63 
64  void detectMaxTileLevel();
65  QVector<const GeoSceneTextureTile *> findRelevantTextureLayers( const TileId &stackedTileId ) const;
66 
67  TileLoader *const m_tileLoader;
68  const SunLocator *const m_sunLocator;
69  BlendingFactory m_blendingFactory;
70  QVector<const GeoSceneTextureTile *> m_textureLayers;
71  QList<const GeoDataGroundOverlay *> m_groundOverlays;
72  int m_maxTileLevel;
73  QString m_themeId;
74  int m_levelZeroColumns;
75  int m_levelZeroRows;
76  bool m_showSunShading;
77  bool m_showCityLights;
78  bool m_showTileId;
79 };
80 
81 MergedLayerDecorator::Private::Private( TileLoader *tileLoader, const SunLocator *sunLocator ) :
82  m_tileLoader( tileLoader ),
83  m_sunLocator( sunLocator ),
84  m_blendingFactory( sunLocator ),
85  m_textureLayers(),
86  m_maxTileLevel( 0 ),
87  m_themeId(),
88  m_levelZeroColumns( 0 ),
89  m_levelZeroRows( 0 ),
90  m_showSunShading( false ),
91  m_showCityLights( false ),
92  m_showTileId( false )
93 {
94 }
95 
96 MergedLayerDecorator::MergedLayerDecorator( TileLoader * const tileLoader,
97  const SunLocator* sunLocator )
98  : d( new Private( tileLoader, sunLocator ) )
99 {
100 }
101 
102 MergedLayerDecorator::~MergedLayerDecorator()
103 {
104  delete d;
105 }
106 
107 void MergedLayerDecorator::setTextureLayers( const QVector<const GeoSceneTextureTile *> &textureLayers )
108 {
109  mDebug() << Q_FUNC_INFO;
110 
111  if ( textureLayers.count() > 0 ) {
112  const GeoSceneTiled *const firstTexture = textureLayers.at( 0 );
113  d->m_levelZeroColumns = firstTexture->levelZeroColumns();
114  d->m_levelZeroRows = firstTexture->levelZeroRows();
115  d->m_blendingFactory.setLevelZeroLayout( d->m_levelZeroColumns, d->m_levelZeroRows );
116  d->m_themeId = "maps/" + firstTexture->sourceDir();
117  }
118 
119  d->m_textureLayers = textureLayers;
120 
121  d->detectMaxTileLevel();
122 }
123 
124 void MergedLayerDecorator::updateGroundOverlays(const QList<const GeoDataGroundOverlay *> &groundOverlays )
125 {
126  d->m_groundOverlays = groundOverlays;
127 }
128 
129 
130 int MergedLayerDecorator::textureLayersSize() const
131 {
132  return d->m_textureLayers.size();
133 }
134 
135 int MergedLayerDecorator::maximumTileLevel() const
136 {
137  return d->m_maxTileLevel;
138 }
139 
140 int MergedLayerDecorator::tileColumnCount( int level ) const
141 {
142  Q_ASSERT( !d->m_textureLayers.isEmpty() );
143 
144  const int levelZeroColumns = d->m_textureLayers.at( 0 )->levelZeroColumns();
145 
146  return TileLoaderHelper::levelToColumn( levelZeroColumns, level );
147 }
148 
149 int MergedLayerDecorator::tileRowCount( int level ) const
150 {
151  Q_ASSERT( !d->m_textureLayers.isEmpty() );
152 
153  const int levelZeroRows = d->m_textureLayers.at( 0 )->levelZeroRows();
154 
155  return TileLoaderHelper::levelToRow( levelZeroRows, level );
156 }
157 
158 GeoSceneTiled::Projection MergedLayerDecorator::tileProjection() const
159 {
160  Q_ASSERT( !d->m_textureLayers.isEmpty() );
161 
162  return d->m_textureLayers.at( 0 )->projection();
163 }
164 
165 QSize MergedLayerDecorator::tileSize() const
166 {
167  Q_ASSERT( !d->m_textureLayers.isEmpty() );
168 
169  return d->m_textureLayers.at( 0 )->tileSize();
170 }
171 
172 StackedTile *MergedLayerDecorator::Private::createTile( const QVector<QSharedPointer<TextureTile> > &tiles ) const
173 {
174  Q_ASSERT( !tiles.isEmpty() );
175 
176  const TileId firstId = tiles.first()->id();
177  const TileId id( 0, firstId.zoomLevel(), firstId.x(), firstId.y() );
178 
179  // Image for blending all the texture tiles on it
180  QImage resultImage;
181 
182  // if there are more than one active texture layers, we have to convert the
183  // result tile into QImage::Format_ARGB32_Premultiplied to make blending possible
184  const bool withConversion = tiles.count() > 1 || m_showSunShading || m_showTileId || !m_groundOverlays.isEmpty();
185  foreach ( const QSharedPointer<TextureTile> &tile, tiles ) {
186 
187  // Image blending. If there are several images in the same tile (like clouds
188  // or hillshading images over the map) blend them all into only one image
189 
190  const Blending *const blending = tile->blending();
191  if ( blending ) {
192 
193  mDebug() << Q_FUNC_INFO << "blending";
194 
195  if ( resultImage.isNull() ) {
196  resultImage = QImage( tile->image()->size(), QImage::Format_ARGB32_Premultiplied );
197  }
198 
199  blending->blend( &resultImage, tile.data() );
200  }
201  else {
202  mDebug() << Q_FUNC_INFO << "no blending defined => copying top over bottom image";
203  if ( withConversion ) {
204  resultImage = tile->image()->convertToFormat( QImage::Format_ARGB32_Premultiplied );
205  } else {
206  resultImage = tile->image()->copy();
207  }
208  }
209  }
210 
211  renderGroundOverlays( &resultImage, tiles );
212 
213  if ( m_showSunShading && !m_showCityLights ) {
214  paintSunShading( &resultImage, id );
215  }
216 
217  if ( m_showTileId ) {
218  paintTileId( &resultImage, id );
219  }
220 
221  return new StackedTile( id, resultImage, tiles );
222 }
223 
224 void MergedLayerDecorator::Private::renderGroundOverlays( QImage *tileImage, const QVector<QSharedPointer<TextureTile> > &tiles ) const
225 {
226 
227  /* All tiles are covering the same area. Pick one. */
228  const TileId tileId = tiles.first()->id();
229 
230  GeoDataLatLonBox tileLatLonBox = tileId.toLatLonBox( findRelevantTextureLayers( tileId ).first() );
231 
232  /* Map the ground overlay to the image. */
233  for ( int i = 0; i < m_groundOverlays.size(); ++i ) {
234 
235  const GeoDataGroundOverlay* overlay = m_groundOverlays.at( i );
236 
237  const GeoDataLatLonBox overlayLatLonBox = overlay->latLonBox();
238 
239  if ( !tileLatLonBox.intersects( overlayLatLonBox.toCircumscribedRectangle() ) ) {
240  continue;
241  }
242 
243  const qreal sinRotation = sin( -overlay->latLonBox().rotation() );
244  const qreal cosRotation = cos( -overlay->latLonBox().rotation() );
245 
246  const qreal centerLat = overlayLatLonBox.center().latitude();
247 
248  const qreal pixelToLat = tileLatLonBox.height() / tileImage->height();
249  const qreal pixelToLon = tileLatLonBox.width() / tileImage->width();
250 
251  const qreal latToPixel = overlay->icon().height() / overlayLatLonBox.height();
252  const qreal lonToPixel = overlay->icon().width() / overlayLatLonBox.width();
253 
254  for ( int y = 0; y < tileImage->height(); ++y ) {
255  QRgb *scanLine = ( QRgb* ) ( tileImage->scanLine( y ) );
256 
257  qreal lat = tileLatLonBox.north() - y * pixelToLat;
258 
259  for ( int x = 0; x < tileImage->width(); ++x, ++scanLine ) {
260  qreal lon = GeoDataCoordinates::normalizeLon( tileLatLonBox.west() + x * pixelToLon );
261 
262  qreal centerLon = overlayLatLonBox.center().longitude();
263 
264  if ( overlayLatLonBox.crossesDateLine() ) {
265  if ( lon < 0 && centerLon > 0 ) {
266  centerLon -= 2 * M_PI;
267  }
268  if ( lon > 0 && centerLon < 0 ) {
269  centerLon += 2 * M_PI;
270  }
271  if ( overlayLatLonBox.west() > 0 && overlayLatLonBox.east() > 0 && overlayLatLonBox.west() > overlayLatLonBox.east() && lon > 0 && lon < overlayLatLonBox.west() ) {
272  if ( ! ( lon < overlayLatLonBox.west() && lon > overlayLatLonBox.toCircumscribedRectangle().west() ) ) {
273  centerLon -= 2 * M_PI;
274  }
275  }
276  }
277 
278  qreal rotatedLon = ( lon - centerLon ) * cosRotation - ( lat - centerLat ) * sinRotation + centerLon;
279  qreal rotatedLat = ( lon - centerLon ) * sinRotation + ( lat - centerLat ) * cosRotation + centerLat;
280 
281  GeoDataCoordinates::normalizeLonLat( rotatedLon, rotatedLat );
282 
283  if ( overlay->latLonBox().contains( GeoDataCoordinates( rotatedLon, rotatedLat ) ) ) {
284 
285  qreal px = ( GeoDataLatLonBox( 0, 0, rotatedLon, overlayLatLonBox.west() ).width() * lonToPixel );
286  qreal py = qreal( overlay->icon().height() ) - ( GeoDataLatLonBox( rotatedLat, overlayLatLonBox.south(), 0, 0 ).height() * latToPixel ) - 1;
287 
288  if ( px >= 0 && px < overlay->icon().width() && py >= 0 && py < overlay->icon().height() ) {
289  *scanLine = ImageF::pixelF( overlay->icon(), px, py );
290  }
291  }
292  }
293  }
294  }
295 }
296 
297 StackedTile *MergedLayerDecorator::loadTile( const TileId &stackedTileId )
298 {
299  const QVector<const GeoSceneTextureTile *> textureLayers = d->findRelevantTextureLayers( stackedTileId );
300  QVector<QSharedPointer<TextureTile> > tiles;
301 
302  foreach ( const GeoSceneTextureTile *layer, textureLayers ) {
303  const TileId tileId( layer->sourceDir(), stackedTileId.zoomLevel(),
304  stackedTileId.x(), stackedTileId.y() );
305 
306  mDebug() << Q_FUNC_INFO << layer->sourceDir() << tileId << layer->tileSize() << layer->fileFormat();
307 
308  // Blending (how to merge the images into an only image)
309  const Blending *blending = d->m_blendingFactory.findBlending( layer->blending() );
310  if ( blending == 0 && !layer->blending().isEmpty() ) {
311  mDebug() << Q_FUNC_INFO << "could not find blending" << layer->blending();
312  }
313 
314  const GeoSceneTextureTile *const textureLayer = static_cast<const GeoSceneTextureTile *>( layer );
315  const QImage tileImage = d->m_tileLoader->loadTileImage( textureLayer, tileId, DownloadBrowse );
316 
317  QSharedPointer<TextureTile> tile( new TextureTile( tileId, tileImage, blending ) );
318  tiles.append( tile );
319  }
320 
321  Q_ASSERT( !tiles.isEmpty() );
322 
323  return d->createTile( tiles );
324 }
325 
326 StackedTile *MergedLayerDecorator::updateTile( const StackedTile &stackedTile, const TileId &tileId, const QImage &tileImage )
327 {
328  Q_ASSERT( !tileImage.isNull() );
329 
330  d->detectMaxTileLevel();
331 
332  QVector<QSharedPointer<TextureTile> > tiles = stackedTile.tiles();
333 
334  for ( int i = 0; i < tiles.count(); ++ i) {
335  if ( tiles[i]->id() == tileId ) {
336  const Blending *blending = tiles[i]->blending();
337 
338  tiles[i] = QSharedPointer<TextureTile>( new TextureTile( tileId, tileImage, blending ) );
339  }
340  }
341 
342  return d->createTile( tiles );
343 }
344 
345 void MergedLayerDecorator::downloadStackedTile( const TileId &id, DownloadUsage usage )
346 {
347  const QVector<const GeoSceneTextureTile *> textureLayers = d->findRelevantTextureLayers( id );
348 
349  foreach ( const GeoSceneTextureTile *textureLayer, textureLayers ) {
350  if ( TileLoader::tileStatus( textureLayer, id ) != TileLoader::Available || usage == DownloadBrowse ) {
351  d->m_tileLoader->downloadTile( textureLayer, id, usage );
352  }
353  }
354 }
355 
356 void MergedLayerDecorator::setShowSunShading( bool show )
357 {
358  d->m_showSunShading = show;
359 }
360 
361 bool MergedLayerDecorator::showSunShading() const
362 {
363  return d->m_showSunShading;
364 }
365 
366 void MergedLayerDecorator::setShowCityLights( bool show )
367 {
368  d->m_showCityLights = show;
369 }
370 
371 bool MergedLayerDecorator::showCityLights() const
372 {
373  return d->m_showCityLights;
374 }
375 
376 void MergedLayerDecorator::setShowTileId( bool visible )
377 {
378  d->m_showTileId = visible;
379 }
380 
381 void MergedLayerDecorator::Private::paintSunShading( QImage *tileImage, const TileId &id ) const
382 {
383  if ( tileImage->depth() != 32 )
384  return;
385 
386  // TODO add support for 8-bit maps?
387  // add sun shading
388  const qreal global_width = tileImage->width()
389  * TileLoaderHelper::levelToColumn( m_levelZeroColumns, id.zoomLevel() );
390  const qreal global_height = tileImage->height()
391  * TileLoaderHelper::levelToRow( m_levelZeroRows, id.zoomLevel() );
392  const qreal lon_scale = 2*M_PI / global_width;
393  const qreal lat_scale = -M_PI / global_height;
394  const int tileHeight = tileImage->height();
395  const int tileWidth = tileImage->width();
396 
397  // First we determine the supporting point interval for the interpolation.
398  const int n = maxDivisor( 30, tileWidth );
399  const int ipRight = n * (int)( tileWidth / n );
400 
401  for ( int cur_y = 0; cur_y < tileHeight; ++cur_y ) {
402  const qreal lat = lat_scale * ( id.y() * tileHeight + cur_y ) - 0.5*M_PI;
403  const qreal a = sin( (lat+DEG2RAD * m_sunLocator->getLat() )/2.0 );
404  const qreal c = cos(lat)*cos( -DEG2RAD * m_sunLocator->getLat() );
405 
406  QRgb* scanline = (QRgb*)tileImage->scanLine( cur_y );
407 
408  qreal lastShade = -10.0;
409 
410  int cur_x = 0;
411 
412  while ( cur_x < tileWidth ) {
413 
414  const bool interpolate = ( cur_x != 0 && cur_x < ipRight && cur_x + n < tileWidth );
415 
416  qreal shade = 0;
417 
418  if ( interpolate ) {
419  const int check = cur_x + n;
420  const qreal checklon = lon_scale * ( id.x() * tileWidth + check );
421  shade = m_sunLocator->shading( checklon, a, c );
422 
423  // if the shading didn't change across the interpolation
424  // interval move on and don't change anything.
425  if ( shade == lastShade && shade == 1.0 ) {
426  scanline += n;
427  cur_x += n;
428  continue;
429  }
430  if ( shade == lastShade && shade == 0.0 ) {
431  for ( int t = 0; t < n; ++t ) {
432  m_sunLocator->shadePixel( *scanline, shade );
433  ++scanline;
434  }
435  cur_x += n;
436  continue;
437  }
438  for ( int t = 0; t < n ; ++t ) {
439  const qreal lon = lon_scale * ( id.x() * tileWidth + cur_x );
440  shade = m_sunLocator->shading( lon, a, c );
441  m_sunLocator->shadePixel( *scanline, shade );
442  ++scanline;
443  ++cur_x;
444  }
445  }
446 
447  else {
448  // Make sure we don't exceed the image memory
449  if ( cur_x < tileWidth ) {
450  const qreal lon = lon_scale * ( id.x() * tileWidth + cur_x );
451  shade = m_sunLocator->shading( lon, a, c );
452  m_sunLocator->shadePixel( *scanline, shade );
453  ++scanline;
454  ++cur_x;
455  }
456  }
457  lastShade = shade;
458  }
459  }
460 }
461 
462 void MergedLayerDecorator::Private::paintTileId( QImage *tileImage, const TileId &id ) const
463 {
464  QString filename = QString( "%1_%2.jpg" )
465  .arg( id.x(), tileDigits, 10, QChar('0') )
466  .arg( id.y(), tileDigits, 10, QChar('0') );
467 
468  QPainter painter( tileImage );
469 
470  QColor foreground;
471  QColor background;
472 
473  if ( ( (qreal)(id.x())/2 == id.x()/2 && (qreal)(id.y())/2 == id.y()/2 )
474  || ( (qreal)(id.x())/2 != id.x()/2 && (qreal)(id.y())/2 != id.y()/2 )
475  )
476  {
477  foreground.setNamedColor( "#FFFFFF" );
478  background.setNamedColor( "#000000" );
479  }
480  else {
481  foreground.setNamedColor( "#000000" );
482  background.setNamedColor( "#FFFFFF" );
483  }
484 
485  int strokeWidth = 10;
486  QPen testPen( foreground );
487  testPen.setWidth( strokeWidth );
488  testPen.setJoinStyle( Qt::MiterJoin );
489 
490  painter.setPen( testPen );
491  painter.drawRect( strokeWidth / 2, strokeWidth / 2,
492  tileImage->width() - strokeWidth,
493  tileImage->height() - strokeWidth );
494  QFont testFont( "Sans", 12 );
495  QFontMetrics testFm( testFont );
496  painter.setFont( testFont );
497 
498  QPen outlinepen( foreground );
499  outlinepen.setWidthF( 6 );
500 
501  painter.setPen( outlinepen );
502  painter.setBrush( background );
503 
504  QPainterPath outlinepath;
505 
506  QPointF baseline1( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
507  ( tileImage->height() * 0.25) );
508  outlinepath.addText( baseline1, testFont, QString( "level: %1" ).arg(id.zoomLevel()) );
509 
510  QPointF baseline2( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
511  tileImage->height() * 0.50 );
512  outlinepath.addText( baseline2, testFont, filename );
513 
514  QPointF baseline3( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
515  tileImage->height() * 0.75 );
516  outlinepath.addText( baseline3, testFont, m_themeId );
517 
518  painter.drawPath( outlinepath );
519 
520  painter.setPen( Qt::NoPen );
521  painter.drawPath( outlinepath );
522 }
523 
524 void MergedLayerDecorator::Private::detectMaxTileLevel()
525 {
526  if ( m_textureLayers.isEmpty() ) {
527  m_maxTileLevel = -1;
528  return;
529  }
530 
531  m_maxTileLevel = TileLoader::maximumTileLevel( *m_textureLayers.at( 0 ) );
532 }
533 
534 QVector<const GeoSceneTextureTile *> MergedLayerDecorator::Private::findRelevantTextureLayers( const TileId &stackedTileId ) const
535 {
536  QVector<const GeoSceneTextureTile *> result;
537 
538  foreach ( const GeoSceneTextureTile *candidate, m_textureLayers ) {
539  Q_ASSERT( candidate );
540  // check, if layer provides tiles for the current level
541  if ( !candidate->hasMaximumTileLevel() ||
542  candidate->maximumTileLevel() >= stackedTileId.zoomLevel() ) {
543  result.append( candidate );
544  }
545  }
546 
547  return result;
548 }
549 
550 // TODO: This should likely go into a math class in the future ...
551 
552 int MergedLayerDecorator::Private::maxDivisor( int maximum, int fullLength )
553 {
554  // Find the optimal interpolation interval n for the
555  // current image canvas width
556  int best = 2;
557 
558  int nEvalMin = fullLength;
559  for ( int it = 1; it <= maximum; ++it ) {
560  // The optimum is the interval which results in the least amount
561  // supporting points taking into account the rest which can't
562  // get used for interpolation.
563  int nEval = fullLength / it + fullLength % it;
564  if ( nEval < nEvalMin ) {
565  nEvalMin = nEval;
566  best = it;
567  }
568  }
569  return best;
570 }
GeoSceneHead.h
GeoSceneTypes.h
QPainter
TileLoader.h
GeoDataCoordinates.h
interpolate
void interpolate(MarbleWidget *widget, qreal value)
Definition: examples/cpp/animation-video/main.cpp:68
Marble::MergedLayerDecorator::showCityLights
bool showCityLights() const
Definition: MergedLayerDecorator.cpp:371
Marble::GeoDataLatLonBox::height
qreal height(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the height of the latitude interval.
Definition: GeoDataLatLonBox.cpp:255
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::MergedLayerDecorator::showSunShading
bool showSunShading() const
Definition: MergedLayerDecorator.cpp:361
Marble::BlendingFactory
Definition: BlendingFactory.h:28
Marble::GeoDataLatLonBox::width
qreal width(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the width of the longitude interval.
Definition: GeoDataLatLonBox.cpp:236
Marble::MergedLayerDecorator::setShowSunShading
void setShowSunShading(bool show)
Definition: MergedLayerDecorator.cpp:356
Marble::Blending
Definition: Blending.h:25
MarbleMath.h
Marble::TileId::zoomLevel
int zoomLevel() const
Definition: TileId.h:57
Marble::DownloadUsage
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:160
TextureTile.h
TileCreator.h
Marble::Blending::blend
virtual void blend(QImage *const bottom, TextureTile const *const top) const =0
Marble::ImageF::pixelF
static uint pixelF(const QImage &image, qreal x, qreal y)
Returns the color value of the result tile at a given floating point position.
Definition: ImageF.cpp:18
Marble::TextureTile
A class that resembles an image tile (extends Tile).
Definition: TextureTile.h:60
Marble::TileLoader::tileStatus
static TileStatus tileStatus(GeoSceneTiled const *textureLayer, const TileId &tileId)
Returns the status of the downloaded tile file:
Definition: TileLoader.cpp:191
Marble::GeoDataCoordinates::normalizeLon
static qreal normalizeLon(qreal lon, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize the longitude to always be -M_PI <= lon <= +M_PI (Radian).
Definition: GeoDataCoordinates.cpp:776
Marble::TileLoader::maximumTileLevel
static int maximumTileLevel(GeoSceneTiled const &texture)
Definition: TileLoader.cpp:138
Marble::GeoSceneTiled::Projection
Projection
Definition: GeoSceneTiled.h:47
Marble::TileId::y
int y() const
Definition: TileId.h:67
Marble::MergedLayerDecorator::tileProjection
GeoSceneTextureTile::Projection tileProjection() const
Definition: MergedLayerDecorator.cpp:158
Marble::GeoSceneAbstractDataset::fileFormat
QString fileFormat() const
Definition: GeoSceneAbstractDataset.cpp:43
Marble::GeoSceneTiled::levelZeroColumns
int levelZeroColumns() const
Definition: GeoSceneTiled.cpp:97
Marble::GeoSceneTiled
Definition: GeoSceneTiled.h:43
Marble::DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
Definition: MarbleGlobal.h:162
GeoSceneDocument.h
SunLocator.h
Marble::GeoDataCoordinates::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:751
Planet.h
BlendingFactory.h
Marble::GeoDataLatLonBox::contains
virtual bool contains(const GeoDataCoordinates &) const
Definition: GeoDataLatLonBox.cpp:309
MarbleDebug.h
Marble::GeoDataGroundOverlay::latLonBox
GeoDataLatLonBox & latLonBox() const
Definition: GeoDataGroundOverlay.cpp:83
Marble::MergedLayerDecorator::setTextureLayers
void setTextureLayers(const QVector< const GeoSceneTextureTile * > &textureLayers)
Definition: MergedLayerDecorator.cpp:107
Marble::GeoSceneTiled::maximumTileLevel
int maximumTileLevel() const
Definition: GeoSceneTiled.cpp:117
Marble::StackedTile
A single tile that consists of a stack of Tile layers.
Definition: StackedTile.h:56
Marble::MergedLayerDecorator::tileSize
QSize tileSize() const
Definition: MergedLayerDecorator.cpp:165
Marble::MergedLayerDecorator::updateGroundOverlays
void updateGroundOverlays(const QList< const GeoDataGroundOverlay * > &groundOverlays)
Definition: MergedLayerDecorator.cpp:124
Marble::GeoDataLatLonBox::north
qreal north(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the northern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:93
Marble::MergedLayerDecorator::~MergedLayerDecorator
virtual ~MergedLayerDecorator()
Definition: MergedLayerDecorator.cpp:102
Marble::GeoDataLatLonBox::east
qreal east(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the eastern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:135
Marble::GeoDataOverlay::icon
QImage icon() const
Definition: GeoDataOverlay.cpp:80
Marble::SunLocator
Definition: SunLocator.h:33
Marble::MergedLayerDecorator::textureLayersSize
int textureLayersSize() const
Definition: MergedLayerDecorator.cpp:130
Marble::MergedLayerDecorator::tileRowCount
int tileRowCount(int level) const
Definition: MergedLayerDecorator.cpp:149
Marble::MergedLayerDecorator::maximumTileLevel
int maximumTileLevel() const
Returns the highest level in which some tiles are theoretically available for the current texture lay...
Definition: MergedLayerDecorator.cpp:135
Marble::GeoDataLatLonBox::intersects
virtual bool intersects(const GeoDataLatLonBox &) const
Definition: GeoDataLatLonBox.cpp:385
Marble::GeoDataLatLonBox::rotation
qreal rotation(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the rotation of the bounding box.
Definition: GeoDataLatLonBox.cpp:190
Marble::GeoDataCoordinates::normalizeLonLat
static void normalizeLonLat(qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize both longitude and latitude at the same time This method normalizes both latitude and longi...
Definition: GeoDataCoordinates.cpp:845
MarbleGlobal.h
Marble::DEG2RAD
const qreal DEG2RAD
Definition: MarbleGlobal.h:200
Marble::GeoSceneTiled::blending
QString blending() const
Definition: GeoSceneTiled.h:130
Marble::GeoSceneTiled::sourceDir
QString sourceDir() const
Definition: GeoSceneTiled.cpp:56
Marble::GeoDataLatLonBox::center
virtual GeoDataCoordinates center() const
returns the center of this box
Definition: GeoDataLatLonBox.cpp:276
Marble::TileId::toLatLonBox
GeoDataLatLonBox toLatLonBox(const GeoSceneTiled *textureLayer) const
Definition: TileId.cpp:36
Marble::TileId::x
int x() const
Definition: TileId.h:62
Marble::GeoSceneTiled::levelZeroRows
int levelZeroRows() const
Definition: GeoSceneTiled.cpp:107
GeoSceneVectorTile.h
Marble::GeoDataCoordinates::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:739
MergedLayerDecorator.h
Marble::GeoDataLatLonBox::crossesDateLine
bool crossesDateLine() const
Detect whether the bounding box crosses the IDL.
Definition: GeoDataLatLonBox.cpp:266
Marble::MergedLayerDecorator::tileColumnCount
int tileColumnCount(int level) const
Definition: MergedLayerDecorator.cpp:140
Marble::GeoDataLatLonBox::toCircumscribedRectangle
GeoDataLatLonBox toCircumscribedRectangle() const
Definition: GeoDataLatLonBox.cpp:506
Marble::MergedLayerDecorator::updateTile
StackedTile * updateTile(const StackedTile &stackedTile, const TileId &tileId, const QImage &tileImage)
Definition: MergedLayerDecorator.cpp:326
Marble::GeoSceneTiled::tileSize
const QSize tileSize() const
Definition: GeoSceneTiled.cpp:132
Marble::GeoDataLatLonBox::west
qreal west(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the western boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:156
Blending.h
Marble::TileId
Definition: TileId.h:27
Marble::GeoSceneTiled::hasMaximumTileLevel
bool hasMaximumTileLevel() const
Definition: GeoSceneTiled.h:125
Marble::tileDigits
const int tileDigits
Definition: MarbleGlobal.h:234
Marble::TileLoaderHelper::levelToRow
MARBLE_EXPORT int levelToRow(int levelZeroRows, int level)
Get the maximum number of tile rows for a given tile level.
Definition: TileLoaderHelper.cpp:36
ImageF.h
StackedTile.h
Marble::MergedLayerDecorator::loadTile
StackedTile * loadTile(const TileId &id)
Definition: MergedLayerDecorator.cpp:297
Marble::GeoDataLatLonBox::south
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:114
Marble::TileLoader::Available
Definition: TileLoader.h:52
Marble::TileLoaderHelper::levelToColumn
MARBLE_EXPORT int levelToColumn(int levelZeroColumns, int level)
Get the maximum number of tile columns for a given tile level.
Definition: TileLoaderHelper.cpp:46
M_PI
#define M_PI
Definition: GeoDataCoordinates.h:26
Marble::GeoDataGroundOverlay
Definition: GeoDataGroundOverlay.h:24
Marble::GeoSceneTextureTile
Definition: GeoSceneTextureTile.h:23
Marble::MergedLayerDecorator::setShowCityLights
void setShowCityLights(bool show)
Definition: MergedLayerDecorator.cpp:366
Marble::MergedLayerDecorator::downloadStackedTile
void downloadStackedTile(const TileId &id, DownloadUsage usage)
Definition: MergedLayerDecorator.cpp:345
GeoSceneTextureTile.h
Marble::MergedLayerDecorator::d
Private *const d
Definition: MergedLayerDecorator.h:82
TileLoaderHelper.h
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
Marble::StackedTile::tiles
QVector< QSharedPointer< TextureTile > > tiles() const
Returns the stack of Tiles.
Definition: StackedTile.cpp:257
GeoSceneMap.h
Marble::MergedLayerDecorator::setShowTileId
void setShowTileId(bool show)
Definition: MergedLayerDecorator.cpp:376
MapThemeManager.h
TileCreatorDialog.h
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
Marble::TileLoader
Definition: TileLoader.h:44
usage
void usage(const QString &app)
Definition: merge_ts_po.cpp:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal