• 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
  • 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  explicit ElevationProfileFloatItem( const MarbleModel *marbleModel = 0 );
55  ~ElevationProfileFloatItem();
56 
57  virtual QStringList backendTypes() const;
58 
59  virtual qreal zValue() const; // Overriding LayerInterface to paint on top of the route
60 
61  virtual QString name() const;
62 
63  virtual QString guiString() const;
64 
65  virtual QString nameId() const;
66 
67  virtual QString version() const;
68 
69  virtual QString description() const;
70 
71  virtual QString copyrightYears() const;
72 
73  virtual QList<PluginAuthor> pluginAuthors() const;
74 
75  virtual QIcon icon() const;
76 
77  virtual void initialize();
78 
79  virtual bool isInitialized() const;
80 
81  virtual void setProjection( const ViewportParams *viewport );
82 
83  virtual void paintContent( QPainter *painter );
84 
85  QDialog *configDialog();
86 
87  protected:
88  bool eventFilter( QObject *object, QEvent *e );
89  virtual void contextMenuEvent( QWidget *w, QContextMenuEvent *e );
90 
91  private Q_SLOTS:
92  void updateData();
93  void updateVisiblePoints();
94  void forceRepaint();
95  void readSettings();
96  void writeSettings();
97  void toggleZoomToViewport();
98 
99  Q_SIGNALS:
100  void dataUpdated();
101 
102  private:
103  QDialog *m_configDialog;
104  Ui::ElevationProfileConfigWidget *ui_configWidget;
105 
106  int m_leftGraphMargin;
107  int m_eleGraphWidth;
108  qreal m_viewportWidth;
109  qreal m_eleGraphHeight;
110  qreal m_shrinkFactorY;
111 
112  int m_fontHeight;
113 
114  ElevationProfilePlotAxis m_axisX;
115  ElevationProfilePlotAxis m_axisY;
116 
117  GeoDataDocument m_markerDocument;
118  GeoDataPlacemark *const m_markerPlacemark;
119  int m_documentIndex;
120 
121  qreal m_cursorPositionX;
122 
123  bool m_isInitialized;
124 
125  QMenu* m_contextMenu;
126 
127  MarbleWidget* m_marbleWidget;
128  const RoutingModel* m_routingModel;
129  bool m_routeAvailable;
130 
131  int m_firstVisiblePoint;
132  int m_lastVisiblePoint;
133  bool m_zoomToViewport;
134  QList<QPointF> m_eleData;
135  GeoDataLineString m_points;
136  qreal m_minElevation;
137  qreal m_maxElevation;
138  qreal m_gain;
139  qreal m_loss;
140 
141  QList<QPointF> calculateElevationData( const GeoDataLineString &lineString ) const;
142  void calculateStatistics( const QList<QPointF> &eleData );
143 };
144 
145 
146 }
147 
148 #endif // ELEVATIONPROFILEFLOATITEM_H
GeoDataDocument.h
QEvent
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:81
Marble::RenderPluginInterface
The class that specifies the Marble layer interface of a plugin.
Definition: RenderPluginInterface.h:30
QWidget
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Marble::ElevationProfileFloatItem::nameId
virtual QString nameId() const
Returns the unique name of the plugin.
Definition: ElevationProfileFloatItem.cpp:101
LabelGraphicsItem.h
Marble::ElevationProfileFloatItem::pluginAuthors
virtual QList< PluginAuthor > pluginAuthors() const
Definition: ElevationProfileFloatItem.cpp:121
Marble::DialogConfigurationInterface
This interface allows a plugin to provide a QWidget-based configuration dialog which is accessible wi...
Definition: DialogConfigurationInterface.h:31
Marble::ElevationProfileFloatItem::zValue
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: ElevationProfileFloatItem.cpp:86
Marble::ElevationProfilePlotAxis
A helper class handling a plot axis for the Elevation Profile.
Definition: ElevationProfilePlotAxis.h:37
AbstractFloatItem.h
Marble::ElevationProfileFloatItem::setProjection
virtual void setProjection(const ViewportParams *viewport)
Definition: ElevationProfileFloatItem.cpp:154
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
Marble::ElevationProfileFloatItem::paintContent
virtual void paintContent(QPainter *painter)
Here the items paint their content.
Definition: ElevationProfileFloatItem.cpp:178
Marble::ElevationProfileFloatItem::contextMenuEvent
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: ElevationProfileFloatItem.cpp:401
Marble::ElevationProfileFloatItem::copyrightYears
virtual QString copyrightYears() const
Definition: ElevationProfileFloatItem.cpp:116
Marble::ElevationProfileFloatItem::description
virtual QString description() const
Returns a user description of the plugin.
Definition: ElevationProfileFloatItem.cpp:111
Marble::ElevationProfileFloatItem::ElevationProfileFloatItem
ElevationProfileFloatItem(const MarbleModel *marbleModel=0)
Definition: ElevationProfileFloatItem.cpp:38
QContextMenuEvent
QObject
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
QPainter
GeoDataLineString.h
DialogConfigurationInterface.h
QString
QList
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QMenu
Marble::RoutingModel
Definition: RoutingModel.h:34
GeoGraphicsItem.h
Marble::ElevationProfileFloatItem::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: ElevationProfileFloatItem.cpp:423
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
Marble::ElevationProfileFloatItem::initialize
virtual void initialize()
Definition: ElevationProfileFloatItem.cpp:133
QDialog
Marble::ElevationProfileFloatItem::version
virtual QString version() const
Definition: ElevationProfileFloatItem.cpp:106
Marble::ElevationProfileFloatItem::isInitialized
virtual bool isInitialized() const
Definition: ElevationProfileFloatItem.cpp:149
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:91
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:83
Marble::ElevationProfileFloatItem::~ElevationProfileFloatItem
~ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:77
Marble::ElevationProfileFloatItem::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: ElevationProfileFloatItem.cpp:383
Marble::ElevationProfileFloatItem::icon
virtual QIcon icon() const
Returns an icon for the plugin.
Definition: ElevationProfileFloatItem.cpp:128
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:96
Marble::ElevationProfileFloatItem
The class that creates an interactive elvation profile.
Definition: ElevationProfileFloatItem.h:43
QIcon
ElevationProfilePlotAxis.h
MARBLE_PLUGIN
#define MARBLE_PLUGIN(T)
Definition: RenderPlugin.h:340
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