• 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
  • layers
GroundLayer.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2012 Cezar Mocan <mocancezar@gmail.com>
9 //
10 
11 #include "GroundLayer.h"
12 
13 #include "GeoPainter.h"
14 #include "ViewportParams.h"
15 
16 namespace Marble
17 {
18 
19 GroundLayer::GroundLayer()
20  : m_color( QColor( 153, 179, 204 ) )
21 {
22 }
23 
24 GroundLayer::~GroundLayer()
25 {
26 }
27 
28 QStringList GroundLayer::renderPosition() const
29 {
30  return QStringList() << "SURFACE";
31 }
32 
33 bool GroundLayer::render( GeoPainter *painter,
34  ViewportParams *viewParams,
35  const QString &renderPos,
36  GeoSceneLayer *layer )
37 {
38  Q_UNUSED( renderPos )
39  Q_UNUSED( layer )
40 
41  QBrush backgroundBrush( m_color );
42  QPen backgroundPen( Qt::NoPen );
43 
44  painter->setBrush( backgroundBrush );
45  painter->setPen( backgroundPen );
46  painter->drawPath( viewParams->mapShape() );
47 
48  return true;
49 }
50 
51 qreal GroundLayer::zValue() const
52 {
53  return -50.0;
54 }
55 
56 void GroundLayer::setColor( const QColor &color )
57 {
58  m_color = color;
59 }
60 
61 QColor GroundLayer::color() const
62 {
63  return m_color;
64 }
65 
66 RenderState GroundLayer::renderState() const
67 {
68  return RenderState( "Ground" );
69 }
70 
71 }
Marble::GroundLayer::color
QColor color() const
Definition: GroundLayer.cpp:61
Marble::GroundLayer::render
virtual bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos="NONE", GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
Definition: GroundLayer.cpp:33
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
QBrush
Marble::GroundLayer::renderPosition
virtual QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: GroundLayer.cpp:28
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
GroundLayer.h
QPainter::setPen
void setPen(const QColor &color)
Marble::GroundLayer::renderState
RenderState renderState() const
Definition: GroundLayer.cpp:66
QPainter::setBrush
void setBrush(const QBrush &brush)
QString
QColor
GeoPainter.h
Marble::RenderState
Definition: RenderState.h:22
Marble::GroundLayer::zValue
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: GroundLayer.cpp:51
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::GroundLayer::GroundLayer
GroundLayer()
Definition: GroundLayer.cpp:19
Marble::GroundLayer::setColor
void setColor(const QColor &color)
Definition: GroundLayer.cpp:56
Marble::ViewportParams::mapShape
QPainterPath mapShape() const
Definition: ViewportParams.cpp:403
QPainter::drawPath
void drawPath(const QPainterPath &path)
Marble::GroundLayer::~GroundLayer
~GroundLayer()
Definition: GroundLayer.cpp:24
QPen
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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