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

marble

  • sources
  • kde-4.14
  • 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 "MarbleMath.h"
25 #include "MarbleDebug.h"
26 #include "GeoDataGroundOverlay.h"
27 #include "GeoSceneTextureTile.h"
28 #include "GeoSceneVectorTile.h"
29 #include "ImageF.h"
30 #include "StackedTile.h"
31 #include "TileLoaderHelper.h"
32 #include "TextureTile.h"
33 #include "TileLoader.h"
34 
35 #include "GeoDataCoordinates.h"
36 
37 #include <QMutexLocker>
38 #include <QPointer>
39 #include <QPainter>
40 
41 using namespace Marble;
42 
43 class MergedLayerDecorator::Private
44 {
45 public:
46  Private( TileLoader *tileLoader, const SunLocator *sunLocator );
47 
48  static int maxDivisor( int maximum, int fullLength );
49 
50  StackedTile *createTile( const QVector<QSharedPointer<TextureTile> > &tiles ) const;
51 
52  void renderGroundOverlays( QImage *tileImage, const QVector<QSharedPointer<TextureTile> > &tiles ) const;
53  void paintSunShading( QImage *tileImage, const TileId &id ) const;
54  void paintTileId( QImage *tileImage, const TileId &id ) const;
55 
56  void detectMaxTileLevel();
57  QVector<const GeoSceneTextureTile *> findRelevantTextureLayers( const TileId &stackedTileId ) const;
58 
59  TileLoader *const m_tileLoader;
60  const SunLocator *const m_sunLocator;
61  BlendingFactory m_blendingFactory;
62  QVector<const GeoSceneTextureTile *> m_textureLayers;
63  QList<const GeoDataGroundOverlay *> m_groundOverlays;
64  int m_maxTileLevel;
65  QString m_themeId;
66  int m_levelZeroColumns;
67  int m_levelZeroRows;
68  bool m_showSunShading;
69  bool m_showCityLights;
70  bool m_showTileId;
71 };
72 
73 MergedLayerDecorator::Private::Private( TileLoader *tileLoader, const SunLocator *sunLocator ) :
74  m_tileLoader( tileLoader ),
75  m_sunLocator( sunLocator ),
76  m_blendingFactory( sunLocator ),
77  m_textureLayers(),
78  m_maxTileLevel( 0 ),
79  m_themeId(),
80  m_levelZeroColumns( 0 ),
81  m_levelZeroRows( 0 ),
82  m_showSunShading( false ),
83  m_showCityLights( false ),
84  m_showTileId( false )
85 {
86 }
87 
88 MergedLayerDecorator::MergedLayerDecorator( TileLoader * const tileLoader,
89  const SunLocator* sunLocator )
90  : d( new Private( tileLoader, sunLocator ) )
91 {
92 }
93 
94 MergedLayerDecorator::~MergedLayerDecorator()
95 {
96  delete d;
97 }
98 
99 void MergedLayerDecorator::setTextureLayers( const QVector<const GeoSceneTextureTile *> &textureLayers )
100 {
101  mDebug() << Q_FUNC_INFO;
102 
103  if ( textureLayers.count() > 0 ) {
104  const GeoSceneTiled *const firstTexture = textureLayers.at( 0 );
105  d->m_levelZeroColumns = firstTexture->levelZeroColumns();
106  d->m_levelZeroRows = firstTexture->levelZeroRows();
107  d->m_blendingFactory.setLevelZeroLayout( d->m_levelZeroColumns, d->m_levelZeroRows );
108  d->m_themeId = "maps/" + firstTexture->sourceDir();
109  }
110 
111  d->m_textureLayers = textureLayers;
112 
113  d->detectMaxTileLevel();
114 }
115 
116 void MergedLayerDecorator::updateGroundOverlays(const QList<const GeoDataGroundOverlay *> &groundOverlays )
117 {
118  d->m_groundOverlays = groundOverlays;
119 }
120 
121 
122 int MergedLayerDecorator::textureLayersSize() const
123 {
124  return d->m_textureLayers.size();
125 }
126 
127 int MergedLayerDecorator::maximumTileLevel() const
128 {
129  return d->m_maxTileLevel;
130 }
131 
132 int MergedLayerDecorator::tileColumnCount( int level ) const
133 {
134  Q_ASSERT( !d->m_textureLayers.isEmpty() );
135 
136  const int levelZeroColumns = d->m_textureLayers.at( 0 )->levelZeroColumns();
137 
138  return TileLoaderHelper::levelToColumn( levelZeroColumns, level );
139 }
140 
141 int MergedLayerDecorator::tileRowCount( int level ) const
142 {
143  Q_ASSERT( !d->m_textureLayers.isEmpty() );
144 
145  const int levelZeroRows = d->m_textureLayers.at( 0 )->levelZeroRows();
146 
147  return TileLoaderHelper::levelToRow( levelZeroRows, level );
148 }
149 
150 GeoSceneTiled::Projection MergedLayerDecorator::tileProjection() const
151 {
152  Q_ASSERT( !d->m_textureLayers.isEmpty() );
153 
154  return d->m_textureLayers.at( 0 )->projection();
155 }
156 
157 QSize MergedLayerDecorator::tileSize() const
158 {
159  Q_ASSERT( !d->m_textureLayers.isEmpty() );
160 
161  return d->m_textureLayers.at( 0 )->tileSize();
162 }
163 
164 StackedTile *MergedLayerDecorator::Private::createTile( const QVector<QSharedPointer<TextureTile> > &tiles ) const
165 {
166  Q_ASSERT( !tiles.isEmpty() );
167 
168  const TileId firstId = tiles.first()->id();
169  const TileId id( 0, firstId.zoomLevel(), firstId.x(), firstId.y() );
170 
171  // Image for blending all the texture tiles on it
172  QImage resultImage;
173 
174  // if there are more than one active texture layers, we have to convert the
175  // result tile into QImage::Format_ARGB32_Premultiplied to make blending possible
176  const bool withConversion = tiles.count() > 1 || m_showSunShading || m_showTileId || !m_groundOverlays.isEmpty();
177  foreach ( const QSharedPointer<TextureTile> &tile, tiles ) {
178 
179  // Image blending. If there are several images in the same tile (like clouds
180  // or hillshading images over the map) blend them all into only one image
181 
182  const Blending *const blending = tile->blending();
183  if ( blending ) {
184 
185  mDebug() << Q_FUNC_INFO << "blending";
186 
187  if ( resultImage.isNull() ) {
188  resultImage = QImage( tile->image()->size(), QImage::Format_ARGB32_Premultiplied );
189  }
190 
191  blending->blend( &resultImage, tile.data() );
192  }
193  else {
194  mDebug() << Q_FUNC_INFO << "no blending defined => copying top over bottom image";
195  if ( withConversion ) {
196  resultImage = tile->image()->convertToFormat( QImage::Format_ARGB32_Premultiplied );
197  } else {
198  resultImage = tile->image()->copy();
199  }
200  }
201  }
202 
203  renderGroundOverlays( &resultImage, tiles );
204 
205  if ( m_showSunShading && !m_showCityLights ) {
206  paintSunShading( &resultImage, id );
207  }
208 
209  if ( m_showTileId ) {
210  paintTileId( &resultImage, id );
211  }
212 
213  return new StackedTile( id, resultImage, tiles );
214 }
215 
216 void MergedLayerDecorator::Private::renderGroundOverlays( QImage *tileImage, const QVector<QSharedPointer<TextureTile> > &tiles ) const
217 {
218 
219  /* All tiles are covering the same area. Pick one. */
220  const TileId tileId = tiles.first()->id();
221 
222  GeoDataLatLonBox tileLatLonBox = tileId.toLatLonBox( findRelevantTextureLayers( tileId ).first() );
223 
224  /* Map the ground overlay to the image. */
225  for ( int i = 0; i < m_groundOverlays.size(); ++i ) {
226 
227  const GeoDataGroundOverlay* overlay = m_groundOverlays.at( i );
228 
229  const GeoDataLatLonBox overlayLatLonBox = overlay->latLonBox();
230 
231  if ( !tileLatLonBox.intersects( overlayLatLonBox.toCircumscribedRectangle() ) ) {
232  continue;
233  }
234 
235  const qreal sinRotation = sin( -overlay->latLonBox().rotation() );
236  const qreal cosRotation = cos( -overlay->latLonBox().rotation() );
237 
238  const qreal centerLat = overlayLatLonBox.center().latitude();
239 
240  const qreal pixelToLat = tileLatLonBox.height() / tileImage->height();
241  const qreal pixelToLon = tileLatLonBox.width() / tileImage->width();
242 
243  const qreal latToPixel = overlay->icon().height() / overlayLatLonBox.height();
244  const qreal lonToPixel = overlay->icon().width() / overlayLatLonBox.width();
245 
246  for ( int y = 0; y < tileImage->height(); ++y ) {
247  QRgb *scanLine = ( QRgb* ) ( tileImage->scanLine( y ) );
248 
249  qreal lat = tileLatLonBox.north() - y * pixelToLat;
250 
251  for ( int x = 0; x < tileImage->width(); ++x, ++scanLine ) {
252  qreal lon = GeoDataCoordinates::normalizeLon( tileLatLonBox.west() + x * pixelToLon );
253 
254  qreal centerLon = overlayLatLonBox.center().longitude();
255 
256  if ( overlayLatLonBox.crossesDateLine() ) {
257  if ( lon < 0 && centerLon > 0 ) {
258  centerLon -= 2 * M_PI;
259  }
260  if ( lon > 0 && centerLon < 0 ) {
261  centerLon += 2 * M_PI;
262  }
263  if ( overlayLatLonBox.west() > 0 && overlayLatLonBox.east() > 0 && overlayLatLonBox.west() > overlayLatLonBox.east() && lon > 0 && lon < overlayLatLonBox.west() ) {
264  if ( ! ( lon < overlayLatLonBox.west() && lon > overlayLatLonBox.toCircumscribedRectangle().west() ) ) {
265  centerLon -= 2 * M_PI;
266  }
267  }
268  }
269 
270  qreal rotatedLon = ( lon - centerLon ) * cosRotation - ( lat - centerLat ) * sinRotation + centerLon;
271  qreal rotatedLat = ( lon - centerLon ) * sinRotation + ( lat - centerLat ) * cosRotation + centerLat;
272 
273  GeoDataCoordinates::normalizeLonLat( rotatedLon, rotatedLat );
274 
275  if ( overlay->latLonBox().contains( GeoDataCoordinates( rotatedLon, rotatedLat ) ) ) {
276 
277  qreal px = ( GeoDataLatLonBox( 0, 0, rotatedLon, overlayLatLonBox.west() ).width() * lonToPixel );
278  qreal py = qreal( overlay->icon().height() ) - ( GeoDataLatLonBox( rotatedLat, overlayLatLonBox.south(), 0, 0 ).height() * latToPixel ) - 1;
279 
280  if ( px >= 0 && px < overlay->icon().width() && py >= 0 && py < overlay->icon().height() ) {
281  *scanLine = ImageF::pixelF( overlay->icon(), px, py );
282  }
283  }
284  }
285  }
286  }
287 }
288 
289 StackedTile *MergedLayerDecorator::loadTile( const TileId &stackedTileId )
290 {
291  const QVector<const GeoSceneTextureTile *> textureLayers = d->findRelevantTextureLayers( stackedTileId );
292  QVector<QSharedPointer<TextureTile> > tiles;
293 
294  foreach ( const GeoSceneTextureTile *layer, textureLayers ) {
295  const TileId tileId( layer->sourceDir(), stackedTileId.zoomLevel(),
296  stackedTileId.x(), stackedTileId.y() );
297 
298  mDebug() << Q_FUNC_INFO << layer->sourceDir() << tileId << layer->tileSize() << layer->fileFormat();
299 
300  // Blending (how to merge the images into an only image)
301  const Blending *blending = d->m_blendingFactory.findBlending( layer->blending() );
302  if ( blending == 0 && !layer->blending().isEmpty() ) {
303  mDebug() << Q_FUNC_INFO << "could not find blending" << layer->blending();
304  }
305 
306  const GeoSceneTextureTile *const textureLayer = static_cast<const GeoSceneTextureTile *>( layer );
307  const QImage tileImage = d->m_tileLoader->loadTileImage( textureLayer, tileId, DownloadBrowse );
308 
309  QSharedPointer<TextureTile> tile( new TextureTile( tileId, tileImage, blending ) );
310  tiles.append( tile );
311  }
312 
313  Q_ASSERT( !tiles.isEmpty() );
314 
315  return d->createTile( tiles );
316 }
317 
318 RenderState MergedLayerDecorator::renderState( const TileId &stackedTileId ) const
319 {
320  QString const nameTemplate = "Tile %1/%2/%3";
321  RenderState state( nameTemplate.arg( stackedTileId.zoomLevel() )
322  .arg( stackedTileId.x() )
323  .arg( stackedTileId.y() ) );
324  const QVector<const GeoSceneTextureTile *> textureLayers = d->findRelevantTextureLayers( stackedTileId );
325  foreach ( const GeoSceneTextureTile *layer, textureLayers ) {
326  const TileId tileId( layer->sourceDir(), stackedTileId.zoomLevel(),
327  stackedTileId.x(), stackedTileId.y() );
328  RenderStatus tileStatus = Complete;
329  switch ( TileLoader::tileStatus( layer, tileId ) ) {
330  case TileLoader::Available:
331  tileStatus = Complete;
332  break;
333  case TileLoader::Expired:
334  tileStatus = WaitingForUpdate;
335  break;
336  case TileLoader::Missing:
337  tileStatus = WaitingForData;
338  break;
339  }
340 
341  state.addChild( RenderState( layer->name(), tileStatus ) );
342  }
343 
344  return state;
345 }
346 
347 StackedTile *MergedLayerDecorator::updateTile( const StackedTile &stackedTile, const TileId &tileId, const QImage &tileImage )
348 {
349  Q_ASSERT( !tileImage.isNull() );
350 
351  d->detectMaxTileLevel();
352 
353  QVector<QSharedPointer<TextureTile> > tiles = stackedTile.tiles();
354 
355  for ( int i = 0; i < tiles.count(); ++ i) {
356  if ( tiles[i]->id() == tileId ) {
357  const Blending *blending = tiles[i]->blending();
358 
359  tiles[i] = QSharedPointer<TextureTile>( new TextureTile( tileId, tileImage, blending ) );
360  }
361  }
362 
363  return d->createTile( tiles );
364 }
365 
366 void MergedLayerDecorator::downloadStackedTile( const TileId &id, DownloadUsage usage )
367 {
368  const QVector<const GeoSceneTextureTile *> textureLayers = d->findRelevantTextureLayers( id );
369 
370  foreach ( const GeoSceneTextureTile *textureLayer, textureLayers ) {
371  if ( TileLoader::tileStatus( textureLayer, id ) != TileLoader::Available || usage == DownloadBrowse ) {
372  d->m_tileLoader->downloadTile( textureLayer, id, usage );
373  }
374  }
375 }
376 
377 void MergedLayerDecorator::setShowSunShading( bool show )
378 {
379  d->m_showSunShading = show;
380 }
381 
382 bool MergedLayerDecorator::showSunShading() const
383 {
384  return d->m_showSunShading;
385 }
386 
387 void MergedLayerDecorator::setShowCityLights( bool show )
388 {
389  d->m_showCityLights = show;
390 }
391 
392 bool MergedLayerDecorator::showCityLights() const
393 {
394  return d->m_showCityLights;
395 }
396 
397 void MergedLayerDecorator::setShowTileId( bool visible )
398 {
399  d->m_showTileId = visible;
400 }
401 
402 void MergedLayerDecorator::Private::paintSunShading( QImage *tileImage, const TileId &id ) const
403 {
404  if ( tileImage->depth() != 32 )
405  return;
406 
407  // TODO add support for 8-bit maps?
408  // add sun shading
409  const qreal global_width = tileImage->width()
410  * TileLoaderHelper::levelToColumn( m_levelZeroColumns, id.zoomLevel() );
411  const qreal global_height = tileImage->height()
412  * TileLoaderHelper::levelToRow( m_levelZeroRows, id.zoomLevel() );
413  const qreal lon_scale = 2*M_PI / global_width;
414  const qreal lat_scale = -M_PI / global_height;
415  const int tileHeight = tileImage->height();
416  const int tileWidth = tileImage->width();
417 
418  // First we determine the supporting point interval for the interpolation.
419  const int n = maxDivisor( 30, tileWidth );
420  const int ipRight = n * (int)( tileWidth / n );
421 
422  for ( int cur_y = 0; cur_y < tileHeight; ++cur_y ) {
423  const qreal lat = lat_scale * ( id.y() * tileHeight + cur_y ) - 0.5*M_PI;
424  const qreal a = sin( (lat+DEG2RAD * m_sunLocator->getLat() )/2.0 );
425  const qreal c = cos(lat)*cos( -DEG2RAD * m_sunLocator->getLat() );
426 
427  QRgb* scanline = (QRgb*)tileImage->scanLine( cur_y );
428 
429  qreal lastShade = -10.0;
430 
431  int cur_x = 0;
432 
433  while ( cur_x < tileWidth ) {
434 
435  const bool interpolate = ( cur_x != 0 && cur_x < ipRight && cur_x + n < tileWidth );
436 
437  qreal shade = 0;
438 
439  if ( interpolate ) {
440  const int check = cur_x + n;
441  const qreal checklon = lon_scale * ( id.x() * tileWidth + check );
442  shade = m_sunLocator->shading( checklon, a, c );
443 
444  // if the shading didn't change across the interpolation
445  // interval move on and don't change anything.
446  if ( shade == lastShade && shade == 1.0 ) {
447  scanline += n;
448  cur_x += n;
449  continue;
450  }
451  if ( shade == lastShade && shade == 0.0 ) {
452  for ( int t = 0; t < n; ++t ) {
453  m_sunLocator->shadePixel( *scanline, shade );
454  ++scanline;
455  }
456  cur_x += n;
457  continue;
458  }
459  for ( int t = 0; t < n ; ++t ) {
460  const qreal lon = lon_scale * ( id.x() * tileWidth + cur_x );
461  shade = m_sunLocator->shading( lon, a, c );
462  m_sunLocator->shadePixel( *scanline, shade );
463  ++scanline;
464  ++cur_x;
465  }
466  }
467 
468  else {
469  // Make sure we don't exceed the image memory
470  if ( cur_x < tileWidth ) {
471  const qreal lon = lon_scale * ( id.x() * tileWidth + cur_x );
472  shade = m_sunLocator->shading( lon, a, c );
473  m_sunLocator->shadePixel( *scanline, shade );
474  ++scanline;
475  ++cur_x;
476  }
477  }
478  lastShade = shade;
479  }
480  }
481 }
482 
483 void MergedLayerDecorator::Private::paintTileId( QImage *tileImage, const TileId &id ) const
484 {
485  QString filename = QString( "%1_%2.jpg" )
486  .arg( id.x(), tileDigits, 10, QChar('0') )
487  .arg( id.y(), tileDigits, 10, QChar('0') );
488 
489  QPainter painter( tileImage );
490 
491  QColor foreground;
492  QColor background;
493 
494  if ( ( (qreal)(id.x())/2 == id.x()/2 && (qreal)(id.y())/2 == id.y()/2 )
495  || ( (qreal)(id.x())/2 != id.x()/2 && (qreal)(id.y())/2 != id.y()/2 )
496  )
497  {
498  foreground.setNamedColor( "#FFFFFF" );
499  background.setNamedColor( "#000000" );
500  }
501  else {
502  foreground.setNamedColor( "#000000" );
503  background.setNamedColor( "#FFFFFF" );
504  }
505 
506  int strokeWidth = 10;
507  QPen testPen( foreground );
508  testPen.setWidth( strokeWidth );
509  testPen.setJoinStyle( Qt::MiterJoin );
510 
511  painter.setPen( testPen );
512  painter.drawRect( strokeWidth / 2, strokeWidth / 2,
513  tileImage->width() - strokeWidth,
514  tileImage->height() - strokeWidth );
515  QFont testFont( "Sans", 12 );
516  QFontMetrics testFm( testFont );
517  painter.setFont( testFont );
518 
519  QPen outlinepen( foreground );
520  outlinepen.setWidthF( 6 );
521 
522  painter.setPen( outlinepen );
523  painter.setBrush( background );
524 
525  QPainterPath outlinepath;
526 
527  QPointF baseline1( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
528  ( tileImage->height() * 0.25) );
529  outlinepath.addText( baseline1, testFont, QString( "level: %1" ).arg(id.zoomLevel()) );
530 
531  QPointF baseline2( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
532  tileImage->height() * 0.50 );
533  outlinepath.addText( baseline2, testFont, filename );
534 
535  QPointF baseline3( ( tileImage->width() - testFm.boundingRect(filename).width() ) / 2,
536  tileImage->height() * 0.75 );
537  outlinepath.addText( baseline3, testFont, m_themeId );
538 
539  painter.drawPath( outlinepath );
540 
541  painter.setPen( Qt::NoPen );
542  painter.drawPath( outlinepath );
543 }
544 
545 void MergedLayerDecorator::Private::detectMaxTileLevel()
546 {
547  if ( m_textureLayers.isEmpty() ) {
548  m_maxTileLevel = -1;
549  return;
550  }
551 
552  m_maxTileLevel = TileLoader::maximumTileLevel( *m_textureLayers.at( 0 ) );
553 }
554 
555 QVector<const GeoSceneTextureTile *> MergedLayerDecorator::Private::findRelevantTextureLayers( const TileId &stackedTileId ) const
556 {
557  QVector<const GeoSceneTextureTile *> result;
558 
559  foreach ( const GeoSceneTextureTile *candidate, m_textureLayers ) {
560  Q_ASSERT( candidate );
561  // check, if layer provides tiles for the current level
562  if ( !candidate->hasMaximumTileLevel() ||
563  candidate->maximumTileLevel() >= stackedTileId.zoomLevel() ) {
564  result.append( candidate );
565  }
566  }
567 
568  return result;
569 }
570 
571 // TODO: This should likely go into a math class in the future ...
572 
573 int MergedLayerDecorator::Private::maxDivisor( int maximum, int fullLength )
574 {
575  // Find the optimal interpolation interval n for the
576  // current image canvas width
577  int best = 2;
578 
579  int nEvalMin = fullLength;
580  for ( int it = 1; it <= maximum; ++it ) {
581  // The optimum is the interval which results in the least amount
582  // supporting points taking into account the rest which can't
583  // get used for interpolation.
584  int nEval = fullLength / it + fullLength % it;
585  if ( nEval < nEvalMin ) {
586  nEvalMin = nEval;
587  best = it;
588  }
589  }
590  return best;
591 }
QImage::scanLine
uchar * scanLine(int i)
TileLoader.h
GeoDataCoordinates.h
Marble::WaitingForData
Rendering is based on no or partial data, more data was requested (e.g. pending network queries) ...
Definition: MarbleGlobal.h:194
interpolate
void interpolate(MarbleWidget *widget, qreal value)
Definition: examples/cpp/animation-video/main.cpp:68
Marble::MergedLayerDecorator::showCityLights
bool showCityLights() const
Definition: MergedLayerDecorator.cpp:392
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:382
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:377
Marble::Blending
Definition: Blending.h:25
GeoDataGroundOverlay.h
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:164
QVector::append
void append(const T &value)
TextureTile.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
QChar
Marble::GeoSceneTiled::Projection
Projection
Definition: GeoSceneTiled.h:47
Marble::TileId::y
int y() const
Definition: TileId.h:67
QFont
Marble::MergedLayerDecorator::tileProjection
GeoSceneTextureTile::Projection tileProjection() const
Definition: MergedLayerDecorator.cpp:150
QImage::depth
int depth() const
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:166
SunLocator.h
QFontMetrics
QImage::isNull
bool isNull() const
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
QPainterPath::addText
void addText(const QPointF &point, const QFont &font, const QString &text)
BlendingFactory.h
Marble::GeoDataLatLonBox::contains
virtual bool contains(const GeoDataCoordinates &) const
Definition: GeoDataLatLonBox.cpp:309
QColor::setNamedColor
void setNamedColor(const QString &name)
QSharedPointer::data
T * data() const
MarbleDebug.h
Marble::GeoDataGroundOverlay::latLonBox
GeoDataLatLonBox & latLonBox() const
Definition: GeoDataGroundOverlay.cpp:97
Marble::MergedLayerDecorator::setTextureLayers
void setTextureLayers(const QVector< const GeoSceneTextureTile * > &textureLayers)
Definition: MergedLayerDecorator.cpp:99
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:157
Marble::MergedLayerDecorator::updateGroundOverlays
void updateGroundOverlays(const QList< const GeoDataGroundOverlay * > &groundOverlays)
Definition: MergedLayerDecorator.cpp:116
QPointF
Marble::GeoSceneAbstractDataset::name
QString name() const
Definition: GeoSceneAbstractDataset.cpp:38
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:94
Marble::GeoDataLatLonBox::east
qreal east(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the eastern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:135
Marble::TileLoader::Expired
Definition: TileLoader.h:51
Marble::GeoDataOverlay::icon
QImage icon() const
Definition: GeoDataOverlay.cpp:80
Marble::SunLocator
Definition: SunLocator.h:33
QSharedPointer
QImage::width
int width() const
Marble::MergedLayerDecorator::textureLayersSize
int textureLayersSize() const
Definition: MergedLayerDecorator.cpp:122
Marble::MergedLayerDecorator::tileRowCount
int tileRowCount(int level) const
Definition: MergedLayerDecorator.cpp:141
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:127
Marble::TileLoader::Missing
Definition: TileLoader.h:50
Marble::GeoDataLatLonBox::intersects
virtual bool intersects(const GeoDataLatLonBox &) const
Definition: GeoDataLatLonBox.cpp:385
QPainter
QString::isEmpty
bool isEmpty() const
QString
QList
Marble::GeoDataLatLonBox::rotation
qreal rotation(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the rotation of the bounding box.
Definition: GeoDataLatLonBox.cpp:190
Marble::RenderStatus
RenderStatus
Definition: MarbleGlobal.h:191
QColor
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
Marble::DEG2RAD
const qreal DEG2RAD
Definition: MarbleGlobal.h:219
Marble::RenderState
Definition: RenderState.h:22
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
QSize
MergedLayerDecorator.h
Marble::Complete
All data is there and up to date.
Definition: MarbleGlobal.h:192
QImage
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:132
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:347
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
QVector::at
const T & at(int i) const
Blending.h
Marble::TileId
Definition: TileId.h:27
QPainterPath
QVector
Marble::GeoSceneTiled::hasMaximumTileLevel
bool hasMaximumTileLevel() const
Definition: GeoSceneTiled.h:125
Marble::tileDigits
const int tileDigits
Definition: MarbleGlobal.h:253
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
QVector::isEmpty
bool isEmpty() const
ImageF.h
StackedTile.h
Marble::MergedLayerDecorator::loadTile
StackedTile * loadTile(const TileId &id)
Definition: MergedLayerDecorator.cpp:289
Marble::GeoDataLatLonBox::south
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:114
QVector::count
int count(const T &value) const
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
QPen
Marble::WaitingForUpdate
Rendering is based on complete, but outdated data, data update was requested.
Definition: MarbleGlobal.h:193
Marble::GeoSceneTextureTile
Definition: GeoSceneTextureTile.h:23
QImage::height
int height() const
Marble::MergedLayerDecorator::setShowCityLights
void setShowCityLights(bool show)
Definition: MergedLayerDecorator.cpp:387
Marble::MergedLayerDecorator::downloadStackedTile
void downloadStackedTile(const TileId &id, DownloadUsage usage)
Definition: MergedLayerDecorator.cpp:366
GeoSceneTextureTile.h
Marble::MergedLayerDecorator::d
Private *const d
Definition: MergedLayerDecorator.h:83
TileLoaderHelper.h
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:36
Marble::RenderState::addChild
void addChild(const RenderState &child)
Definition: RenderState.cpp:73
Marble::StackedTile::tiles
QVector< QSharedPointer< TextureTile > > tiles() const
Returns the stack of Tiles.
Definition: StackedTile.cpp:257
Marble::MergedLayerDecorator::setShowTileId
void setShowTileId(bool show)
Definition: MergedLayerDecorator.cpp:397
Marble::MergedLayerDecorator::renderState
RenderState renderState(const TileId &stackedTileId) const
Definition: MergedLayerDecorator.cpp:318
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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
  • 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