10 #include "base/reconstruction_manager.h"
21 const colmap::ReconstructionManager* reconstruction_manager)
22 : QComboBox(parent), reconstruction_manager_(reconstruction_manager) {
24 font.setPointSize(10);
29 if (view()->isVisible()) {
35 const int prev_idx = currentIndex() == -1 ? 0 : currentIndex();
39 addItem(
"Newest model");
42 for (
size_t i = 0; i < reconstruction_manager_->Size(); ++i) {
43 const QString item = QString().asprintf(
44 "Model %d (%d images, %d points)",
static_cast<int>(i + 1),
46 reconstruction_manager_->Get(i).NumRegImages()),
48 reconstruction_manager_->Get(i).NumPoints3D()));
49 QFontMetrics font_metrics(view()->font());
50 max_width =
std::max(max_width, font_metrics.horizontalAdvance(item));
54 view()->setMinimumWidth(max_width);
56 if (reconstruction_manager_->Size() == 0) {
59 setCurrentIndex(prev_idx);
66 if (reconstruction_manager_->Size() == 0) {
69 if (currentIndex() == 0) {
72 return currentIndex() - 1;
78 if (reconstruction_manager_->Size() == 0) {
84 setCurrentIndex(idx + 1);
Generic file read and write utility for python interface.