![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A simple scalar field (to be associated to a point cloud) More...
#include <ScalarField.h>


Public Member Functions | |
| ScalarField (const char *name=nullptr) | |
| Default constructor. More... | |
| ScalarField (const ScalarField &sf) | |
| Copy constructor. More... | |
| void | setName (const char *name) |
| Sets scalar field name. More... | |
| const char * | getName () const |
| Returns scalar field name. More... | |
| void | computeMeanAndVariance (ScalarType &mean, ScalarType *variance=nullptr) const |
| virtual void | computeMinAndMax () |
| Determines the min and max values. More... | |
| void | flagValueAsInvalid (std::size_t index) |
| Sets the value as 'invalid' (i.e. NAN_VALUE) More... | |
| std::size_t | countValidValues () const |
| Returns the number of valid values in this scalar field. More... | |
| ScalarType | getMin () const |
| Returns the minimum value. More... | |
| ScalarType | getMax () const |
| Returns the maximum value. More... | |
| void | fill (ScalarType fillValue=0) |
| Fills the array with a particular value. More... | |
| bool | reserveSafe (std::size_t count) |
| Reserves memory (no exception thrown) More... | |
| bool | resizeSafe (std::size_t count, bool initNewElements=false, ScalarType valueForNewElements=0) |
| Resizes memory (no exception thrown) More... | |
| ScalarType & | getValue (std::size_t index) |
| const ScalarType & | getValue (std::size_t index) const |
| void | setValue (std::size_t index, ScalarType value) |
| void | addElement (ScalarType value) |
| unsigned | currentSize () const |
| void | swap (std::size_t i1, std::size_t i2) |
| ~ScalarField () override=default | |
| Default destructor. More... | |
Public Member Functions inherited from CCShareable | |
| CCShareable () | |
| Default constructor. More... | |
| virtual void | link () |
| Increase counter. More... | |
| virtual void | release () |
| Decrease counter and deletes object when 0. More... | |
| virtual unsigned | getLinkCount () const |
| Returns the current link count. More... | |
Static Public Member Functions | |
| static ScalarType | NaN () |
| Returns the specific NaN value. More... | |
| static bool | ValidValue (ScalarType value) |
| Returns whether a scalar value is valid or not. More... | |
Protected Attributes | |
| char | m_name [256] |
| Scalar field name. More... | |
| ScalarType | m_minVal |
| Minimum value. More... | |
| ScalarType | m_maxVal |
| Maximum value. More... | |
Protected Attributes inherited from CCShareable | |
| unsigned | m_linkCount |
| Links counter. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CCShareable | |
| virtual | ~CCShareable () |
| Destructor. More... | |
A simple scalar field (to be associated to a point cloud)
A mono-dimensionnal array of scalar values. It has also specific parameters for display purposes.
Invalid values can be represented by NAN_VALUE.
Definition at line 25 of file ScalarField.h.
|
explicit |
Default constructor.
[SHAREABLE] Call 'link' when associating this structure to an object.
| name | scalar field name |
Definition at line 16 of file ScalarField.cpp.
| ScalarField::ScalarField | ( | const ScalarField & | sf | ) |
Copy constructor.
| sf | scalar field to copy |
Definition at line 18 of file ScalarField.cpp.
|
overridedefault |
Default destructor.
Call release instead.
|
inline |
Definition at line 99 of file ScalarField.h.
Referenced by MeshWrapper< Real >::addDensity(), DistanceMapGenerationTool::ConvertMapToCloud(), ccCompass::convertToPointCloud(), define_ScalarField(), ccCompass::estimateP21(), ccCompass::estimateStrain(), ccCompass::estimateStructureNormals(), LoadCloud(), SimpleBinFilter::loadFile(), PrepareLASField(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::ICPRegistrationTools::Register(), and DistanceMapGenerationDlg::update().
| void ScalarField::computeMeanAndVariance | ( | ScalarType & | mean, |
| ScalarType * | variance = nullptr |
||
| ) | const |
Computes the mean value (and optionally the variance value) of the scalar field
| mean | a field to store the mean value |
| variance | if not void, the variance will be computed and stored here |
Definition at line 41 of file ScalarField.cpp.
References abs(), ecvColor::LookUpTable::at(), count, size, and ValidValue().
Referenced by ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), define_ScalarField(), CommandFilterBySFValue::process(), and cloudViewer::utility::pybind_scalarfield().
|
inlinevirtual |
Determines the min and max values.
Reimplemented in ccScalarField.
Definition at line 123 of file ScalarField.h.
References ecvColor::LookUpTable::at(), m_maxVal, m_minVal, size, and ValidValue().
Referenced by ccScalarFieldArithmeticsDlg::Apply(), ccLibAlgorithms::ApplyCCLibAlgorithm(), ccTrace::buildCurvatureCost(), ccTrace::buildGradientCost(), masc::Classifier::classify(), qCanupoProcess::Classify(), ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), ccLibAlgorithms::ComputeGeomCharacteristic(), ComputeMathOpWithNearestNeighbor(), ccCompass::convertToPointCloud(), define_ScalarField(), ccCompass::estimateStructureNormals(), GrainsAsEllipsoids::exportResultsAsCloud(), qFacets::extractFacets(), TreeIso::Final_seg_pcd(), masc::ContextBasedFeature::finish(), masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), getMortarMaps(), ccEntityAction::importToSF(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), ccTrace::optimizePath(), masc::Feature::PerformMathOp(), masc::ContextBasedFeature::prepare(), masc::PointFeature::prepare(), CommandExtractCCs::process(), ccEntityAction::processMeshSF(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::ICPRegistrationTools::Register(), ccEntityAction::rgbGaussianFilter(), ccEntityAction::sfAddIdField(), and ccEntityAction::sfGaussianFilter().
| std::size_t ScalarField::countValidValues | ( | ) | const |
Returns the number of valid values in this scalar field.
Definition at line 29 of file ScalarField.cpp.
References ecvColor::LookUpTable::at(), count, size, and ValidValue().
Referenced by ccEntityAction::computeStatParams(), CommandSubsample::process(), and ccEntityAction::sfSetAsCoord().
|
inline |
Definition at line 100 of file ScalarField.h.
References size.
Referenced by ccScalarFieldArithmeticsDlg::Apply(), ccHistogramWindow::computeBinArrayFromSF(), ComputeCorePointDescriptor(), qM3C2Normals::ComputeCorePointsNormals(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedCrossCovarianceMatrix(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedGravityCenter(), ccRasterizeTool::convertGridToCloud(), define_ScalarField(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccEntityAction::importToSF(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::ICPRegistrationTools::Register(), SaveScan(), ccEntityAction::sfAddIdField(), ccEntityAction::sfConvertToRandomRGB(), and ecvFilterByLabelDlg::start().
|
inline |
Fills the array with a particular value.
Definition at line 77 of file ScalarField.h.
Referenced by masc::Classifier::classify(), qCanupoProcess::Classify(), qM3C2Normals::ComputeCorePointsNormals(), ccCropTool::Crop(), define_ScalarField(), TreeIso::Final_seg_pcd(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), ccRasterizeTool::generateHillshade(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), masc::Feature::PrepareSF(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Sets the value as 'invalid' (i.e. NAN_VALUE)
Definition at line 66 of file ScalarField.h.
References ecvColor::LookUpTable::at(), and NaN().
Referenced by define_ScalarField(), LoadScan(), and cloudViewer::utility::pybind_scalarfield().
|
inline |
Returns the maximum value.
Definition at line 74 of file ScalarField.h.
References m_maxVal.
Referenced by ccTrace::buildCurvatureCost(), ccTrace::buildGradientCost(), ccComparisonDlg::computeApproxDistances(), ccEntityAction::computeStatParams(), ccVolumeCalcTool::convertGridToCloud(), ccVolumeCalcTool::ConvertGridToCloud(), define_ScalarField(), ccHistogramWindow::fromSF(), ccRasterizeTool::generateContours(), LasField::GetLASFields(), ccTrace::getSegmentCostCurve(), ccTrace::getSegmentCostGrad(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), LasSaveDialog::handleComboBoxChange(), LoadScan(), ccColorScaleEditorDialog::onStepModified(), CommandSubsample::process(), CommandFilterBySFValue::process(), cloudViewer::utility::pybind_scalarfield(), ccEntityAction::rgbGaussianFilter(), SaveScan(), LasDetails::SelectBestVersion(), ccColorScaleEditorDialog::setAssociatedScalarField(), ccColorFromScalarDlg::setDefaultSatValuePerChannel(), ccEntityAction::sfConvertToRandomRGB(), ccEntityAction::sfGaussianFilter(), and ccColorFromScalarDlg::updateSpinBoxLimits().
|
inline |
Returns the minimum value.
Definition at line 72 of file ScalarField.h.
References m_minVal.
Referenced by ccComparisonDlg::computeApproxDistances(), ccEntityAction::computeStatParams(), ccVolumeCalcTool::convertGridToCloud(), ccVolumeCalcTool::ConvertGridToCloud(), define_ScalarField(), ccHistogramWindow::fromSF(), ccRasterizeTool::generateContours(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), LasSaveDialog::handleComboBoxChange(), LoadScan(), ccColorScaleEditorDialog::onStepModified(), CommandSubsample::process(), CommandFilterBySFValue::process(), cloudViewer::utility::pybind_scalarfield(), ccEntityAction::rgbGaussianFilter(), SaveScan(), ccColorScaleEditorDialog::setAssociatedScalarField(), ccColorFromScalarDlg::setDefaultSatValuePerChannel(), ccEntityAction::sfConvertToRandomRGB(), ccEntityAction::sfGaussianFilter(), ccEntityAction::sfSetAsCoord(), and ccColorFromScalarDlg::updateSpinBoxLimits().
|
inline |
Returns scalar field name.
Definition at line 43 of file ScalarField.h.
References m_name.
Referenced by ccScalarFieldArithmeticsDlg::Apply(), CCCloudToDraco(), ccRasterizeTool::ccRasterizeTool(), masc::Classifier::classify(), qCanupoProcess::Classify(), MLSSmoothingUpsampling::compute(), qM3C2Process::Compute(), ccComparisonDlg::computeDistances(), ccEntityAction::computeStatParams(), define_ScalarField(), ccDBRoot::editLabelScalarValue(), ccEntityAction::enhanceRGBWithIntensities(), masc::Classifier::evaluate(), LasExtraScalarFieldCard::fillFrom(), masc::ContextBasedFeature::finish(), masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), LasField::GetLASFields(), ScalarFieldWrapper::getName(), LoadScan(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), PrepareLASField(), CommandSubsample::process(), cloudViewer::utility::pybind_scalarfield(), SFCollector::releaseSFs(), masc::Tools::RetrieveSF(), ccEntityAction::rgbGaussianFilter(), LASFWFFilter::saveToFile(), LasIOFilter::saveToFile(), LASFilter::saveToFile(), ccEntityAction::sfGaussianFilter(), and ccEntityAction::sfRename().
|
inline |
Definition at line 92 of file ScalarField.h.
References ecvColor::LookUpTable::at().
Referenced by ccScalarFieldArithmeticsDlg::Apply(), G3Point::G3PointAction::buildStacksFromG3PointLabelSF(), CCCloudToDraco(), ClusterEmptySpace(), qVoxFallProcess::Compute(), ccHistogramWindow::computeBinArrayFromSF(), ComputePMUncertainty(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedCrossCovarianceMatrix(), DistanceMapGenerationTool::CreateMap(), ccCropTool::Crop(), ccComparisonDlg::determineBestOctreeLevel(), ccSNECloud::drawMeOnly(), ccDBRoot::editLabelScalarValue(), ccCompass::estimateStructureNormals(), masc::Classifier::evaluate(), TreeIso::Final_seg_pcd(), ccRasterizeTool::generateContours(), LasField::getSafeValue(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), ccScalarField::getValueColor(), TreeIso::Intermediate_seg_pcd(), ccCloudLayersHelper::mouseMove(), ccColorFromScalarDlg::onApply(), masc::Feature::PerformMathOp(), ScalarFieldRatioWrapper::pointValue(), masc::ContextBasedFeature::prepare(), cloudViewer::utility::pybind_scalarfield(), RefinePointClassif(), cloudViewer::ICPRegistrationTools::Register(), SaveScan(), ccCloudLayersHelper::saveState(), SimpleBinFilter::saveToFile(), ccEntityAction::sfConvertToRandomRGB(), ecvFilterByLabelDlg::start(), masc::Classifier::train(), and G3Point::G3PointAction::wolman().
|
inline |
Definition at line 93 of file ScalarField.h.
References ecvColor::LookUpTable::at().
|
inlinestatic |
Returns the specific NaN value.
Definition at line 46 of file ScalarField.h.
References NAN_VALUE.
Referenced by define_ScalarField(), flagValueAsInvalid(), and cloudViewer::utility::pybind_scalarfield().
| bool ScalarField::reserveSafe | ( | std::size_t | count | ) |
Reserves memory (no exception thrown)
Definition at line 71 of file ScalarField.cpp.
References count.
Referenced by MeshWrapper< Real >::addDensity(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), DistanceMapGenerationTool::ConvertMapToCloud(), define_ScalarField(), ccRasterizeTool::generateHillshade(), LoadCloud(), SimpleBinFilter::loadFile(), PrepareLASField(), cloudViewer::utility::pybind_scalarfield(), and cloudViewer::ICPRegistrationTools::Register().
| bool ScalarField::resizeSafe | ( | std::size_t | count, |
| bool | initNewElements = false, |
||
| ScalarType | valueForNewElements = 0 |
||
| ) |
Resizes memory (no exception thrown)
Definition at line 81 of file ScalarField.cpp.
References count.
Referenced by cloudViewer::PointCloudTpl< T >::addScalarField(), ccScalarFieldArithmeticsDlg::Apply(), masc::Classifier::classify(), qM3C2Process::Compute(), qVoxFallProcess::Compute(), qM3C2Normals::ComputeCorePointsNormals(), ccComparisonDlg::computeDistances(), define_ScalarField(), cloudViewer::PointCloudTpl< T >::enableScalarField(), cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation(), LoadScan(), masc::PointFeature::prepare(), masc::Feature::PrepareSF(), cloudViewer::utility::pybind_scalarfield(), and cloudViewer::ICPRegistrationTools::Register().
| void ScalarField::setName | ( | const char * | name | ) |
Sets scalar field name.
Definition at line 22 of file ScalarField.cpp.
Referenced by masc::Classifier::classify(), ccComparisonDlg::computeDistances(), ccVolumeCalcTool::convertGridToCloud(), ccVolumeCalcTool::ConvertGridToCloud(), define_ScalarField(), CommandSFRename::process(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::PointCloudTpl< T >::renameScalarField(), ScalarField(), ccEntityAction::sfRename(), and DistanceMapGenerationDlg::updateHeightUnits().
|
inline |
Definition at line 96 of file ScalarField.h.
References ecvColor::LookUpTable::at().
Referenced by ccScalarFieldArithmeticsDlg::Apply(), ccCloudLayersHelper::changeCode(), masc::Classifier::classify(), qCanupoProcess::Classify(), ClusterEmptySpace(), qVoxFallProcess::Compute(), ComputeCorePointDescriptor(), ComputeM3C2DistForPoint(), ComputeMathOpWithNearestNeighbor(), DistanceMapGenerationTool::ComputeRadialDist(), define_ScalarField(), ccDBRoot::editLabelScalarValue(), ccCompass::estimateStructureNormals(), masc::Classifier::evaluate(), GrainsAsEllipsoids::exportResultsAsCloud(), TreeIso::Final_seg_pcd(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), ccRasterizeTool::generateHillshade(), getMortarMaps(), ccEntityAction::importToSF(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), qM3C2Dialog::loadParamsFrom(), LoadScan(), ccCloudLayersHelper::mouseMove(), ccCloudLayersHelper::moveItem(), masc::Feature::PerformMathOp(), masc::ContextBasedFeature::prepare(), masc::PointFeature::prepare(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::ICPRegistrationTools::Register(), ccCloudLayersHelper::restoreState(), and ccEntityAction::sfAddIdField().
|
inline |
Definition at line 103 of file ScalarField.h.
References ecvColor::LookUpTable::at(), and std::swap().
Referenced by cloudViewer::utility::pybind_scalarfield().
|
inlinestatic |
Returns whether a scalar value is valid or not.
Definition at line 61 of file ScalarField.h.
Referenced by ccScalarFieldArithmeticsDlg::Apply(), applySqrtToPointDist(), ComparePointsAndTriangles(), cloudViewer::StatisticalTestingTools::computeAdaptativeChi2Dist(), cloudViewer::ScalarFieldTools::computeCellGaussianFilter(), cloudViewer::WeibullDistribution::computeChi2Dist(), cloudViewer::NormalDistribution::computeChi2Dist(), cloudViewer::WeibullDistribution::ComputeG(), AnglesCustomPlot::computeHistogram(), cloudViewer::ScalarFieldTools::computeKmeans(), cloudViewer::StatisticalTestingTools::computeLocalChi2DistAtLevel(), computeMeanAndVariance(), cloudViewer::ScalarFieldTools::computeMeanGradientOnPatch(), cloudViewer::ScalarFieldTools::computeMeanScalarValue(), cloudViewer::ScalarFieldTools::computeMeanSquareScalarValue(), computeMinAndMax(), cloudViewer::NormalDistribution::computeParameters(), cloudViewer::WeibullDistribution::computeParameters(), DistanceMapGenerationTool::ComputeRadialDist(), cloudViewer::ScalarFieldTools::computeScalarFieldExtremas(), cloudViewer::ScalarFieldTools::computeScalarFieldHistogram(), ccEntityAction::computeStatParams(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedCrossCovarianceMatrix(), cloudViewer::ScalarFieldTools::countScalarFieldValidValues(), countValidValues(), DistanceMapGenerationTool::CreateMap(), define_ScalarField(), cloudViewer::DistanceComputationTools::diff(), ccSubsamplingDlg::enableSFModulation(), cloudViewer::DgmOctree::findNearestNeighborsStartingFromCell(), ccRasterizeTool::generateContours(), cloudViewer::DgmOctree::getPointsInNeighbourCellsAround(), LasField::getSafeValue(), cloudViewer::ScalarFieldTools::multiplyScalarFields(), CommandSubsample::process(), cloudViewer::utility::pybind_scalarfield(), cloudViewer::ICPRegistrationTools::Register(), cloudViewer::CloudSamplingTools::resampleCloudSpatially(), and SaveScan().
|
protected |
Maximum value.
Definition at line 120 of file ScalarField.h.
Referenced by computeMinAndMax(), and getMax().
|
protected |
Minimum value.
Definition at line 118 of file ScalarField.h.
Referenced by computeMinAndMax(), and getMin().
|
protected |
Scalar field name.
Definition at line 115 of file ScalarField.h.
Referenced by getName(), ScalarField(), and setName().