29 #include "ui_postProcessingDialog.h" 31 #include <QPushButton> 39 _ui =
new Ui_PostProcessingDialog();
44 _ui->sba->setEnabled(
false);
45 _ui->sba->setChecked(
false);
49 _ui->comboBox_sbaType->setItemData(1, 0, Qt::UserRole - 1);
50 _ui->comboBox_sbaType->setCurrentIndex(0);
54 _ui->comboBox_sbaType->setItemData(0, 0, Qt::UserRole - 1);
55 _ui->comboBox_sbaType->setCurrentIndex(1);
60 connect(
_ui->detectMoreLoopClosures, SIGNAL(clicked(
bool)),
this, SLOT(
updateButtonBox()));
61 connect(
_ui->refineNeighborLinks, SIGNAL(stateChanged(
int)),
this, SLOT(
updateButtonBox()));
62 connect(
_ui->refineLoopClosureLinks, SIGNAL(stateChanged(
int)),
this, SLOT(
updateButtonBox()));
64 connect(
_ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()),
this, SLOT(
restoreDefaults()));
66 connect(
_ui->detectMoreLoopClosures, SIGNAL(clicked(
bool)),
this, SIGNAL(
configChanged()));
67 connect(
_ui->clusterRadius, SIGNAL(valueChanged(
double)),
this, SIGNAL(
configChanged()));
68 connect(
_ui->clusterAngle, SIGNAL(valueChanged(
double)),
this, SIGNAL(
configChanged()));
69 connect(
_ui->iterations, SIGNAL(valueChanged(
int)),
this, SIGNAL(
configChanged()));
70 connect(
_ui->refineNeighborLinks, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
71 connect(
_ui->refineLoopClosureLinks, SIGNAL(stateChanged(
int)),
this, SIGNAL(
configChanged()));
74 connect(
_ui->sba_iterations, SIGNAL(valueChanged(
int)),
this, SIGNAL(
configChanged()));
75 connect(
_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(
int)),
this, SIGNAL(
configChanged()));
76 connect(
_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
updateVisibility()));
88 _ui->sba_variance->setVisible(
_ui->comboBox_sbaType->currentIndex() == 0);
89 _ui->label_variance->setVisible(
_ui->comboBox_sbaType->currentIndex() == 0);
96 settings.beginGroup(group);
100 settings.setValue(
"cluster_angle", this->
clusterAngle());
101 settings.setValue(
"iterations", this->
iterations());
104 settings.setValue(
"sba", this->
isSBA());
106 settings.setValue(
"sba_type", this->
sbaType());
107 settings.setValue(
"sba_variance", this->
sbaVariance());
118 settings.beginGroup(group);
121 this->
setClusterRadius(settings.value(
"cluster_radius", this->clusterRadius()).toDouble());
122 this->
setClusterAngle(settings.value(
"cluster_angle", this->clusterAngle()).toDouble());
123 this->
setIterations(settings.value(
"iterations", this->iterations()).toInt());
126 this->
setSBA(settings.value(
"sba", this->isSBA()).toBool());
127 this->
setSBAIterations(settings.value(
"sba_iterations", this->sbaIterations()).toInt());
129 this->
setSBAVariance(settings.value(
"sba_variance", this->sbaVariance()).toDouble());
152 _ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
158 return _ui->detectMoreLoopClosures->isChecked();
163 return _ui->clusterRadius->value();
168 return _ui->clusterAngle->value();
173 return _ui->iterations->value();
178 return _ui->refineNeighborLinks->isChecked();
183 return _ui->refineLoopClosureLinks->isChecked();
188 return _ui->sba->isChecked();
193 return _ui->sba_iterations->value();
197 return _ui->sba_variance->value();
207 _ui->detectMoreLoopClosures->setChecked(on);
211 _ui->clusterRadius->setValue(radius);
215 _ui->clusterAngle->setValue(angle);
219 _ui->iterations->setValue(iterations);
223 _ui->refineNeighborLinks->setChecked(on);
227 _ui->refineLoopClosureLinks->setChecked(on);
235 _ui->sba_iterations->setValue(iterations);
239 _ui->sba_variance->setValue(variance);
245 _ui->comboBox_sbaType->setCurrentIndex(1);
249 _ui->comboBox_sbaType->setCurrentIndex(0);
void setDetectMoreLoopClosures(bool on)
void loadSettings(QSettings &settings, const QString &group="")
double sbaVariance() const
void setSBAVariance(double variance)
void saveSettings(QSettings &settings, const QString &group="") const
bool isRefineNeighborLinks() const
PostProcessingDialog(QWidget *parent=0)
void setSBAIterations(int iterations)
GLM_FUNC_DECL T angle(detail::tquat< T, P > const &x)
void setIterations(int iterations)
void setRefineNeighborLinks(bool on)
void setRefineLoopClosureLinks(bool on)
Ui_PostProcessingDialog * _ui
static bool isAvailable(Optimizer::Type type)
Optimizer::Type sbaType() const
void setClusterRadius(double radius)
virtual ~PostProcessingDialog()
int sbaIterations() const
double clusterAngle() const
double clusterRadius() const
void setSBAType(Optimizer::Type type)
bool isDetectMoreLoopClosures() const
void setClusterAngle(double angle)
bool isRefineLoopClosureLinks() const