• 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
  • elevationprofilefloatitem
ElevationProfileFloatItem.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 2011-2012 Florian Eßer <f.esser@rwth-aachen.de>
9 // Copyright 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
10 //
11 
12 #ifndef ELEVATIONPROFILEFLOATITEM_H
13 #define ELEVATIONPROFILEFLOATITEM_H
14 
15 #include "AbstractFloatItem.h"
16 #include "DialogConfigurationInterface.h"
17 
18 #include "ElevationProfilePlotAxis.h"
19 
20 #include "GeoDataDocument.h"
21 #include "GeoDataLineString.h"
22 #include "GeoGraphicsItem.h"
23 #include "LabelGraphicsItem.h"
24 
25 
26 namespace Ui
27 {
28  class ElevationProfileConfigWidget;
29 }
30 
31 namespace Marble
32 {
33 
34 class GeoDataPlacemark;
35 class MarbleWidget;
36 class RoutingModel;
37 
43 class ElevationProfileFloatItem : public AbstractFloatItem, public DialogConfigurationInterface
44 {
45  Q_OBJECT
46  Q_PLUGIN_METADATA( IID "org.kde.edu.marble.ElevationProfileFloatItem" )
47 
48  Q_INTERFACES( Marble::RenderPluginInterface )
49  Q_INTERFACES( Marble::DialogConfigurationInterface )
50 
51  MARBLE_PLUGIN( ElevationProfileFloatItem )
52 
53  public:
54  ElevationProfileFloatItem();
55  explicit ElevationProfileFloatItem( const MarbleModel *marbleModel );
56  ~ElevationProfileFloatItem();
57 
58  virtual QStringList backendTypes() const;
59 
60  virtual qreal zValue() const; // Overriding LayerInterface to paint on top of the route
61 
62  virtual QString name() const;
63 
64  virtual QString guiString() const;
65 
66  virtual QString nameId() const;
67 
68  virtual QString version() const;
69 
70  virtual QString description() const;
71 
72  virtual QString copyrightYears() const;
73 
74  virtual QList<PluginAuthor> pluginAuthors() const;
75 
76  virtual QIcon icon() const;
77 
78  virtual void initialize();
79 
80  virtual bool isInitialized() const;
81 
82  virtual void changeViewport( ViewportParams *viewport );
83 
84  virtual void paintContent( QPainter *painter );
85 
86  QDialog *configDialog();
87 
88  protected:
89  bool eventFilter( QObject *object, QEvent *e );
90  virtual void contextMenuEvent( QWidget *w, QContextMenuEvent *e );
91 
92  private Q_SLOTS:
93  void updateData();
94  void updateVisiblePoints();
95  void forceRepaint();
96  void readSettings();
97  void writeSettings();
98  void toggleZoomToViewport();
99 
100  Q_SIGNALS:
101  void dataUpdated();
102 
103  private:
104  QDialog *m_configDialog;
105  Ui::ElevationProfileConfigWidget *ui_configWidget;
106 
107  int m_leftGraphMargin;
108  int m_eleGraphWidth;
109  qreal m_viewportWidth;
110  qreal m_eleGraphHeight;
111  qreal m_shrinkFactorY;
112 
113  int m_fontHeight;
114 
115  ElevationProfilePlotAxis m_axisX;
116  ElevationProfilePlotAxis m_axisY;
117 
118  GeoDataDocument m_markerDocument;
119  GeoDataPlacemark *const m_markerPlacemark;
120  int m_documentIndex;
121 
122  qreal m_cursorPositionX;
123 
124  bool m_isInitialized;
125 
126  QMenu* m_contextMenu;
127 
128  MarbleWidget* m_marbleWidget;
129  const RoutingModel* m_routingModel;
130  bool m_routeAvailable;
131 
132  int m_firstVisiblePoint;
133  int m_lastVisiblePoint;
134  bool m_zoomToViewport;
135  QList<QPointF> m_eleData;
136  GeoDataLineString m_points;
137  qreal m_minElevation;
138  qreal m_maxElevation;
139  qreal m_gain;
140  qreal m_loss;
141 
142  QList<QPointF> calculateElevationData( const GeoDataLineString &lineString ) const;
143  void calculateStatistics( const QList<QPointF> &eleData );
144 };
145 
146 
147 }
148 
149 #endif // ELEVATIONPROFILEFLOATITEM_H
QPainter
GeoDataDocument.h
Marble::ElevationProfileFloatItem::backendTypes
virtual QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: ElevationProfileFloatItem.cpp:87
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::ElevationProfileFloatItem::nameId
virtual QString nameId() const
Returns the unique name of the plugin.
Definition: ElevationProfileFloatItem.cpp:107
LabelGraphicsItem.h
Marble::ElevationProfileFloatItem::pluginAuthors
virtual QList< PluginAuthor > pluginAuthors() const
Definition: ElevationProfileFloatItem.cpp:127
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
QDialog
Marble::ElevationProfileFloatItem::zValue
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: ElevationProfileFloatItem.cpp:92
Marble::ElevationProfilePlotAxis
A helper class handling a plot axis for the Elevation Profile.
Definition: ElevationProfilePlotAxis.h:37
AbstractFloatItem.h
QWidget
QObject
Marble::ElevationProfileFloatItem::ElevationProfileFloatItem
ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:36
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
Marble::ElevationProfileFloatItem::paintContent
virtual void paintContent(QPainter *painter)
Here the items paint their content.
Definition: ElevationProfileFloatItem.cpp:182
Marble::ElevationProfileFloatItem::contextMenuEvent
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: ElevationProfileFloatItem.cpp:405
Marble::ElevationProfileFloatItem::copyrightYears
virtual QString copyrightYears() const
Definition: ElevationProfileFloatItem.cpp:122
Marble::ElevationProfileFloatItem::description
virtual QString description() const
Returns a user description of the plugin.
Definition: ElevationProfileFloatItem.cpp:117
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
GeoDataLineString.h
DialogConfigurationInterface.h
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::RoutingModel
Definition: RoutingModel.h:34
GeoGraphicsItem.h
Marble::ElevationProfileFloatItem::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: ElevationProfileFloatItem.cpp:427
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::ElevationProfileFloatItem::changeViewport
virtual void changeViewport(ViewportParams *viewport)
Definition: ElevationProfileFloatItem.cpp:160
Marble::ElevationProfileFloatItem::initialize
virtual void initialize()
Definition: ElevationProfileFloatItem.cpp:139
Marble::ElevationProfileFloatItem::version
virtual QString version() const
Definition: ElevationProfileFloatItem.cpp:112
Marble::ElevationProfileFloatItem::isInitialized
virtual bool isInitialized() const
Definition: ElevationProfileFloatItem.cpp:155
Marble::ElevationProfileFloatItem::dataUpdated
void dataUpdated()
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
Marble::ElevationProfileFloatItem::name
virtual QString name() const
Returns the user-visible name of the plugin.
Definition: ElevationProfileFloatItem.cpp:97
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:81
Marble::ElevationProfileFloatItem::~ElevationProfileFloatItem
~ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:83
Marble::ElevationProfileFloatItem::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: ElevationProfileFloatItem.cpp:387
Marble::ElevationProfileFloatItem::icon
virtual QIcon icon() const
Returns an icon for the plugin.
Definition: ElevationProfileFloatItem.cpp:134
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::ElevationProfileFloatItem::guiString
virtual QString guiString() const
String that should be displayed in GUI.
Definition: ElevationProfileFloatItem.cpp:102
Marble::ElevationProfileFloatItem
The class that creates an interactive elvation profile.
Definition: ElevationProfileFloatItem.h:43
ElevationProfilePlotAxis.h
MARBLE_PLUGIN
#define MARBLE_PLUGIN(T)
Definition: RenderPlugin.h:337
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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