/** * @RDE_HEADER@ * Widget that visualizes the topography of a bunch of points along a rubberband * $Id$ * $HeadURL$ * $Author$ * Created by Malte Schroeder, NLSE, 2018-03-07 */ #pragma once #include #include #include #include #include "lts_widgets_export.h" class LTSWIDGETS_EXPORT LtsHeightPlotWidget final : public QWidget { Q_OBJECT public: explicit LtsHeightPlotWidget(QWidget *parent = nullptr); virtual ~LtsHeightPlotWidget(); void clearView(); /** * Set the data in the form * QPoint - x/y values * double - height values * @param data the height data to display */ void setData(const QVector > &data); /** * Set the markers to show * QPoint - x/y values * @param data the markers to display */ void setMarks(const QVector &data); /** * Set the background of the widget */ void setBackgroundBrush(const QBrush &brush); /** * Set the font for the axis labels */ void setTextFont(const QFont &f); /** * Set the pen used for the axis lines */ void setAxisPen(const QPen &pen); /** * Set the pen for the position marker */ void setPositionPen(const QPen &pen); /** * Set the pen for the viewline */ void setViewLinePen(const QPen &pen); /** * Set the brush for the contour (+ fill) */ void setContourBrush(const QBrush &brush); /** * Set the pen for the markers */ void setMarkerPen(const QPen &pen); Q_SIGNALS: /** * The current mouse position has changed. * @param curPoint the current point (in map coordinates) of the mouse * @param curHeight the current height at the given point * @param mouseHeight the current height at the current mouse point (>= curHeight) */ void mousePositionChanged(const QPointF &curPoint, double curHeight, double mouseHeight); /** * A line of sight has started. This signal can emitted more than once * wich means that the old line of sight was stopped * @param startPoint the startpoint (in map coordinates) of the line */ void startLineOfSight(const QPointF &startPoint); /** * A line of sight has stopped */ void stopLineOfSight(); protected: void resizeEvent(QResizeEvent *e) override; void paintEvent(QPaintEvent *e) override; void mouseMoveEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; class Private; Private *const d; };