24 : QDialog(parent, Qt::Tool),
Ui::NormalComputationDlg(), m_cloud(nullptr) {
29 autoRadiusToolButton->setVisible(
false);
31 connect(localModelComboBox,
32 static_cast<void (QComboBox::*)(
int)
>(
33 &QComboBox::currentIndexChanged),
35 connect(autoRadiusToolButton, &QToolButton::clicked,
this,
39 useScanGridCheckBox->setChecked(
true);
40 scanGridsOrientCheckBox->setChecked(
true);
43 useScanGridCheckBox->setChecked(
false);
44 useScanGridCheckBox->setEnabled(
false);
45 gridAngleFrame->setEnabled(
false);
47 scanGridsOrientCheckBox->setChecked(
false);
48 scanGridsOrientCheckBox->setEnabled(
false);
52 sensorOrientCheckBox->setChecked(
true);
55 sensorOrientCheckBox->setChecked(
false);
56 sensorOrientCheckBox->setEnabled(
false);
76 localModelComboBox->setCurrentIndex(index);
80 switch (localModelComboBox->currentIndex()) {
96 radiusDoubleSpinBox->setEnabled(index != 2);
97 autoRadiusToolButton->setEnabled(index != 2);
101 radiusDoubleSpinBox->setValue(
static_cast<double>(radius));
117 preferredOrientRadioButton->setChecked(
false);
119 preferredOrientRadioButton->setChecked(
true);
120 preferredOrientationComboBox->setCurrentIndex(orientation);
125 return useScanGridCheckBox->isChecked();
129 return gridAngleDoubleSpinBox->value();
133 gridAngleDoubleSpinBox->setValue(value);
137 return normalsOrientGroupBox->isChecked();
141 return scanGridsOrientCheckBox->isChecked();
145 return sensorOrientCheckBox->isChecked();
149 return preferredOrientRadioButton->isChecked();
153 return mstOrientRadioButton->isChecked();
157 mstNeighborsSpinBox->setValue(n);
161 return mstNeighborsSpinBox->value();
166 int index = preferredOrientRadioButton->isChecked()
167 ? preferredOrientationComboBox->currentIndex()
184 CVLog::Error(QString(
"Could not compute octree for cloud '%1'")
186 autoRadiusToolButton->setVisible(
false);
194 radiusDoubleSpinBox->setValue(radius);
float PointCoordinateType
Type of the coordinates of a (N-D) point.
static bool Error(const char *format,...)
Display an error dialog with formatted message.
virtual void setVisible(bool state)
Sets entity visibility.
virtual ccOctree::Shared computeOctree(cloudViewer::GenericProgressCallback *progressCb=nullptr, bool autoAddChild=true)
Computes the cloud octree.
virtual ccOctree::Shared getOctree() const
Returns the associated octree (if any)
bool useScanGridsForComputation() const
Returns whether scan grids should be used for computation.
ccNormalComputationDlg(bool withScanGrid, bool withSensor, QWidget *parent=nullptr)
Default constructor.
bool usePreferredOrientation() const
Returns whether a preferred orientation should be used.
int getMSTNeighborCount() const
Returns the number of neighbors for Minimum Spanning Tree (MST)
bool orientNormals() const
Returns whether normals should be oriented or not.
void setMSTNeighborCount(int n)
Sets the number of neighbors for Minimum Spanning Tree (MST)
ccNormalVectors::Orientation getPreferredOrientation() const
Returns the preferred orientation (if any)
double getMinGridAngle_deg() const
Returns the min angle for grid triangles.
bool useScanGridsForOrientation() const
Returns whether scan grids should be used for normals orientation.
void setMinGridAngle_deg(double value)
Sets the min angle for grid triangles.
CV_LOCAL_MODEL_TYPES getLocalModel() const
Returns the local model chosen for normal computation.
void setCloud(ccPointCloud *cloud)
Sets the currently selected cloud (required for 'auto' feature)
bool useSensorsForOrientation() const
Returns whether scan grids should be used for normals computation.
void setRadius(PointCoordinateType radius)
Sets default value for local neighbourhood radius.
void autoEstimateRadius()
Automatically estimate the local surface radius.
void setPreferredOrientation(ccNormalVectors::Orientation orientation)
Sets the preferred orientation.
bool useMSTOrientation() const
ccPointCloud * m_cloud
Selected cloud.
void localModelChanged(int index)
On local model change.
void setLocalModel(CV_LOCAL_MODEL_TYPES model)
Sets the local model chosen for normal computation.
PointCoordinateType getRadius() const
Returns local neighbourhood radius.
static PointCoordinateType GuessBestRadius(ccGenericPointCloud *cloud, cloudViewer::DgmOctree *cloudOctree=nullptr, cloudViewer::GenericProgressCallback *progressCb=nullptr)
Orientation
'Default' orientations
@ PREVIOUS
Re-use previous normal (if any)
@ UNDEFINED
Undefined (no orientation is required)
virtual QString getName() const
Returns object name.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Graphical progress indicator (thread-safe)