marble
ElevationProfileFloatItem.cpp
Go to the documentation of this file.
141 m_leftGraphMargin = QFontMetricsF( font() ).width( "0000 m" ); // TODO make this dynamic according to actual need
193 QString text = tr( "Not enough points in the current viewport.\nTry to disable 'Zoom to viewport'." );
203 if ( ! m_zoomToViewport && ( m_firstVisiblePoint > 0 || m_lastVisiblePoint < m_eleData.size() - 1 ) ) {
207 rect.setLeft( m_leftGraphMargin + m_eleData.value( m_firstVisiblePoint ).x() * m_eleGraphWidth / m_axisX.range() );
209 rect.setWidth( ( m_eleData.value( m_lastVisiblePoint ).x() - m_eleData.value( m_firstVisiblePoint ).x() ) * m_eleGraphWidth / m_axisX.range() );
216 painter->drawLine( m_leftGraphMargin, m_eleGraphHeight, contentSize().width(), m_eleGraphHeight );
319 newPos.setX( ( m_eleData.value(i).x() - m_axisX.minValue() ) * m_eleGraphWidth / m_axisX.range() );
335 // "remove" the first and last path element first, they are only used to fill down to the bottom
354 qreal ypos = m_eleGraphHeight - ( ( currentPoint.altitude() - m_axisY.minValue() ) / ( qMax<qreal>( 1.0, m_axisY.range() ) * m_shrinkFactorY ) ) * m_eleGraphHeight;
362 painter->drawText( currentStringBegin, contentSize().height() - 1.5 * m_fontHeight, intervalStr );
465 const int plotPos = ( m_eleData.value(i).x() - m_axisX.minValue() ) * m_eleGraphWidth / m_axisX.range();
480 const qreal xpos = m_axisX.minValue() + ( m_cursorPositionX / m_eleGraphWidth ) * m_axisX.range();
585 QList<QPointF> ElevationProfileFloatItem::calculateElevationData( const GeoDataLineString &lineString ) const
630 // Low-pass filtering (moving average) of the elevation profile to calculate gain and loss values
632 // http://www.ikg.uni-hannover.de/fileadmin/ikg/staff/thesis/finished/documents/StudArb_Schulze.pdf
text
void setTickCount(const int min, const int max)
Definition: ElevationProfilePlotAxis.cpp:46
void clear()
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
qreal minValue() const
Definition: ElevationProfilePlotAxis.cpp:58
Type type() const
int & rx()
virtual QString nameId() const
Returns the unique name of the plugin.
Definition: ElevationProfileFloatItem.cpp:101
QRect toRect() const
void setCursor(const QCursor &)
The representation of GeoData in a model This class represents all available data given by kml-data f...
Definition: GeoDataTreeModel.h:32
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setDocumentRole(DocumentRole role)
Definition: GeoDataDocument.cpp:86
void setAltitude(const qreal altitude)
set the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1191
void setRenderHint(RenderHint hint, bool on)
virtual QList< PluginAuthor > pluginAuthors() const
Definition: ElevationProfileFloatItem.cpp:121
void repaintNeeded(QRegion dirtyRegion=QRegion())
This signal is emitted if an update of the view is needed.
int right() const
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:662
QString unit() const
Definition: ElevationProfilePlotAxis.cpp:78
int length() const
void setColorAt(qreal position, const QColor &color)
void setChecked(bool)
virtual qreal zValue() const
Returns the z value of the layer (default: 0.0).
Definition: ElevationProfileFloatItem.cpp:86
This file contains the headers for MarbleModel.
void setRange(const qreal &minValue, const qreal &maxValue)
Definition: ElevationProfilePlotAxis.cpp:33
QSizeF size() const
Definition: PluginInterface.h:28
virtual bool eventFilter(QObject *object, QEvent *e)
Definition: AbstractFloatItem.cpp:163
QSizeF contentSize() const
Returns the size of the content of the MarbleGraphicsItem.
Definition: FrameGraphicsItem.cpp:180
QPoint mapToGlobal(const QPoint &pos) const
void save()
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:172
const QPainterPath::Element & elementAt(int index) const
void setAlpha(int alpha)
void moveTo(const QPointF &point)
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:215
void drawLine(const QLineF &line)
virtual void setProjection(const ViewportParams *viewport)
Definition: ElevationProfileFloatItem.cpp:154
QString tr(const char *sourceText, const char *disambiguation, int n)
int elementCount() const
qreal width(const QString &text) const
int addDocument(GeoDataDocument *document)
Definition: GeoDataTreeModel.cpp:821
qreal left() const
int x() const
int y() const
Definition: GeoDataDocument.h:40
int size() const
qreal range() const
Definition: ElevationProfilePlotAxis.cpp:68
T value(int i) const
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
virtual bool event(QEvent *e)
RoutingModel * routingModel()
Provides access to the routing model which contains a list of routing instructions describing steps t...
Definition: RoutingManager.cpp:261
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
void setFont(const QFont &font)
QString number(int n, int base)
int count(const T &value) const
virtual void paintContent(QPainter *painter)
Here the items paint their content.
Definition: ElevationProfileFloatItem.cpp:178
qreal x() const
void translate(qreal dx, qreal dy)
void append(const T &value)
QString fromUtf8(const char *str, int size)
virtual void contextMenuEvent(QWidget *w, QContextMenuEvent *e)
Definition: ElevationProfileFloatItem.cpp:401
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:549
virtual QString copyrightYears() const
Definition: ElevationProfileFloatItem.cpp:116
int top() const
virtual QString description() const
Returns a user description of the plugin.
Definition: ElevationProfileFloatItem.cpp:111
ElevationProfileFloatItem(const MarbleModel *marbleModel=0)
Definition: ElevationProfileFloatItem.cpp:38
void removeDocument(int index)
Definition: GeoDataTreeModel.cpp:872
void setPen(const QColor &color)
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
void lineTo(const QPointF &endPoint)
void setTop(int y)
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
int left() const
bool isEmpty() const
QRectF contentRect() const
Returns the rect of the content in item coordinates.
Definition: FrameGraphicsItem.cpp:167
QPointF topLeft() const
void setWidth(int width)
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
QPoint center() const
void setElementPositionAt(int index, qreal x, qreal y)
T & first()
qreal height(qreal lon, qreal lat) const
Definition: ElevationModel.cpp:83
void setColor(const QColor &color)
void moveTop(int y)
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:549
This file contains the headers for ViewportParams.
Definition: ElevationProfilePlotAxis.h:21
void setCheckable(bool)
qreal scale() const
Definition: ElevationProfilePlotAxis.cpp:73
bool eventFilter(QObject *object, QEvent *e)
Definition: ElevationProfileFloatItem.cpp:423
void restore()
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
virtual void initialize()
Definition: ElevationProfileFloatItem.cpp:133
void drawPath(const QPainterPath &path)
void setWidth(int width)
qreal ascent() const
QString & setNum(short n, int base)
void setHeight(int height)
void setPosition(const QPointF &position)
Set the position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:44
T & last()
void removeAction(QAction *action)
int bottom() const
void setX(int x)
void setY(int y)
This file contains the headers for MarbleWidget.
virtual QString version() const
Definition: ElevationProfileFloatItem.cpp:106
bool contains(const QPointF &point) const
void setSize(const QSizeF &size)
virtual bool isInitialized() const
Definition: ElevationProfileFloatItem.cpp:149
void dataUpdated()
void setLength(const int &length)
Definition: ElevationProfilePlotAxis.cpp:40
void moveRight(int x)
void moveCenter(const QPoint &position)
virtual QString name() const
Returns the user-visible name of the plugin.
Definition: ElevationProfileFloatItem.cpp:91
AxisTickList ticks() const
Definition: ElevationProfilePlotAxis.cpp:83
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
void setContentSize(const QSizeF &size)
Sets the size of the content of the item.
Definition: FrameGraphicsItem.cpp:200
~ElevationProfileFloatItem()
Definition: ElevationProfileFloatItem.cpp:77
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: ElevationProfileFloatItem.cpp:383
const QPen & pen() const
virtual QIcon icon() const
Returns an icon for the plugin.
Definition: ElevationProfileFloatItem.cpp:128
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void setLeft(int x)
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
qreal width() const
virtual QString guiString() const
String that should be displayed in GUI.
Definition: ElevationProfileFloatItem.cpp:96
The class that creates an interactive elvation profile.
Definition: ElevationProfileFloatItem.h:43
virtual void setProjection(const ViewportParams *viewport)
Definition: MarbleGraphicsItem.cpp:272
void setVisible(bool visible)
Set visibility of the float item.
Definition: AbstractFloatItem.cpp:130
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
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.