![]() |
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(), ccPointCloud::append(), DistanceMapGenerationTool::ConvertMapToCloud(), ccRasterGrid::convertToCloud(), ccCompass::convertToPointCloud(), pcl2cc::CopyScalarField(), define_ScalarField(), ccCompass::estimateP21(), ccCompass::estimateStrain(), ccCompass::estimateStructureNormals(), ccPointCloud::From(), LoadCloud(), PTXFilter::loadFile(), VTKFilter::loadFile(), SimpleBinFilter::loadFile(), PrepareLASField(), cloudViewer::ICPRegistrationTools::Register(), ccPointCloud::SelectByIndex(), 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 ecvColor::LookUpTable::at(), count, size, and ValidValue().
Referenced by ccComparisonDlg::computeApproxDistances(), ccComparisonDlg::computeDistances(), define_ScalarField(), and CommandFilterBySFValue::process().
|
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(), ccKdTree::convertCellIndexToSF(), ccCompass::convertToPointCloud(), define_ScalarField(), ccCompass::estimateStructureNormals(), ccPointCloud::exportCoordToSF(), ccPointCloud::exportNormalToSF(), 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(), PlyFilter::loadFile(), ccTrace::optimizePath(), masc::Feature::PerformMathOp(), ccGenericPointCloud::pointPicking(), masc::ContextBasedFeature::prepare(), masc::PointFeature::prepare(), CommandExtractCCs::process(), ccEntityAction::processMeshSF(), cloudViewer::ICPRegistrationTools::Register(), ccEntityAction::rgbGaussianFilter(), ccEntityAction::sfAddIdField(), ccEntityAction::sfGaussianFilter(), and ccPointCloud::unroll().
| 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 ccPointCloud::append(), ccScalarFieldArithmeticsDlg::Apply(), ccHistogramWindow::computeBinArrayFromSF(), cloudViewer::DistanceComputationTools::computeCloud2CloudDistances(), ComputeCorePointDescriptor(), qM3C2Normals::ComputeCorePointsNormals(), ccScalarField::computeMinAndMax(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedCrossCovarianceMatrix(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedGravityCenter(), ccRasterizeTool::convertGridToCloud(), ccRasterGrid::convertToCloud(), define_ScalarField(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), ccRasterizeTool::generateContours(), ccRasterizeTool::generateHillshade(), ccPointCloud::getDrawingParameters(), ccEntityAction::importToSF(), PTXFilter::loadFile(), 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(), cloudViewer::DistanceComputationTools::computeCloud2CloudDistances(), cloudViewer::DistanceComputationTools::computeCloud2MeshDistancesWithOctree(), qM3C2Normals::ComputeCorePointsNormals(), ccCropTool::Crop(), define_ScalarField(), TreeIso::Final_seg_pcd(), cloudViewer::MeshSamplingTools::flagMeshVerticesByType(), ccRasterizeTool::generateHillshade(), TreeIso::Init_seg_pcd(), TreeIso::Intermediate_seg_pcd(), ccPointCloudInterpolator::InterpolateScalarFieldsFrom(), masc::Feature::PrepareSF(), and ResolveNormalsWithMST().
|
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(), and LoadScan().
|
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(), ccPointCloud::enhanceRGBWithIntensitySF(), ccHistogramWindow::fromSF(), ccRasterizeTool::generateContours(), LasField::GetLASFields(), ccTrace::getSegmentCostCurve(), ccTrace::getSegmentCostGrad(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), LasSaveDialog::handleComboBoxChange(), PTXFilter::loadFile(), LoadScan(), ccColorScaleEditorDialog::onStepModified(), CommandSubsample::process(), CommandFilterBySFValue::process(), 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(), ccPointCloud::enhanceRGBWithIntensitySF(), ccHistogramWindow::fromSF(), ccRasterizeTool::generateContours(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), LasSaveDialog::handleComboBoxChange(), PTXFilter::loadFile(), LoadScan(), ccColorScaleEditorDialog::onStepModified(), CommandSubsample::process(), CommandFilterBySFValue::process(), 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 ccPointCloud::addScalarField(), ccPointCloud::append(), ccScalarFieldArithmeticsDlg::Apply(), CCCloudToDraco(), ccRasterizeTool::ccRasterizeTool(), masc::Classifier::classify(), qCanupoProcess::Classify(), MLSSmoothingUpsampling::compute(), qM3C2Process::Compute(), ccComparisonDlg::computeDistances(), ccEntityAction::computeStatParams(), ccRasterGrid::convertToCloud(), copyScalarFields(), define_ScalarField(), ccDBRoot::editLabelScalarValue(), ccEntityAction::enhanceRGBWithIntensities(), masc::Classifier::evaluate(), LasExtraScalarFieldCard::fillFrom(), masc::ContextBasedFeature::finish(), masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), ccPointCloud::From(), cc2smReader::getAsSM(), cc2DLabel::getLabelInfo1(), LasField::GetLASFields(), ScalarFieldWrapper::getName(), LoadScan(), ccPointCloud::partialClone(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), PrepareLASField(), CommandSubsample::process(), SFCollector::releaseSFs(), masc::Tools::RetrieveSF(), ccEntityAction::rgbGaussianFilter(), VTKFilter::saveToFile(), LASFWFFilter::saveToFile(), LasIOFilter::saveToFile(), LASFilter::saveToFile(), ccPointCloud::SelectByIndex(), ccEntityAction::sfGaussianFilter(), ccEntityAction::sfRename(), and PclTools::UpdateScalarBar().
|
inline |
Definition at line 92 of file ScalarField.h.
References ecvColor::LookUpTable::at().
Referenced by PclUtils::PCLVis::addScalarFieldToVTK(), ccPointCloud::append(), ccScalarFieldArithmeticsDlg::Apply(), G3Point::G3PointAction::buildStacksFromG3PointLabelSF(), CCCloudToDraco(), cellSFInterpolator(), ClusterEmptySpace(), qVoxFallProcess::Compute(), ccHistogramWindow::computeBinArrayFromSF(), ccScalarField::computeMinAndMax(), ComputePMUncertainty(), cloudViewer::GeometricalAnalysisTools::ComputeWeightedCrossCovarianceMatrix(), copyScalarFields(), DistanceMapGenerationTool::CreateMap(), ccCropTool::Crop(), ccComparisonDlg::determineBestOctreeLevel(), ccSNECloud::drawMeOnly(), ccDBRoot::editLabelScalarValue(), ccPointCloud::enhanceRGBWithIntensitySF(), ccCompass::estimateStructureNormals(), masc::Classifier::evaluate(), ccRasterGrid::fillWith(), TreeIso::Final_seg_pcd(), ccPointCloud::From(), ccRasterizeTool::generateContours(), cc2smReader::getFloatScalarField(), ccPointCloud::getPointDisplayedDistance(), LasField::getSafeValue(), ccTrace::getSegmentCostScalar(), ccTrace::getSegmentCostScalarInv(), ccScalarField::getValueColor(), cc2smReader::getvtkScalars(), ccPointCloud::hidePointsByScalarValue(), TreeIso::Intermediate_seg_pcd(), ccCloudLayersHelper::mouseMove(), ccColorFromScalarDlg::onApply(), ccPointCloud::partialClone(), masc::Feature::PerformMathOp(), ccGenericPointCloud::pointPicking(), ccOctree::pointPicking(), ScalarFieldRatioWrapper::pointValue(), masc::ContextBasedFeature::prepare(), RefinePointClassif(), cloudViewer::ICPRegistrationTools::Register(), ccPointCloud::RemoveNonFinitePoints(), SaveScan(), ccCloudLayersHelper::saveState(), VTKFilter::saveToFile(), SimpleBinFilter::saveToFile(), ccPointCloud::SelectByIndex(), ccPointCloud::setCoordFromSF(), 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 ccPointCloud::append(), ccRasterGrid::convertToCloud(), define_ScalarField(), and flagValueAsInvalid().
| 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(), ccPointCloud::addScalarField(), cloudViewer::ScalarFieldTools::computeScalarFieldGradient(), DistanceMapGenerationTool::ConvertMapToCloud(), vtk2cc::ConvertToPointCloud(), pcl2cc::CopyScalarField(), define_ScalarField(), ccRasterizeTool::generateHillshade(), LoadCloud(), PTXFilter::loadFile(), VTKFilter::loadFile(), SimpleBinFilter::loadFile(), PrepareLASField(), cloudViewer::ICPRegistrationTools::Register(), and ccPointCloud::SelectByIndex().
| 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 ccPointCloud::addScalarField(), cloudViewer::PointCloudTpl< T >::addScalarField(), ccPointCloud::append(), ccScalarFieldArithmeticsDlg::Apply(), masc::Classifier::classify(), qM3C2Process::Compute(), qVoxFallProcess::Compute(), qM3C2Normals::ComputeCorePointsNormals(), ccComparisonDlg::computeDistances(), ccPointCloud::convertNormalToDipDirSFs(), ccRasterGrid::convertToCloud(), vtk2cc::ConvertToPointCloud(), copyScalarFields(), define_ScalarField(), cloudViewer::PointCloudTpl< T >::enableScalarField(), cloudViewer::AutoSegmentationTools::frontPropagationBasedSegmentation(), PlyFilter::loadFile(), LoadScan(), ccPointCloud::partialClone(), masc::PointFeature::prepare(), masc::Feature::PrepareSF(), cloudViewer::ICPRegistrationTools::Register(), and ccPointCloud::RemoveNonFinitePoints().
| 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::PointCloudTpl< T >::renameScalarField(), ScalarField(), ccEntityAction::sfRename(), and DistanceMapGenerationDlg::updateHeightUnits().
|
inline |
Definition at line 96 of file ScalarField.h.
References ecvColor::LookUpTable::at().
Referenced by ccPointCloud::append(), ccScalarFieldArithmeticsDlg::Apply(), ccCloudLayersHelper::changeCode(), masc::Classifier::classify(), qCanupoProcess::Classify(), ClusterEmptySpace(), qVoxFallProcess::Compute(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistance(), cloudViewer::DistanceComputationTools::computeCellHausdorffDistanceWithLocalModel(), ComputeCorePointDescriptor(), ComputeM3C2DistForPoint(), ComputeMathOpWithNearestNeighbor(), DistanceMapGenerationTool::ComputeRadialDist(), ccPointCloud::convertNormalToDipDirSFs(), ccRasterGrid::convertToCloud(), vtk2cc::ConvertToPointCloud(), copyScalarFields(), define_ScalarField(), ccDBRoot::editLabelScalarValue(), ccCompass::estimateStructureNormals(), masc::Classifier::evaluate(), ccPointCloud::exportCoordToSF(), ccPointCloud::exportNormalToSF(), 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(), ccPointCloud::partialClone(), masc::Feature::PerformMathOp(), masc::ContextBasedFeature::prepare(), masc::PointFeature::prepare(), cloudViewer::ICPRegistrationTools::Register(), ccPointCloud::RemoveNonFinitePoints(), ResolveNormalsWithMST(), ccCloudLayersHelper::restoreState(), scalar_cb(), ccEntityAction::sfAddIdField(), and ccPointCloud::unroll().
|
inline |
Definition at line 103 of file ScalarField.h.
References ecvColor::LookUpTable::at(), and std::swap().
|
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(), ComputeCellGaussianFilter(), 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(), ccRasterGrid::fillWith(), cloudViewer::DgmOctree::findNearestNeighborsStartingFromCell(), ccRasterizeTool::generateContours(), cc2DLabel::getLabelInfo1(), cloudViewer::DgmOctree::getPointsInNeighbourCellsAround(), LasField::getSafeValue(), cc2DLabel::GetSFValueAsString(), cloudViewer::ScalarFieldTools::multiplyScalarFields(), CommandSubsample::process(), cloudViewer::ICPRegistrationTools::Register(), cloudViewer::CloudSamplingTools::resampleCloudSpatially(), SaveScan(), and ccPointCloud::setCoordFromSF().
|
protected |
Maximum value.
Definition at line 120 of file ScalarField.h.
Referenced by computeMinAndMax(), ccScalarField::computeMinAndMax(), getMax(), and ccScalarField::updateSaturationBounds().
|
protected |
Minimum value.
Definition at line 118 of file ScalarField.h.
Referenced by computeMinAndMax(), ccScalarField::computeMinAndMax(), getMin(), ccScalarField::setLogScale(), and ccScalarField::updateSaturationBounds().
|
protected |
Scalar field name.
Definition at line 115 of file ScalarField.h.
Referenced by getName(), ccScalarField::minimumFileVersion(), ScalarField(), and setName().