aboutsummaryrefslogtreecommitdiff
path: root/selectionhandler.cpp
blob: 44eef2816eed9f800c16fa2a3ca3a2049fa247e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "selectionhandler.h"

SelectionHandler::SelectionHandler(const arma::uvec &sampleIndices)
    : m_sampleIndices(sampleIndices)
{
}

void SelectionHandler::setSelection(const QSet<int> &selection)
{
    QSet<int> newSelection;

    // The selecion happens over the sample indices. We use the original dataset
    // indices in sampleIndices to translate indices.
    for (auto it = selection.begin(); it != selection.end(); it++) {
        newSelection.insert(m_sampleIndices[*it]);
    }

    emit selectionChanged(newSelection);
}