mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added "Restaure defaults" buttons to ExportClouds and PostProcessing dialogs
This commit is contained in:
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "ExportCloudsDialog.h"
|
||||
#include "ui_exportCloudsDialog.h"
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -37,6 +37,8 @@ ExportCloudsDialog::ExportCloudsDialog(QWidget *parent) :
|
||||
{
|
||||
_ui = new Ui_ExportCloudsDialog();
|
||||
_ui->setupUi(this);
|
||||
|
||||
connect(_ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), this, SLOT(restoreDefaults()));
|
||||
}
|
||||
|
||||
ExportCloudsDialog::~ExportCloudsDialog()
|
||||
@@ -44,15 +46,36 @@ ExportCloudsDialog::~ExportCloudsDialog()
|
||||
delete _ui;
|
||||
}
|
||||
|
||||
void ExportCloudsDialog::restoreDefaults()
|
||||
{
|
||||
setAssemble(true);
|
||||
setAssembleVoxel(0.005);
|
||||
if(_ui->groupBox_regenerate->isEnabled())
|
||||
{
|
||||
setGenerate(true);
|
||||
}
|
||||
setGenerateDecimation(1);
|
||||
setGenerateVoxel(0.005);
|
||||
setGenerateMaxDepth(4);
|
||||
setBinaryFile(true);
|
||||
setMLS(false);
|
||||
setMLSRadius(0.04);
|
||||
setMesh(false);
|
||||
setMeshNormalKSearch(20);
|
||||
setMeshGp3Radius(0.04);
|
||||
}
|
||||
|
||||
void ExportCloudsDialog::setSaveButton()
|
||||
{
|
||||
_ui->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save);
|
||||
_ui->buttonBox->button(QDialogButtonBox::Ok)->setVisible(false);
|
||||
_ui->buttonBox->button(QDialogButtonBox::Save)->setVisible(true);
|
||||
_ui->checkBox_binary->setVisible(true);
|
||||
}
|
||||
|
||||
void ExportCloudsDialog::setOkButton()
|
||||
{
|
||||
_ui->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
||||
_ui->buttonBox->button(QDialogButtonBox::Ok)->setVisible(true);
|
||||
_ui->buttonBox->button(QDialogButtonBox::Save)->setVisible(false);
|
||||
_ui->checkBox_binary->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
class Ui_ExportCloudsDialog;
|
||||
class QAbstractButton;
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -75,6 +76,9 @@ public:
|
||||
void setMeshNormalKSearch(int k);
|
||||
void setMeshGp3Radius(double radius);
|
||||
|
||||
public slots:
|
||||
void restoreDefaults();
|
||||
|
||||
private:
|
||||
Ui_ExportCloudsDialog * _ui;
|
||||
};
|
||||
|
||||
@@ -41,6 +41,7 @@ PostProcessingDialog::PostProcessingDialog(QWidget * parent) :
|
||||
connect(_ui->detectMoreLoopClosures, SIGNAL(clicked(bool)), this, SLOT(updateButtonBox()));
|
||||
connect(_ui->refineNeighborLinks, SIGNAL(stateChanged(int)), this, SLOT(updateButtonBox()));
|
||||
connect(_ui->refineLoopClosureLinks, SIGNAL(stateChanged(int)), this, SLOT(updateButtonBox()));
|
||||
connect(_ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), this, SLOT(restoreDefaults()));
|
||||
}
|
||||
|
||||
PostProcessingDialog::~PostProcessingDialog()
|
||||
@@ -48,6 +49,17 @@ PostProcessingDialog::~PostProcessingDialog()
|
||||
delete _ui;
|
||||
}
|
||||
|
||||
void PostProcessingDialog::restoreDefaults()
|
||||
{
|
||||
setDetectMoreLoopClosures(true);
|
||||
setClusterRadius(0.3);
|
||||
setClusterAngle(30);
|
||||
setIterations(1);
|
||||
setReextractFeatures(false);
|
||||
setRefineNeighborLinks(false);
|
||||
setRefineLoopClosureLinks(false);
|
||||
}
|
||||
|
||||
void PostProcessingDialog::updateButtonBox()
|
||||
{
|
||||
_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
|
||||
|
||||
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
class Ui_PostProcessingDialog;
|
||||
class QAbstractButton;
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
@@ -61,9 +62,13 @@ public:
|
||||
void setRefineNeighborLinks(bool on);
|
||||
void setRefineLoopClosureLinks(bool on);
|
||||
|
||||
public slots:
|
||||
void restoreDefaults();
|
||||
|
||||
private slots:
|
||||
void updateButtonBox();
|
||||
|
||||
|
||||
private:
|
||||
Ui_PostProcessingDialog * _ui;
|
||||
};
|
||||
|
||||
@@ -301,7 +301,7 @@ Guidelines: 4 times the voxel size, 0.025 for voxel=0.</string>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user