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:
Robert C. Helling 2021-01-17 13:34:18 +01:00 committed by Dirk Hohndel
parent 1797b59c10
commit 5c098eea29
10 changed files with 57 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#include "statstranslations.h"
#include "statsview.h"
#include "zvalues.h"
#include "core/selection.h"
#include <numeric>
#include <math.h>
@ -263,3 +264,13 @@ void PieSeries::unhighlight()
items[highlighted].highlight(*item, highlighted, false, (int)items.size());
highlighted = -1;
}
void PieSeries::selectItemsUnderMouse(const QPointF &pos)
{
int index = getItemUnderMouse(pos);
if (index < 0)
return setSelection({}, nullptr);
const std::vector<dive *> &dives = items[index].dives;
setSelection(dives, dives.empty() ? nullptr : dives.front());
}