| 1 |
//########################################################################## |
| 2 |
//# # |
| 3 |
//# CLOUDCOMPARE PLUGIN: qRANSAC_SD # |
| 4 |
//# # |
| 5 |
//# This program is free software; you can redistribute it and/or modify # |
| 6 |
//# it under the terms of the GNU General Public License as published by # |
| 7 |
//# the Free Software Foundation; version 2 or later of the License. # |
| 8 |
//# # |
| 9 |
//# This program is distributed in the hope that it will be useful, # |
| 10 |
//# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 11 |
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 12 |
//# GNU General Public License for more details. # |
| 13 |
//# # |
| 14 |
//# COPYRIGHT: Daniel Girardeau-Montaut # |
| 15 |
//# # |
| 16 |
//########################################################################## |
| 17 |
|
| 18 |
#include "ccRansacSDDlg.h" |
| 19 |
|
| 20 |
#include <ccOctree.h> |
| 21 |
|
| 22 |
static int s_minSupport = 500; // this is the minimal numer of points required for a primitive |
| 23 |
static double s_maxNormalDev_deg = 25.0; // maximal normal deviation from ideal shape (in degrees) |
| 24 |
static double s_probability = 0.01; // probability that no better candidate was overlooked during sampling |
| 25 |
|
| 26 |
ccRansacSDDlg::ccRansacSDDlg(QWidget* parent) |
| 27 |
: QDialog(parent, Qt::Tool) |
| 28 |
, Ui::RansacSDDialog() |
| 29 |
{ |
| 30 |
setupUi(this); |
| 31 |
|
| 32 |
connect(buttonBox, &QDialogButtonBox::accepted, this, &ccRansacSDDlg::saveSettings); |
| 33 |
|
| 34 |
supportPointsSpinBox->setValue(s_minSupport); |
| 35 |
maxNormDevAngleSpinBox->setValue(s_maxNormalDev_deg); |
| 36 |
probaDoubleSpinBox->setValue(s_probability); |
| 37 |
} |
| 38 |
|
| 39 |
void ccRansacSDDlg::saveSettings() |
| 40 |
{ |
| 41 |
s_minSupport = supportPointsSpinBox->value(); |
| 42 |
s_maxNormalDev_deg = maxNormDevAngleSpinBox->value(); |
| 43 |
s_probability = probaDoubleSpinBox->value(); |
| 44 |
} |