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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • layers
MarbleSplashLayer.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 2008-2009 Torsten Rahn <tackat@kde.org>
9 // Copyright 2009 Jens-Michael Hoffmann <jensmh@gmx.de>
10 // Copyright 2011 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
11 //
12 
13 // Own
14 #include "MarbleSplashLayer.h"
15 
16 #include "GeoPainter.h"
17 #include "MarbleDirs.h"
18 #include "ViewportParams.h"
19 
20 #include <QPixmap>
21 
22 namespace Marble
23 {
24 
25 MarbleSplashLayer::MarbleSplashLayer()
26 {
27 }
28 
29 QStringList MarbleSplashLayer::renderPosition() const
30 {
31  return QStringList() << "SURFACE";
32 }
33 
34 bool MarbleSplashLayer::render( GeoPainter *painter, ViewportParams *viewport,
35  const QString &renderPos, GeoSceneLayer *layer )
36 {
37  Q_UNUSED( renderPos );
38  Q_UNUSED( layer );
39 
40  painter->save();
41 
42  QPixmap logoPixmap( MarbleDirs::path( "svg/marble-logo-inverted-72dpi.png" ) );
43 
44  if ( logoPixmap.width() > viewport->width() * 0.7
45  || logoPixmap.height() > viewport->height() * 0.7 )
46  {
47  logoPixmap = logoPixmap.scaled( QSize( viewport->width(), viewport->height() ) * 0.7,
48  Qt::KeepAspectRatio, Qt::SmoothTransformation );
49  }
50 
51  QPoint logoPosition( ( viewport->width() - logoPixmap.width() ) / 2,
52  ( viewport->height() - logoPixmap.height() ) / 2 );
53  painter->drawPixmap( logoPosition, logoPixmap );
54 
55  QString message; // "Please assign a map theme!";
56 
57  painter->setPen( Qt::white );
58 
59  int yTop = logoPosition.y() + logoPixmap.height() + 10;
60  QRect textRect( 0, yTop,
61  viewport->width(), viewport->height() - yTop );
62  painter->drawText( textRect, Qt::AlignHCenter | Qt::AlignTop, message );
63 
64  painter->restore();
65 
66  return true;
67 }
68 
69 
70 }
Marble::MarbleSplashLayer::render
virtual bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos="SURFACE", GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
Definition: MarbleSplashLayer.cpp:34
Marble::MarbleSplashLayer::MarbleSplashLayer
MarbleSplashLayer()
Definition: MarbleSplashLayer.cpp:25
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:53
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::ViewportParams::height
int height() const
Definition: ViewportParams.cpp:255
MarbleSplashLayer.h
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
Marble::ViewportParams::width
int width() const
Definition: ViewportParams.cpp:250
MarbleDirs.h
GeoPainter.h
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::GeoPainter::drawText
void drawText(const GeoDataCoordinates &position, const QString &text)
Draws the given text at a given geographic position. The text is drawn starting at the given position...
Definition: GeoPainter.cpp:264
Marble::MarbleSplashLayer::renderPosition
virtual QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: MarbleSplashLayer.cpp:29
Marble::GeoPainter::drawPixmap
void drawPixmap(const GeoDataCoordinates &centerPosition, const QPixmap &pixmap)
Draws a pixmap at the given position. The pixmap is placed with its center located at the given cente...
Definition: GeoPainter.cpp:452
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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