• 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
  • examples
  • cpp
  • geopainter
examples/cpp/geopainter/main.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 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #include <QApplication>
12 #include <marble/MarbleWidget.h>
13 #include <marble/GeoPainter.h>
14 
15 using namespace Marble;
16 
17 class MyMarbleWidget : public MarbleWidget
18 {
19 public:
20  virtual void customPaint(GeoPainter* painter);
21 };
22 
23 void MyMarbleWidget::customPaint(GeoPainter* painter)
24 {
25  GeoDataCoordinates home(8.4, 49.0, 0.0, GeoDataCoordinates::Degree);
26  painter->setPen(Qt::green);
27  painter->drawEllipse(home, 7, 7);
28  painter->setPen(Qt::black);
29  painter->drawText(home, "Hello Marble!");
30 }
31 
32 int main(int argc, char** argv)
33 {
34  QApplication app(argc,argv);
35  MyMarbleWidget *mapWidget = new MyMarbleWidget;
36  mapWidget->setMapThemeId("earth/openstreetmap/openstreetmap.dgml");
37  mapWidget->show();
38  return app.exec();
39 }
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::GeoPainter::drawEllipse
void drawEllipse(const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false)
Draws an ellipse at the given position. The ellipse is placed with its center located at the given ce...
Definition: GeoPainter.cpp:289
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
GeoPainter.h
main
int main(int argc, char **argv)
Definition: examples/cpp/geopainter/main.cpp:32
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
MarbleWidget.h
This file contains the headers for MarbleWidget.
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