Marble
MergedLayerDecorator.cpp
40 void renderGroundOverlays(QImage *tileImage, const QList<QSharedPointer<TextureTile>> &tiles) const;
45 QList<const GeoSceneTextureTileDataset *> findRelevantTextureLayers(const TileId &stackedTileId) const;
76MergedLayerDecorator::MergedLayerDecorator(TileLoader *const tileLoader, const SunLocator *sunLocator)
86void MergedLayerDecorator::setTextureLayers(const QList<const GeoSceneTextureTileDataset *> &textureLayers)
101void MergedLayerDecorator::updateGroundOverlays(const QList<const GeoDataGroundOverlay *> &groundOverlays)
148StackedTile *MergedLayerDecorator::Private::createTile(const QList<QSharedPointer<TextureTile>> &tiles) const
160 const bool withConversion = tiles.count() > 1 || m_showSunShading || m_showTileId || !m_groundOverlays.isEmpty();
197void MergedLayerDecorator::Private::renderGroundOverlays(QImage *tileImage, const QList<QSharedPointer<TextureTile>> &tiles) const
202 const GeoDataLatLonBox tileLatLonBox = findRelevantTextureLayers(tileId).first()->tileProjection()->geoCoordinates(tileId);
223 const qreal global_height = tileImage->height() * TileLoaderHelper::levelToRow(m_levelZeroRows, tileId.zoomLevel());
228 const bool isMercatorTileProjection = (m_textureLayers.at(0)->tileProjectionType() == GeoSceneAbstractTileProjection::Mercator);
233 const qreal lat = isMercatorTileProjection ? gd(2 * (latPixelPosition - y) * pixel2Rad) : tileLatLonBox.north() - y * pixelToLat;
244 rotatedCoords = coords.rotateAround(overlayLatLonBox.center(), -overlay->latLonBox().rotation());
250 qreal px = GeoDataLatLonBox::width(rotatedCoords.longitude(), overlayLatLonBox.west()) * lonToPixel;
252 (qreal)(overlay->icon().height()) - (GeoDataLatLonBox::height(rotatedCoords.latitude(), overlayLatLonBox.south()) * latToPixel) - 1;
276 const QList<const GeoSceneTextureTileDataset *> textureLayers = d->findRelevantTextureLayers(stackedTileId);
281 const TileId tileId(layer->sourceDir(), stackedTileId.zoomLevel(), stackedTileId.x(), stackedTileId.y());
291 const GeoSceneTextureTileDataset *const textureLayer = static_cast<const GeoSceneTextureTileDataset *>(layer);
306 RenderState state(nameTemplate.arg(stackedTileId.zoomLevel()).arg(stackedTileId.x()).arg(stackedTileId.y()));
307 const QList<const GeoSceneTextureTileDataset *> textureLayers = d->findRelevantTextureLayers(stackedTileId);
309 const TileId tileId(layer->sourceDir(), stackedTileId.zoomLevel(), stackedTileId.x(), stackedTileId.y());
334StackedTile *MergedLayerDecorator::updateTile(const StackedTile &stackedTile, const TileId &tileId, const QImage &tileImage)
355 const QList<const GeoSceneTextureTileDataset *> textureLayers = d->findRelevantTextureLayers(id);
358 if (textureLayer->tileLevels().isEmpty() || textureLayer->tileLevels().contains(id.zoomLevel())) {
359 if (TileLoader::tileStatus(textureLayer, id) != TileLoader::Available || usage == DownloadBrowse) {
398 const qreal global_width = tileImage->width() * TileLoaderHelper::levelToColumn(m_levelZeroColumns, id.zoomLevel());
399 const qreal global_height = tileImage->height() * TileLoaderHelper::levelToRow(m_levelZeroRows, id.zoomLevel());
471 QString filename = QStringLiteral("%1_%2.jpg").arg(id.x(), tileDigits, 10, QLatin1Char('0')).arg(id.y(), tileDigits, 10, QLatin1Char('0'));
478 if (((qreal)(id.x()) / 2 == id.x() / 2 && (qreal)(id.y()) / 2 == id.y() / 2) || ((qreal)(id.x()) / 2 != id.x() / 2 && (qreal)(id.y()) / 2 != id.y() / 2)) {
492 painter.drawRect(strokeWidth / 2, strokeWidth / 2, tileImage->width() - strokeWidth, tileImage->height() - strokeWidth);
505 QPointF baseline1((tileImage->width() - testFm.boundingRect(filename).width()) / 2, (tileImage->height() * 0.25));
508 QPointF baseline2((tileImage->width() - testFm.boundingRect(filename).width()) / 2, tileImage->height() * 0.50);
511 QPointF baseline3((tileImage->width() - testFm.boundingRect(filename).width()) / 2, tileImage->height() * 0.75);
530QList<const GeoSceneTextureTileDataset *> MergedLayerDecorator::Private::findRelevantTextureLayers(const TileId &stackedTileId) const
537 if (!candidate->hasMaximumTileLevel() || candidate->maximumTileLevel() >= stackedTileId.zoomLevel()) {
static qreal normalizeLon(qreal lon, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize the longitude to always be -M_PI <= lon <= +M_PI (Radian).
Definition GeoDataCoordinates.cpp:238
bool isGloballyVisible() const
Return whether this feature is visible or not in the context of its parenting.
Definition GeoDataFeature.cpp:350
A class that defines a 2D bounding box for geographic data.
Definition GeoDataLatLonBox.h:45
qreal north(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the northern boundary of the bounding box.
Definition GeoDataLatLonBox.cpp:80
qreal height(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the height of the latitude interval.
Definition GeoDataLatLonBox.cpp:268
GeoDataLatLonBox toCircumscribedRectangle() const
Definition GeoDataLatLonBox.cpp:511
qreal width(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the width of the longitude interval.
Definition GeoDataLatLonBox.cpp:246
qreal west(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the western boundary of the bounding box.
Definition GeoDataLatLonBox.cpp:143
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition GeoDataLatLonBox.cpp:101
qreal rotation(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the rotation of the bounding box.
Definition GeoDataLatLonBox.cpp:177
virtual GeoDataCoordinates center() const
returns the center of this box
Definition GeoDataLatLonBox.cpp:294
A base class for projections between tile indizes and geo coordinates in Marble.
Definition GeoSceneAbstractTileProjection.h:30
A single tile that consists of a stack of Tile layers.
Definition StackedTile.h:51
QList< QSharedPointer< TextureTile > > tiles() const
Returns the stack of Tiles.
Definition StackedTile.cpp:308
KGUIADDONS_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount=0.0)
Binds a QML item to a specific geodetic location in screen coordinates.
Definition AbstractDataPlugin.cpp:23
qreal gdInv(qreal x)
This method is a fast Mac Laurin power series approximation of the.
Definition MarbleMath.h:71
@ DownloadBrowse
Browsing mode, normal operation of Marble, like a web browser.
Definition MarbleGlobal.h:154
@ WaitingForData
Rendering is based on no or partial data, more data was requested (e.g. pending network queries)
Definition MarbleGlobal.h:182
@ WaitingForUpdate
Rendering is based on complete, but outdated data, data update was requested.
Definition MarbleGlobal.h:181
Format_ARGB32_Premultiplied
QImage convertToFormat(Format format, Qt::ImageConversionFlags flags) &&
QImage copy(const QRect &rectangle) const const
int depth() const const
int height() const const
bool isNull() const const
QRgb pixel(const QPoint &position) const const
uchar * scanLine(int i)
int width() const const
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
bool contains(const AT &value) const const
qsizetype count() const const
bool isEmpty() const const
void reserve(qsizetype size)
qsizetype size() const const
void addText(const QPointF &point, const QFont &font, const QString &text)
QString arg(Args &&... args) const const
white
MiterJoin
NoPen
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.