marble
ElevationProfileFloatItem.cpp
Go to the documentation of this file.
147 m_leftGraphMargin = QFontMetricsF( font() ).width( "0000 m" ); // TODO make this dynamic according to actual need
197 QString text = tr( "Not enough points in the current viewport.\nTry to disable 'Zoom to viewport'." );
207 if ( ! m_zoomToViewport && ( m_firstVisiblePoint > 0 || m_lastVisiblePoint < m_eleData.size() - 1 ) ) {
211 rect.setLeft( m_leftGraphMargin + m_eleData.value( m_firstVisiblePoint ).x() * m_eleGraphWidth / m_axisX.range() );
213 rect.setWidth( ( m_eleData.value( m_lastVisiblePoint ).x() - m_eleData.value( m_firstVisiblePoint ).x() ) * m_eleGraphWidth / m_axisX.range() );
220 painter->drawLine( m_leftGraphMargin, m_eleGraphHeight, contentSize().width(), m_eleGraphHeight );
323 newPos.setX( ( m_eleData.value(i).x() - m_axisX.minValue() ) * m_eleGraphWidth / m_axisX.range() );
339 // "remove" the first and last path element first, they are only used to fill down to the bottom
358 qreal ypos = m_eleGraphHeight - ( ( currentPoint.altitude() - m_axisY.minValue() ) / ( qMax<qreal>( 1.0, m_axisY.range() ) * m_shrinkFactorY ) ) * m_eleGraphHeight;
366 painter->drawText( currentStringBegin, contentSize().height() - 1.5 * m_fontHeight, intervalStr );
469 const int plotPos = ( m_eleData.value(i).x() - m_axisX.minValue() ) * m_eleGraphWidth / m_axisX.range();
484 const qreal xpos = m_axisX.minValue() + ( m_cursorPositionX / m_eleGraphWidth ) * m_axisX.range();
589 QList<QPointF> ElevationProfileFloatItem::calculateElevationData( const GeoDataLineString &lineString ) const
634 // Low-pass filtering (moving average) of the elevation profile to calculate gain and loss values
636 // http://www.ikg.uni-hannover.de/fileadmin/ikg/staff/thesis/finished/documents/StudArb_Schulze.pdf
void setTickCount(const int min, const int max)
Definition: ElevationProfilePlotAxis.cpp:46
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
qreal minValue() const
Definition: ElevationProfilePlotAxis.cpp:58
virtual QString nameId() const
Returns the unique name of the plugin.
Definition: ElevationProfileFloatItem.cpp:107
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
void setDocumentRole(DocumentRole role)
Definition: GeoDataDocument.cpp:62
void setAltitude(const qreal altitude)
set the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1191
virtual QList< PluginAuthor > pluginAuthors() const
Definition: ElevationProfileFloatItem.cpp:127
void repaintNeeded(QRegion dirtyRegion=QRegion())
This signal is emitted if an update of the view is needed.
bool screenCoordinates(qreal lon, qreal lat, qreal &x, qreal &y) const
Get the screen coordinates corresponding to geographical coordinates in the widget.
Definition: MarbleWidget.cpp:758
QString unit() const
Definition: ElevationProfilePlotAxis.cpp:78
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: ElevationProfileFloatItem.cpp:92
This file contains the headers for MarbleModel.
void setRange(const qreal &minValue, const qreal &maxValue)
Definition: ElevationProfilePlotAxis.cpp:33
Definition: PluginInterface.h:28
virtual bool eventFilter(QObject *object, QEvent *e)
Definition: AbstractFloatItem.cpp:161
QSizeF contentSize() const
Returns the size of the content of the MarbleGraphicsItem.
Definition: FrameGraphicsItem.cpp:184
GeoDataCoordinates coordinate(const QDateTime &dateTime=QDateTime(), bool *iconAtCoordinates=0) const
Return the coordinates of the placemark at time dateTime as a GeoDataCoordinates. ...
Definition: GeoDataPlacemark.cpp:78
qreal distanceSphere(qreal lon1, qreal lat1, qreal lon2, qreal lat2)
This method calculates the shortest distance between two points on a sphere.
Definition: MarbleMath.h:52
int rowCount(const QModelIndex &parent=QModelIndex()) const
Overload of QAbstractListModel.
Definition: RoutingModel.cpp:158
void setCoordinate(qreal longitude, qreal latitude, qreal altitude=0, GeoDataCoordinates::Unit _unit=GeoDataCoordinates::Radian)
Set the coordinate of the placemark in longitude and latitude.
Definition: GeoDataPlacemark.cpp:121
int addDocument(GeoDataDocument *document)
Definition: GeoDataTreeModel.cpp:595
ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:36
Definition: GeoDataDocument.h:40
qreal range() const
Definition: ElevationProfilePlotAxis.cpp:68
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
RoutingModel * routingModel()
Provides access to the routing model which contains a list of routing instructions describing steps t...
Definition: RoutingManager.cpp:260
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
virtual void paintContent(QPainter *painter)
Here the items paint their content.
Definition: ElevationProfileFloatItem.cpp:182
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: ElevationProfileFloatItem.cpp:405
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:485
virtual QString copyrightYears() const
Definition: ElevationProfileFloatItem.cpp:122
virtual QString description() const
Returns a user description of the plugin.
Definition: ElevationProfileFloatItem.cpp:117
void removeDocument(int index)
Definition: GeoDataTreeModel.cpp:646
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:48
QRectF contentRect() const
Returns the rect of the content in item coordinates.
Definition: FrameGraphicsItem.cpp:171
qreal height(qreal lon, qreal lat) const
Definition: ElevationModel.cpp:83
void append(const GeoDataCoordinates &position)
Appends a given geodesic position as a new node to the LineString.
Definition: GeoDataLineString.cpp:221
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QPointF positivePosition() const
Return the positive position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:49
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
Definition: MarbleWidget.cpp:626
This file contains the headers for ViewportParams.
Definition: ElevationProfilePlotAxis.h:21
qreal scale() const
Definition: ElevationProfilePlotAxis.cpp:73
bool eventFilter(QObject *object, QEvent *e)
Definition: ElevationProfileFloatItem.cpp:427
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
virtual void changeViewport(ViewportParams *viewport)
Definition: ElevationProfileFloatItem.cpp:160
virtual void initialize()
Definition: ElevationProfileFloatItem.cpp:139
void setPosition(const QPointF &position)
Set the position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:44
This file contains the headers for MarbleWidget.
virtual QString version() const
Definition: ElevationProfileFloatItem.cpp:112
virtual bool isInitialized() const
Definition: ElevationProfileFloatItem.cpp:155
void dataUpdated()
void setLength(const int &length)
Definition: ElevationProfilePlotAxis.cpp:40
virtual QString name() const
Returns the user-visible name of the plugin.
Definition: ElevationProfileFloatItem.cpp:97
AxisTickList ticks() const
Definition: ElevationProfilePlotAxis.cpp:83
void setContentSize(const QSizeF &size)
Sets the size of the content of the item.
Definition: FrameGraphicsItem.cpp:204
~ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:83
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: ElevationProfileFloatItem.cpp:387
virtual QIcon icon() const
Returns an icon for the plugin.
Definition: ElevationProfileFloatItem.cpp:134
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
virtual QString guiString() const
String that should be displayed in GUI.
Definition: ElevationProfileFloatItem.cpp:102
The class that creates an interactive elvation profile.
Definition: ElevationProfileFloatItem.h:43
void setVisible(bool visible)
Set visibility of the float item.
Definition: AbstractFloatItem.cpp:128
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
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.