mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: select dives from Scatter Plot
When clicking on items in a plot, select the corresponding dives. This can be useful for data validation. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1797b59c10
commit
5c098eea29
10 changed files with 57 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "core/dive.h"
|
||||
#include "core/divelist.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/selection.h"
|
||||
|
||||
ScatterSeries::ScatterSeries(StatsView &view, StatsAxis *xAxis, StatsAxis *yAxis,
|
||||
const StatsVariable &varX, const StatsVariable &varY) :
|
||||
|
@ -72,6 +73,16 @@ std::vector<int> ScatterSeries::getItemsUnderMouse(const QPointF &point) const
|
|||
return res;
|
||||
}
|
||||
|
||||
void ScatterSeries::selectItemsUnderMouse(const QPointF &point)
|
||||
{
|
||||
std::vector<struct dive *> selected;
|
||||
|
||||
for(int idx: getItemsUnderMouse(point))
|
||||
selected.push_back(items[idx].d);
|
||||
|
||||
setSelection(selected, selected.empty() ? nullptr : selected.front());
|
||||
}
|
||||
|
||||
static QString dataInfo(const StatsVariable &var, const dive *d)
|
||||
{
|
||||
// For "numeric" variables, we display value and unit.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue