29 #include "ui_postProcessingDialog.h"
31 #include <QPushButton>
32 #include <QMessageBox>
40 _ui =
new Ui_PostProcessingDialog();
47 _ui->sba->setEnabled(
false);
48 _ui->sba->setChecked(
false);
54 _ui->comboBox_sbaType->setItemData(1, 0, Qt::UserRole - 1);
55 _ui->comboBox_sbaType->setCurrentIndex(0);
59 _ui->comboBox_sbaType->setItemData(0, 0, Qt::UserRole - 1);
60 _ui->comboBox_sbaType->setCurrentIndex(1);
64 _ui->comboBox_sbaType->setItemData(2, 0, Qt::UserRole - 1);
65 _ui->comboBox_sbaType->setCurrentIndex(1);
71 connect(
_ui->buttonBox, SIGNAL(clicked(QAbstractButton *)),
this, SLOT(
closeDialog(QAbstractButton *)));
73 connect(
_ui->detectMoreLoopClosures, SIGNAL(clicked(
bool)),
this, SLOT(
updateButtonBox()));
74 connect(
_ui->refineNeighborLinks, SIGNAL(stateChanged(
int)),
this, SLOT(
updateButtonBox()));
75 connect(
_ui->refineLoopClosureLinks, SIGNAL(stateChanged(
int)),
this, SLOT(
updateButtonBox()));
77 connect(
_ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()),
this, SLOT(
restoreDefaults()));
79 connect(
_ui->detectMoreLoopClosures, SIGNAL(clicked(
bool)),
this, SIGNAL(
configChanged()));
80 connect(
_ui->clusterRadius, SIGNAL(valueChanged(
double)),
this, SIGNAL(
configChanged()));
81 connect(
_ui->clusterAngle, SIGNAL(valueChanged(
double)),
this, SIGNAL(
configChanged()));
82 connect(
_ui->iterations, SIGNAL(valueChanged(
int)),
this, SIGNAL(
configChanged()));
83 connect(
_ui->intraSession, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
84 connect(
_ui->interSession, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
85 connect(
_ui->refineNeighborLinks, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
86 connect(
_ui->refineLoopClosureLinks, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
89 connect(
_ui->sba_iterations, SIGNAL(valueChanged(
int)),
this, SIGNAL(
configChanged()));
90 connect(
_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(
int)),
this, SIGNAL(
configChanged()));
91 connect(
_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
updateVisibility()));
92 connect(
_ui->sba_rematchFeatures, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
106 QDialogButtonBox::ButtonRole role =
_ui->buttonBox->buttonRole(button);
109 case QDialogButtonBox::RejectRole:
113 case QDialogButtonBox::AcceptRole:
127 if(
_ui->detectMoreLoopClosures->isChecked() && !
this->intraSession() && !
this->interSession())
129 QMessageBox::warning(
this, tr(
"Configuration error"), tr(
"Intra-session and inter-session parameters cannot be both disabled at the same time. Please select one (or both)."));
137 _ui->sba_variance->setVisible(
_ui->comboBox_sbaType->currentIndex() == 0);
138 _ui->label_variance->setVisible(
_ui->comboBox_sbaType->currentIndex() == 0);
145 settings.beginGroup(group);
149 settings.setValue(
"cluster_angle", this->
clusterAngle());
150 settings.setValue(
"iterations", this->
iterations());
151 settings.setValue(
"intra_session", this->
intraSession());
152 settings.setValue(
"inter_session", this->
interSession());
155 settings.setValue(
"sba", this->
isSBA());
157 settings.setValue(
"sba_type", this->
sbaType());
158 settings.setValue(
"sba_variance", this->
sbaVariance());
170 settings.beginGroup(group);
180 this->
setSBA(settings.value(
"sba",
this->isSBA()).toBool());
223 _ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
229 return _ui->detectMoreLoopClosures->isChecked();
234 return _ui->clusterRadius->value();
239 return _ui->clusterAngle->value();
244 return _ui->iterations->value();
249 return _ui->intraSession->isChecked();
254 return _ui->interSession->isChecked();
259 return _ui->refineNeighborLinks->isChecked();
264 return _ui->refineLoopClosureLinks->isChecked();
269 return _ui->sba->isEnabled() &&
_ui->sba->isChecked();
274 return _ui->sba_iterations->value();
278 return _ui->sba_variance->value();
286 return _ui->sba_rematchFeatures->isChecked();
292 _ui->detectMoreLoopClosures->setChecked(on);
296 _ui->clusterRadius->setValue(radius);
308 _ui->intraSession->setChecked(enabled);
312 _ui->interSession->setChecked(enabled);
316 _ui->refineNeighborLinks->setChecked(on);
320 _ui->refineLoopClosureLinks->setChecked(on);
324 _ui->sba->setChecked((
335 _ui->sba_variance->setValue(variance);
341 _ui->comboBox_sbaType->setCurrentIndex(2);
345 _ui->comboBox_sbaType->setCurrentIndex(1);
349 _ui->comboBox_sbaType->setCurrentIndex(0);
354 _ui->sba_rematchFeatures->setChecked(
value);