Marble

GroundLayer.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Cezar Mocan <mocancezar@gmail.com>
4//
5
6#include "GroundLayer.h"
7
8#include "GeoPainter.h"
9#include "RenderState.h"
10#include "ViewportParams.h"
11
12namespace Marble
13{
14
15GroundLayer::GroundLayer()
16 : m_color(QColor(153, 179, 204))
17{
18}
19
20GroundLayer::~GroundLayer() = default;
21
22QStringList GroundLayer::renderPosition() const
23{
24 return QStringList(QStringLiteral("SURFACE"));
25}
26
27bool GroundLayer::render(GeoPainter *painter, ViewportParams *viewParams, const QString &renderPos, GeoSceneLayer *layer)
28{
29 Q_UNUSED(renderPos)
30 Q_UNUSED(layer)
31
32 QBrush backgroundBrush(m_color);
33 QPen backgroundPen(Qt::NoPen);
34
35 painter->setBrush(backgroundBrush);
36 painter->setPen(backgroundPen);
37 painter->drawPath(viewParams->mapShape());
38
39 return true;
40}
41
42qreal GroundLayer::zValue() const
43{
44 return -50.0;
45}
46
47void GroundLayer::setColor(const QColor &color)
48{
49 m_color = color;
50}
51
52QColor GroundLayer::color() const
53{
54 return m_color;
55}
56
57RenderState GroundLayer::renderState() const
58{
59 return RenderState(QStringLiteral("Ground"));
60}
61
62}
This file contains the headers for ViewportParams.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.