• 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
  • plugins
  • render
  • graticule
GraticulePlugin.h
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 2009 Torsten Rahn <tackat@kde.org>
9 //
10 
11 //
12 // This class is a graticule plugin.
13 //
14 
15 #ifndef MARBLEGRATICULEPLUGIN_H
16 #define MARBLEGRATICULEPLUGIN_H
17 
18 #include <QMap>
19 #include <QObject>
20 #include <QVector>
21 #include <QHash>
22 #include <QPen>
23 #include <QIcon>
24 #include <QColorDialog>
25 #include <QAbstractButton>
26 
27 
28 #include "DialogConfigurationInterface.h"
29 #include "RenderPlugin.h"
30 #include "RenderPluginInterface.h"
31 
32 
33 #include "GeoDataCoordinates.h"
34 #include "GeoDataLatLonAltBox.h"
35 
36 
37 namespace Ui
38 {
39  class GraticuleConfigWidget;
40 }
41 
42 namespace Marble
43 {
44 
45 class GeoDataLatLonAltBox;
46 
54 class GraticulePlugin : public RenderPlugin, public DialogConfigurationInterface
55 {
56  Q_OBJECT
57  Q_PLUGIN_METADATA( IID "org.kde.edu.marble.GraticulePlugin" )
58  Q_INTERFACES( Marble::RenderPluginInterface )
59  Q_INTERFACES( Marble::DialogConfigurationInterface )
60  MARBLE_PLUGIN( GraticulePlugin )
61 
62  public:
63  GraticulePlugin();
64 
65  explicit GraticulePlugin( const MarbleModel *marbleModel );
66 
67  QStringList backendTypes() const;
68 
69  QString renderPolicy() const;
70 
71  QStringList renderPosition() const;
72 
73  QString name() const;
74 
75  QString guiString() const;
76 
77  QString nameId() const;
78 
79  QString version() const;
80 
81  QString description() const;
82 
83  QString copyrightYears() const;
84 
85  QList<PluginAuthor> pluginAuthors() const;
86 
87  QIcon icon () const;
88 
89  QDialog *configDialog();
90 
91  void initialize ();
92 
93  bool isInitialized () const;
94 
95  virtual bool render( GeoPainter *painter, ViewportParams *viewport, const QString& renderPos, GeoSceneLayer * layer = 0 );
96 
97  virtual qreal zValue() const;
98 
99  virtual QHash<QString,QVariant> settings() const;
100 
101  virtual void setSettings( const QHash<QString,QVariant> &settings );
102 
103 
104 
105  public Q_SLOTS:
106  void readSettings();
107  void writeSettings();
108 
109  void gridGetColor();
110  void tropicsGetColor();
111  void equatorGetColor();
112 
113 
114  private:
120  void renderGrid( GeoPainter *painter, ViewportParams *viewport,
121  const QPen& equatorCirclePen,
122  const QPen& tropicsCirclePen,
123  const QPen& gridCirclePen );
124 
131  void renderLatitudeLine( GeoPainter *painter, qreal latitude,
132  const GeoDataLatLonAltBox& viewLatLonAltBox = GeoDataLatLonAltBox(),
133  const QString& lineLabel = QString(),
134  LabelPositionFlags labelPositionFlags = LineCenter );
135 
147  void renderLongitudeLine( GeoPainter *painter, qreal longitude,
148  const GeoDataLatLonAltBox& viewLatLonAltBox = GeoDataLatLonAltBox(),
149  qreal northPolarGap = 0.0, qreal southPolarGap = 0.0,
150  const QString& lineLabel = QString(),
151  LabelPositionFlags labelPositionFlags = LineCenter );
152 
159  void renderLatitudeLines( GeoPainter *painter,
160  const GeoDataLatLonAltBox& viewLatLonAltBox,
161  qreal step,
162  LabelPositionFlags labelPositionFlags = LineCenter
163  );
164 
179  void renderLongitudeLines( GeoPainter *painter,
180  const GeoDataLatLonAltBox& viewLatLonAltBox,
181  qreal step,
182  qreal northPolarGap = 0.0, qreal southPolarGap = 0.0,
183  LabelPositionFlags labelPositionFlags = LineCenter
184  );
185 
200  void renderUtmExceptions( GeoPainter *painter,
201  const GeoDataLatLonAltBox& viewLatLonAltBox,
202  qreal step,
203  qreal northPolarGap, qreal southPolarGap,
204  const QString & label,
205  LabelPositionFlags labelPositionFlags
206  );
207 
212  void initLineMaps( GeoDataCoordinates::Notation notation );
213 
214  GeoDataCoordinates::Notation m_currentNotation;
215 
216  // Maps the zoom factor to the amount of lines per 360 deg
217  QMap<qreal,qreal> m_boldLineMap;
218  QMap<qreal,qreal> m_normalLineMap;
219 
220  QPen m_equatorCirclePen;
221  QPen m_tropicsCirclePen;
222  QPen m_gridCirclePen;
223  bool m_showPrimaryLabels;
224  bool m_showSecondaryLabels;
225 
226  bool m_isInitialized;
227 
228  QIcon m_icon;
229 
230  Ui::GraticuleConfigWidget *ui_configWidget;
231  QDialog *m_configDialog;
232 };
233 
234 }
235 
236 #endif // MARBLEGRATICULEPLUGIN_H
GeoDataCoordinates.h
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
Marble::GraticulePlugin::readSettings
void readSettings()
Definition: GraticulePlugin.cpp:195
Marble::GraticulePlugin::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: GraticulePlugin.cpp:112
RenderPluginInterface.h
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
Marble::GraticulePlugin::equatorGetColor
void equatorGetColor()
Definition: GraticulePlugin.cpp:238
QDialog
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::GraticulePlugin::version
QString version() const
Definition: GraticulePlugin.cpp:91
Marble::GraticulePlugin::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: GraticulePlugin.cpp:161
Marble::GraticulePlugin::tropicsGetColor
void tropicsGetColor()
Definition: GraticulePlugin.cpp:227
Marble::GraticulePlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: GraticulePlugin.cpp:86
Marble::GraticulePlugin::gridGetColor
void gridGetColor()
Definition: GraticulePlugin.cpp:216
Marble::GraticulePlugin::zValue
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: GraticulePlugin.cpp:293
Marble::GraticulePlugin::initialize
void initialize()
Definition: GraticulePlugin.cpp:117
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
Marble::GraticulePlugin::backendTypes
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: GraticulePlugin.cpp:61
Marble::GraticulePlugin
A plugin that creates a coordinate grid on top of the map.
Definition: GraticulePlugin.h:54
Marble::GraticulePlugin::description
QString description() const
Returns a user description of the plugin.
Definition: GraticulePlugin.cpp:96
Marble::LineCenter
Definition: MarbleGlobal.h:111
DialogConfigurationInterface.h
Marble::GraticulePlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: GraticulePlugin.cpp:106
Marble::GraticulePlugin::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: GraticulePlugin.cpp:174
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::GraticulePlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: GraticulePlugin.cpp:76
Marble::GraticulePlugin::renderPosition
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: GraticulePlugin.cpp:71
Marble::GraticulePlugin::GraticulePlugin
GraticulePlugin()
Definition: GraticulePlugin.cpp:41
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::GraticulePlugin::renderPolicy
QString renderPolicy() const
Return how the plugin settings should be used.
Definition: GraticulePlugin.cpp:66
Marble::GeoDataCoordinates::Notation
Notation
enum used to specify the notation / numerical system
Definition: GeoDataCoordinates.h:79
Marble::GraticulePlugin::render
virtual bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
Definition: GraticulePlugin.cpp:260
Marble::GraticulePlugin::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: GraticulePlugin.cpp:81
Marble::GraticulePlugin::copyrightYears
QString copyrightYears() const
Definition: GraticulePlugin.cpp:101
GeoDataLatLonAltBox.h
RenderPlugin.h
Marble::GraticulePlugin::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: GraticulePlugin.cpp:131
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:81
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
Marble::GraticulePlugin::isInitialized
bool isInitialized() const
Definition: GraticulePlugin.cpp:126
MARBLE_PLUGIN
#define MARBLE_PLUGIN(T)
Definition: RenderPlugin.h:337
Marble::GraticulePlugin::writeSettings
void writeSettings()
Definition: GraticulePlugin.cpp:249
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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