1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "rawview_table.hpp"
#include <utility>
#include <QVBoxLayout>
#include <QStringList>
#include "../stfl/element_group.hpp"
#include "rawview_table_row.hpp"
#include "rawview_group_subtable.hpp"
#include "../qtutil/accordion.hpp"
namespace cvv
{
namespace gui
{
RawviewTable::RawviewTable(view::Rawview *parent) : parent{ parent }
{
subtableAccordion = new qtutil::Accordion{};
auto *layout = new QVBoxLayout{};
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(subtableAccordion);
setLayout(layout);
}
void RawviewTable::updateRowGroups(
std::vector<stfl::ElementGroup<RawviewTableRow>> newGroups)
{
subtableAccordion->clear();
subTables.clear();
for (auto &group : newGroups)
{
if (group.size() > 0)
{
auto subtable = util::make_unique<RawviewGroupSubtable>(
this, std::move(group));
auto subtablePtr = subtable.get();
auto titles = group.getTitles();
QString title =
"No grouping specified, use #group to do specify";
if (titles.size() != 0)
{
title = titles.join(", ");
}
subtableAccordion->push_back(title, std::move(subtable),
false);
subTables.push_back(subtablePtr);
}
}
}
void RawviewTable::updateUI()
{
for (auto *subTable : subTables)
{
subTable->updateUI();
}
}
std::vector<cv::DMatch> RawviewTable::getMatchSelection()
{
std::vector<cv::DMatch> matches;
for (auto subTable : subTables)
{
auto subMatches = subTable->getMatchSelection();
matches.insert(matches.end(), subMatches.begin(), subMatches.end());
}
return matches;
}
std::vector<cv::KeyPoint> RawviewTable::getKeyPointSelection()
{
std::vector<cv::KeyPoint> keyPoints;
for (auto subTable : subTables)
{
auto subKeyPoints = subTable->getKeyPointSelection();
keyPoints.insert(keyPoints.end(), subKeyPoints.begin(), subKeyPoints.end());
}
return keyPoints;
}
void RawviewTable::setMatchSelection(std::vector<cv::DMatch> matches)
{
for (auto subTable : subTables)
{
subTable->setMatchSelection(matches);
}
}
void RawviewTable::setKeyPointSelection(std::vector<cv::KeyPoint> keyPoints)
{
for (auto subTable : subTables)
{
subTable->setKeyPointSelection(keyPoints);
}
}
}
}