Marble

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

KDE's Doxygen guidelines are available online.