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
|
@ -6,6 +6,7 @@
|
|||
#include "statstranslations.h"
|
||||
#include "statsview.h"
|
||||
#include "zvalues.h"
|
||||
#include "core/selection.h"
|
||||
|
||||
#include <math.h> // for lrint()
|
||||
#include <QLocale>
|
||||
|
@ -404,3 +405,13 @@ void BarSeries::unhighlight()
|
|||
items[highlighted.bar].highlight(highlighted.subitem, false, binCount());
|
||||
highlighted = Index();
|
||||
}
|
||||
|
||||
void BarSeries::selectItemsUnderMouse(const QPointF &pos)
|
||||
{
|
||||
Index index = getItemUnderMouse(pos);
|
||||
if (index.bar < 0)
|
||||
return setSelection({}, nullptr);
|
||||
|
||||
const std::vector<dive *> &dives = items[index.bar].subitems[index.subitem].dives;
|
||||
setSelection(dives, dives.empty() ? nullptr : dives.front());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue