read/write settings
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ set(QG3POINT_PLUGIN_VERSION "0.3+")
|
||||
)
|
||||
|
||||
# may be needed for debug
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
|
||||
|
||||
# Find installed Open3D, which exports Open3D::Open3D
|
||||
find_package( Open3D REQUIRED )
|
||||
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
explicit G3PointDialog(QString cloudName, QWidget *parent = nullptr);
|
||||
~G3PointDialog();
|
||||
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
|
||||
void emitKNNChanged(){emit kNNEditingFinished();}
|
||||
void emitSegment(){emit segment();}
|
||||
void emitClusterAndOrClean(){emit clusterAndOrClean();}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "G3PointDialog.h"
|
||||
#include "ui_qG3PointDialog.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
G3PointDialog::G3PointDialog(QString cloudName, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::qG3PointDialog)
|
||||
@@ -36,6 +38,35 @@ G3PointDialog::~G3PointDialog()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void G3PointDialog::readSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup("G3Point");
|
||||
|
||||
// kNN
|
||||
int kNN = settings.value("kNN", 20).toInt();
|
||||
this->ui->spinBoxkNN->setValue(kNN);
|
||||
// radius factor
|
||||
double radiusFactor = settings.value("radiusFactor", 0.6).toDouble();
|
||||
this->ui->doubleSpinBoxRadiusFactor->setValue(radiusFactor);
|
||||
// max angle 1
|
||||
double maxAngle1 = settings.value("maxAngle1", 60).toDouble();
|
||||
this->ui->doubleSpinBoxRadiusFactor->setValue(maxAngle1);
|
||||
}
|
||||
|
||||
void G3PointDialog::writeSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup("G3Point");
|
||||
|
||||
// kNN
|
||||
settings.setValue("kNN", ui->spinBoxkNN->value());
|
||||
// radius factor
|
||||
settings.setValue("radiusFactor", ui->doubleSpinBoxRadiusFactor->value());
|
||||
// max angle 1
|
||||
settings.setValue("maxAngle1", ui->doubleSpinBoxMaxAngle1->value());
|
||||
}
|
||||
|
||||
double G3PointDialog::getMaxAngle1()
|
||||
{
|
||||
return this->ui->doubleSpinBoxMaxAngle1->value();
|
||||
|
||||
Reference in New Issue
Block a user