![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <GenericProgressCallback.h>

Public Member Functions | |
| NormalizedProgress (GenericProgressCallback *callback, unsigned totalSteps, unsigned totalPercentage=100) | |
| Default constructor. More... | |
| virtual | ~NormalizedProgress () |
| Destructor. More... | |
| void | scale (unsigned totalSteps, unsigned totalPercentage=100, bool updateCurrentProgress=false) |
| void | reset () |
| Resets progress state. More... | |
| bool | oneStep () |
| Increments total progress value of a single unit. More... | |
| bool | steps (unsigned n) |
| Increments total progress value of more than a single unit. More... | |
Protected Attributes | |
| float | m_percent |
| Total progress value (in percent) More... | |
| unsigned | m_step |
| float | m_percentAdd |
| Percentage added to total progress value at each step. More... | |
| AtomicCounter * | m_counter |
| Current number of calls to 'oneStep'. More... | |
| GenericProgressCallback * | progressCallback |
| associated GenericProgressCallback More... | |
Efficient management of progress based on a total number of steps different than 100 DGM: can now be associated to a null 'callback' pointer to simplify the client code.
Definition at line 78 of file GenericProgressCallback.h.
| NormalizedProgress::NormalizedProgress | ( | GenericProgressCallback * | callback, |
| unsigned | totalSteps, | ||
| unsigned | totalPercentage = 100 |
||
| ) |
Default constructor.
| callback | associated GenericProgressCallback instance (can be null) |
| totalSteps | total number of steps (> 0) |
| totalPercentage | equivalent percentage (> 0) |
Definition at line 44 of file NormalizedProgress.cpp.
References scale().
|
virtual |
| bool NormalizedProgress::oneStep | ( | ) |
Increments total progress value of a single unit.
Definition at line 99 of file NormalizedProgress.cpp.
References AtomicCounter::fetchAndAddRelaxed(), cloudViewer::GenericProgressCallback::isCancelRequested(), m_counter, m_percent, m_percentAdd, m_step, progressCallback, and cloudViewer::GenericProgressCallback::update().
Referenced by cloudViewer::CloudSamplingTools::applyNoiseFilterAtLevel(), ccLibAlgorithms::ApplyScaleMatchingAlgorithm(), cloudViewer::CloudSamplingTools::applySORFilterAtLevel(), cloudViewer::PointProjectionTools::applyTransformation(), masc::Classifier::classify(), qCanupoProcess::Classify(), ClusterEmptySpace(), qVoxFallProcess::Compute(), cloudViewer::GeometricalAnalysisTools::ComputeApproxPointsDensityInACellAtLevel(), cloudViewer::ScalarFieldTools::computeCellGaussianFilter(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistance(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistancesWithOctree(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistanceWithOctree(), ComputeClusterVolume(), cloudViewer::GeometricalAnalysisTools::ComputeGeomCharacteristicAtLevel(), cloudViewer::StatisticalTestingTools::computeLocalChi2DistAtLevel(), ComputeM3C2DistForPoint(), ComputeMathOpWithNearestNeighbor(), DistanceMapGenerationTool::ComputeRadialDist(), ccVolumeCalcTool::ComputeVolume(), define_GenericProgressCallback(), cloudViewer::GeometricalAnalysisTools::DetectCircle(), cloudViewer::GeometricalAnalysisTools::DetectSphereRobust(), ccComparisonDlg::determineBestOctreeLevel(), cloudViewer::PointProjectionTools::developCloudOnCone(), cloudViewer::PointProjectionTools::developCloudOnCylinder(), masc::Classifier::evaluate(), cloudViewer::DgmOctree::extractCCs(), cloudViewer::GeometricalAnalysisTools::FlagDuplicatePointsInACellAtLevel(), ccKdTreeForFacetExtraction::FuseCells(), ccRasterizeTool::generateContours(), cloudViewer::DgmOctree::genericBuild(), FastMarchingForFacetExtraction::init(), StereogramWidget::init(), InitializeOutputCloud(), cloudViewer::Grid3D< Type >::intersectWith(), SoiFilter::loadFile(), SimpleBinFilter::loadFile(), E57Filter::loadFile(), LASFWFFilter::loadFile(), LasIOFilter::loadFile(), LASFilter::loadFile(), RDBFilter::loadFile(), LoadScan(), masc::ContextBasedFeature::prepare(), masc::Tools::PrepareFeatures(), cloudViewer::ChamferDistanceTransform::propagateDistance(), cloudViewer::CloudSamplingTools::resampleCloudSpatially(), cloudViewer::MeshSamplingTools::samplePointsOnMesh(), SaveScan(), MAFilter::saveToFile(), SimpleBinFilter::saveToFile(), E57Filter::saveToFile(), LASFWFFilter::saveToFile(), LASFilter::saveToFile(), cloudViewer::SaitoSquaredDistanceTransform::SDT_3D(), cloudViewer::ManualSegmentationTools::segmentMesh(), cloudViewer::CloudSamplingTools::subsampleCellAtLevel(), cloudViewer::CloudSamplingTools::subsampleCloudRandomly(), and TileLasReader().
| void NormalizedProgress::reset | ( | ) |
Resets progress state.
Definition at line 91 of file NormalizedProgress.cpp.
References m_counter, m_percent, progressCallback, AtomicCounter::store(), and cloudViewer::GenericProgressCallback::update().
Referenced by define_GenericProgressCallback().
| void NormalizedProgress::scale | ( | unsigned | totalSteps, |
| unsigned | totalPercentage = 100, |
||
| bool | updateCurrentProgress = false |
||
| ) |
Scales inner parameters so that 'totalSteps' calls of the 'oneStep' method correspond to 'totalPercentage' percents
Definition at line 61 of file NormalizedProgress.cpp.
References cloudViewer::utility::ceil(), AtomicCounter::load(), m_counter, m_percent, m_percentAdd, m_step, progressCallback, and AtomicCounter::store().
Referenced by define_GenericProgressCallback(), and NormalizedProgress().
| bool NormalizedProgress::steps | ( | unsigned | n | ) |
Increments total progress value of more than a single unit.
Definition at line 114 of file NormalizedProgress.cpp.
References AtomicCounter::fetchAndAddRelaxed(), cloudViewer::GenericProgressCallback::isCancelRequested(), m_counter, m_percent, m_percentAdd, m_step, progressCallback, and cloudViewer::GenericProgressCallback::update().
Referenced by define_GenericProgressCallback(), cloudViewer::CloudSamplingTools::resampleCellAtLevel(), and cloudViewer::CloudSamplingTools::subsampleCellAtLevel().
|
protected |
Current number of calls to 'oneStep'.
Thread safe if CC_CORE_LIB is compiled with Qt.
Definition at line 121 of file GenericProgressCallback.h.
Referenced by oneStep(), reset(), scale(), steps(), and ~NormalizedProgress().
|
protected |
|
protected |
Percentage added to total progress value at each step.
Definition at line 116 of file GenericProgressCallback.h.
|
protected |
Number of necessary calls to 'oneStep' to actually call progress callback
Definition at line 113 of file GenericProgressCallback.h.
|
protected |
associated GenericProgressCallback
Definition at line 124 of file GenericProgressCallback.h.