ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvSubsamplingDlg.h
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 #pragma once
9 
10 // Qt
11 #include <QDialog>
12 
13 // CV_CORE_LIB
15 #include <ReferenceCloud.h>
16 
17 // GUI
18 #include <ui_subsamplingDlg.h>
19 
21 
23 class ccSubsamplingDlg : public QDialog, public Ui::SubsamplingDialog {
24  Q_OBJECT
25 
26 public:
29  RANDOM = 0,
30  SPACE = 1,
31  OCTREE = 2,
32  };
33 
35  ccSubsamplingDlg(unsigned maxPointCount,
36  double maxCloudRadius,
37  QWidget* parent = 0);
38 
40 
43  ccGenericPointCloud* cloud,
44  cloudViewer::GenericProgressCallback* progressCb = 0);
45 
47  void enableSFModulation(ScalarType sfMin, ScalarType sfMax);
48 
49 protected slots:
50 
51  void sliderMoved(int sliderPos);
52  void samplingRateChanged(double value);
53  void changeSamplingMethod(int index);
54 
55 protected: // methods
57  void updateLabels();
58 
59 protected: // members
61  unsigned m_maxPointCount;
62 
64  double m_maxRadius;
65 
69  ScalarType m_sfMin;
71  ScalarType m_sfMax;
72 };
ccGenericPointCloud::computeOctree
virtual ccOctree::Shared computeOctree(cloudViewer::GenericProgressCallback *progressCb=nullptr, bool autoAddChild=true)
Computes the cloud octree.
Definition: ecvGenericPointCloud.cpp:124
cloudViewer::CloudSamplingTools::SFModulationParams::enabled
bool enabled
Whether the modulation is enabled or not.
Definition: CloudSamplingTools.h:144
ccSubsamplingDlg::getSampledCloud
cloudViewer::ReferenceCloud * getSampledCloud(ccGenericPointCloud *cloud, cloudViewer::GenericProgressCallback *progressCb=0)
Returns subsampled version of a cloud according to current parameters.
Definition: ecvSubsamplingDlg.cpp:56
CloudSamplingTools.h
cloudViewer::GenericCloud::size
virtual unsigned size() const =0
Returns the number of points.
ccSubsamplingDlg::m_sfMax
ScalarType m_sfMax
Scalar modulation (max SF value)
Definition: ecvSubsamplingDlg.h:71
ccSubsamplingDlg
Subsampling cloud dialog.
Definition: ecvSubsamplingDlg.h:23
cloudViewer::CloudSamplingTools
Several point cloud resampling algorithms (octree-based, random, etc.)
Definition: CloudSamplingTools.h:25
cloudViewer::CloudSamplingTools::SFModulationParams
Parameters for the scalar-field based modulation of a parameter.
Definition: CloudSamplingTools.h:138
GenericProgressCallback.h
ScalarField.h
CVLog.h
cloudViewer::CloudSamplingTools::SFModulationParams::b
double b
Modulation scheme: y = a.sf + b.
Definition: CloudSamplingTools.h:148
cloudViewer::CloudSamplingTools::subsampleCloudRandomly
static ReferenceCloud * subsampleCloudRandomly(GenericIndexedCloudPersist *cloud, unsigned newNumberOfPoints, GenericProgressCallback *progressCb=nullptr)
Subsamples a point cloud (process based on random selections)
Definition: CloudSamplingTools.cpp:202
DgmOctree.h
cloudViewer::GenericProgressCallback
Definition: GenericProgressCallback.h:20
cloudViewer::DgmOctree::MAX_OCTREE_LEVEL
static const int MAX_OCTREE_LEVEL
Max octree subdivision level.
Definition: DgmOctree.h:67
ccOctree::Shared
QSharedPointer< ccOctree > Shared
Shared pointer.
Definition: ecvOctree.h:32
ccGenericPointCloud::getOctree
virtual ccOctree::Shared getOctree() const
Returns the associated octree (if any)
Definition: ecvGenericPointCloud.cpp:97
GeometricalAnalysisTools.h
ccSubsamplingDlg::OCTREE
@ OCTREE
Definition: ecvSubsamplingDlg.h:31
slots
#define slots
Definition: PythonPlugin.cpp:25
ccGenericPointCloud
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
cloudViewer::ScalarField::ValidValue
static bool ValidValue(ScalarType value)
Returns whether a scalar value is valid or not.
Definition: ScalarField.h:61
cloudViewer::GreaterThanEpsilon
bool GreaterThanEpsilon(float x)
Test a floating point number against our epsilon (a very small number).
Definition: CVMath.h:37
ecvGenericPointCloud.h
ccSubsamplingDlg::m_maxRadius
double m_maxRadius
Max radius (for SPACE method)
Definition: ecvSubsamplingDlg.h:64
Ui
Definition: sfEditDlg.h:16
ecvSubsamplingDlg.h
ccSubsamplingDlg::SPACE
@ SPACE
Definition: ecvSubsamplingDlg.h:30
ccSubsamplingDlg::changeSamplingMethod
void changeSamplingMethod(int index)
Definition: ecvSubsamplingDlg.cpp:197
ccSubsamplingDlg::RANDOM
@ RANDOM
Definition: ecvSubsamplingDlg.h:29
ccSubsamplingDlg::samplingRateChanged
void samplingRateChanged(double value)
Definition: ecvSubsamplingDlg.cpp:171
octree
cloudViewer::DgmOctree * octree
Definition: qCanupoTools.cpp:37
ccSubsamplingDlg::m_sfModEnabled
bool m_sfModEnabled
Scalar modulation.
Definition: ecvSubsamplingDlg.h:67
count
int count
Definition: FileIOFactory.cpp:132
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
cloudViewer::ReferenceCloud
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
cloudViewer::CloudSamplingTools::subsampleCloudWithOctreeAtLevel
static ReferenceCloud * subsampleCloudWithOctreeAtLevel(GenericIndexedCloudPersist *cloud, unsigned char octreeLevel, SUBSAMPLING_CELL_METHOD subsamplingMethod, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr)
Subsamples a point cloud (process based on the octree)
Definition: CloudSamplingTools.cpp:126
ReferenceCloud.h
ccSubsamplingDlg::enableSFModulation
void enableSFModulation(ScalarType sfMin, ScalarType sfMax)
Enables the SF modulation option (SPATIAL method)
Definition: ecvSubsamplingDlg.cpp:243
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
cloudViewer::CloudSamplingTools::SFModulationParams::a
double a
Modulation scheme: y = a.sf + b.
Definition: CloudSamplingTools.h:146
ccSubsamplingDlg::updateLabels
void updateLabels()
Updates the dialog labels depending on the active mode.
Definition: ecvSubsamplingDlg.cpp:135
ccSubsamplingDlg::CC_SUBSAMPLING_METHOD
CC_SUBSAMPLING_METHOD
Sub-sampling method.
Definition: ecvSubsamplingDlg.h:28
SPACE_RANGE_EXPONENT
static const double SPACE_RANGE_EXPONENT
Definition: ecvSubsamplingDlg.cpp:23
ccSubsamplingDlg::sliderMoved
void sliderMoved(int sliderPos)
Definition: ecvSubsamplingDlg.cpp:157
ccSubsamplingDlg::ccSubsamplingDlg
ccSubsamplingDlg(unsigned maxPointCount, double maxCloudRadius, QWidget *parent=0)
Default constructor.
Definition: ecvSubsamplingDlg.cpp:25
ecvOctree.h
cloudViewer::CloudSamplingTools::resampleCloudSpatially
static ReferenceCloud * resampleCloudSpatially(GenericIndexedCloudPersist *cloud, PointCoordinateType minDistance, const SFModulationParams &modParams, DgmOctree *octree=nullptr, GenericProgressCallback *progressCb=nullptr)
Resamples a point cloud (process based on inter point distance)
Definition: CloudSamplingTools.cpp:256
ccSubsamplingDlg::m_sfMin
ScalarType m_sfMin
Scalar modulation (min SF value)
Definition: ecvSubsamplingDlg.h:69
ccSubsamplingDlg::m_maxPointCount
unsigned m_maxPointCount
Max point count (for RANDOM method)
Definition: ecvSubsamplingDlg.h:61