ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
MLSDialog.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include "MLSDialog.h"
9 
10 #include "../MLSSmoothingUpsampling.h"
11 
12 // PCL
13 #include "PclUtils/PCLModules.h"
14 
15 using namespace PCLModules;
16 
17 // Qt
18 #include <QVariant>
19 
20 MLSDialog::MLSDialog(QWidget *parent) : QDialog(parent), Ui::MLSDialog() {
21  setupUi(this);
22 
23  updateCombo();
24 
25  connect(this->upsampling_method, SIGNAL(currentIndexChanged(QString)), this,
26  SLOT(activateMenu(QString)));
27  connect(this->search_radius, SIGNAL(valueChanged(double)), this,
28  SLOT(updateSquaredGaussian(double)));
29 
31 }
32 
34  this->upsampling_method->clear();
35  this->upsampling_method->addItem(tr("None"), QVariant(MLSParameters::NONE));
36  this->upsampling_method->addItem(
37  tr("Sample Local Plane"),
38  QVariant(MLSParameters::SAMPLE_LOCAL_PLANE));
39  this->upsampling_method->addItem(
40  tr("Random Uniform Density"),
41  QVariant(MLSParameters::RANDOM_UNIFORM_DENSITY));
42  this->upsampling_method->addItem(
43  tr("Voxel Grid Dilation"),
44  QVariant(MLSParameters::VOXEL_GRID_DILATION));
45 }
46 
49 
50  if (name == tr("Sample Local Plane")) {
51  this->sample_local_plane_method->setEnabled(true);
52  } else if (name == tr("Random Uniform Density")) {
53  this->random_uniform_density_method->setEnabled(true);
54  } else if (name == tr("Voxel Grid Dilation")) {
55  this->voxel_grid_dilation_method->setEnabled(true);
56  } else {
58  }
59 }
60 
62  this->sample_local_plane_method->setEnabled(false);
63  this->random_uniform_density_method->setEnabled(false);
64  this->voxel_grid_dilation_method->setEnabled(false);
65 }
66 
67 void MLSDialog::toggleMethods(bool status) {
68  if (!status) deactivateAllMethods();
69 }
70 
71 void MLSDialog::updateSquaredGaussian(double radius) {
72  this->squared_gaussian_parameter->setValue(radius * radius);
73 }
std::string name
void toggleMethods(bool status)
Definition: MLSDialog.cpp:67
void updateSquaredGaussian(double radius)
Definition: MLSDialog.cpp:71
void deactivateAllMethods()
Definition: MLSDialog.cpp:61
void updateCombo()
Definition: MLSDialog.cpp:33
MLSDialog(QWidget *parent=nullptr)
Definition: MLSDialog.cpp:20
void activateMenu(QString name)
Definition: MLSDialog.cpp:47