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:
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);
173 this->
setClusterRadius(settings.value(
"cluster_radius", this->clusterRadius()).toDouble());
174 this->
setClusterAngle(settings.value(
"cluster_angle", this->clusterAngle()).toDouble());
175 this->
setIterations(settings.value(
"iterations", this->iterations()).toInt());
176 this->
setIntraSession(settings.value(
"intra_session", this->intraSession()).toBool());
177 this->
setInterSession(settings.value(
"inter_session", this->interSession()).toBool());
180 this->
setSBA(settings.value(
"sba", this->isSBA()).toBool());
181 this->
setSBAIterations(settings.value(
"sba_iterations", this->sbaIterations()).toInt());
183 this->
setSBAVariance(settings.value(
"sba_variance", this->sbaVariance()).toDouble());
184 this->
setSBARematchFeatures(settings.value(
"sba_rematch_features", this->sbaRematchFeatures()).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);
300 _ui->clusterAngle->setValue(angle);
304 _ui->iterations->setValue(iterations);
308 _ui->intraSession->setChecked(enabled);
312 _ui->interSession->setChecked(enabled);
316 _ui->refineNeighborLinks->setChecked(on);
320 _ui->refineLoopClosureLinks->setChecked(on);
324 _ui->sba->setChecked((
331 _ui->sba_iterations->setValue(iterations);
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);
void setDetectMoreLoopClosures(bool on)
void loadSettings(QSettings &settings, const QString &group="")
bool interSession() const
void setSBAVariance(double variance)
void closeDialog(QAbstractButton *button)
PostProcessingDialog(QWidget *parent=0)
void setSBAIterations(int iterations)
void setIntraSession(bool enabled)
bool isRefineLoopClosureLinks() const
GLM_FUNC_DECL T angle(detail::tquat< T, P > const &x)
void saveSettings(QSettings &settings, const QString &group="") const
void setIterations(int iterations)
void setRefineNeighborLinks(bool on)
void setRefineLoopClosureLinks(bool on)
int sbaIterations() const
Ui_PostProcessingDialog * _ui
static bool isAvailable(Optimizer::Type type)
bool isRefineNeighborLinks() const
bool intraSession() const
bool sbaRematchFeatures() const
void setSBARematchFeatures(bool value)
void setClusterRadius(double radius)
virtual ~PostProcessingDialog()
void setInterSession(bool enabled)
double sbaVariance() const
double clusterRadius() const
Optimizer::Type sbaType() const
void setSBAType(Optimizer::Type type)
void setClusterAngle(double angle)
double clusterAngle() const
bool isDetectMoreLoopClosures() const