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


Public Types | |
| enum | PointFeatureType { Invalid = 0 , Intensity , X , Y , Z , NbRet , RetNb , EchoRat , R , G , B , NIR , Dip , DipDir , M3C2 , PCV , SF } |
| typedef QSharedPointer< PointFeature > | Shared |
Public Types inherited from masc::Feature | |
| enum class | Type { PointFeature , NeighborhoodFeature , ContextBasedFeature , DualCloudFeature , Invalid } |
| Feature type. More... | |
| enum | Stat { NO_STAT , MEAN , MODE , MEDIAN , STD , RANGE , SKEW } |
| enum | Operation { NO_OPERATION , MINUS , PLUS , DIVIDE , MULTIPLY } |
| typedef QSharedPointer< Feature > | Shared |
| Shared type. More... | |
| typedef std::vector< Shared > | Set |
| Set of features. More... | |
Public Member Functions | |
| PointFeature (PointFeatureType p_type) | |
| Default constructor. More... | |
| ~PointFeature () override | |
| Destructor. More... | |
| virtual Type | getType () const override |
| Returns the type (must be reimplemented by child struct) More... | |
| virtual Feature::Shared | clone () const override |
| Clones this feature. More... | |
| virtual bool | prepare (const CorePoints &corePoints, QString &error, cloudViewer::GenericProgressCallback *progressCb=nullptr, SFCollector *generatedScalarFields=nullptr) override |
| Prepares the feature (compute the scalar field, etc.) More... | |
| virtual bool | finish (const CorePoints &corePoints, QString &error) override |
| Finishes the feature preparation (update the scalar field, etc.) More... | |
| virtual bool | checkValidity (QString corePointRole, QString &error) const override |
| Checks the feature definition validity. More... | |
| virtual QString | toString () const override |
| Returns the formatted description. More... | |
| bool | computeStat (const cloudViewer::DgmOctree::NeighboursSet &pointsInNeighbourhood, const IScalarFieldWrapper::Shared &sourceField, double &outputValue) const |
Public Member Functions inherited from masc::Feature | |
| Feature (double p_scale=std::numeric_limits< double >::quiet_NaN(), Source::Type p_source=Source::ScalarField, QString p_sourceName=QString()) | |
| Default constructor. More... | |
| virtual | ~Feature () |
| Destructor. More... | |
| bool | scaled () const |
| Returns whether the feature has an associated scale. More... | |
Static Public Member Functions | |
| static QString | ToString (PointFeatureType type) |
| static PointFeatureType | FromString (const QString &token) |
| static PointFeatureType | FromUpperString (const QString &token) |
Static Public Member Functions inherited from masc::Feature | |
| static QString | StatToString (Stat stat) |
| static QString | OpToString (Operation op) |
| static bool | ExtractSources (const Set &features, Source::Set &sources) |
| Extracts the set of 'sources' from a set of features. More... | |
| static bool | SaveSources (const Source::Set &sources, QString filename) |
| Saves a set of 'sources' to a file. More... | |
| static bool | LoadSources (Source::Set &sources, QString filename) |
| Loads a set of 'sources' from a file. More... | |
| static bool | CheckSFExistence (ccPointCloud *cloud, const char *resultSFName) |
| static cloudViewer::ScalarField * | PrepareSF (ccPointCloud *cloud, const char *resultSFName, SFCollector *generatedScalarFields, SFCollector::Behavior behavior) |
| static ScalarType | PerformMathOp (double s1, double s2, Operation op) |
| Performs a mathematical operation between two scalars. More... | |
| static bool | PerformMathOp (cloudViewer::ScalarField *sf1, const cloudViewer::ScalarField *sf2, Operation op) |
| static bool | PerformMathOp (const IScalarFieldWrapper &sf1, const IScalarFieldWrapper &sf2, Operation op, cloudViewer::ScalarField *outSF) |
Public Attributes | |
| PointFeatureType | type |
| Point feature type. More... | |
| int | sourceSFIndex |
| Source scalar field index (if the feature source is 'ScalarField') More... | |
| IScalarFieldWrapper::Shared | field1 |
| First cloud 'source' field. More... | |
| IScalarFieldWrapper::Shared | field2 |
| Second cloud 'source' field (if any) More... | |
| cloudViewer::ScalarField * | statSF1 |
| For scaled features. More... | |
| cloudViewer::ScalarField * | statSF2 |
Public Attributes inherited from masc::Feature | |
| double | scale |
| Scale (diameter) More... | |
| ccPointCloud * | cloud1 |
| ccPointCloud * | cloud2 |
| QString | cloud1Label |
| QString | cloud2Label |
| Source | source |
| Stat | stat |
| Operation | op |
| bool | sf1WasAlreadyExisting |
| bool | sf2WasAlreadyExisting |
Protected Member Functions | |
| IScalarFieldWrapper::Shared | retrieveField (ccPointCloud *cloud, QString &error) |
| Returns the 'source' field from a given cloud. More... | |
Point feature.
Definition at line 36 of file PointFeature.h.
| typedef QSharedPointer<PointFeature> masc::PointFeature::Shared |
Definition at line 38 of file PointFeature.h.
| Enumerator | |
|---|---|
| Invalid | |
| Intensity | |
| X | |
| Y | |
| Z | |
| NbRet | |
| RetNb | |
| EchoRat | |
| R | |
| G | |
| B | |
| NIR | |
| Dip | |
| DipDir | |
| M3C2 | |
| PCV | |
| SF | |
Definition at line 40 of file PointFeature.h.
|
inline |
Default constructor.
Definition at line 146 of file PointFeature.h.
References B, masc::Feature::Source::Blue, masc::Feature::Source::DimX, masc::Feature::Source::DimY, masc::Feature::Source::DimZ, G, masc::Feature::Source::Green, R, masc::Feature::Source::Red, masc::Feature::Source::ScalarField, masc::Feature::source, type, X, Y, and Z.
Referenced by clone().
|
inlineoverride |
Destructor.
Definition at line 181 of file PointFeature.h.
|
overridevirtual |
Checks the feature definition validity.
Reimplemented from masc::Feature.
Definition at line 99 of file PointFeature.cpp.
References B, masc::Feature::checkValidity(), masc::Feature::cloud1, masc::Feature::cloud1Label, masc::Feature::cloud2, Dip, DipDir, EchoRat, error(), G, ccObject::getName(), cloudViewer::PointCloudTpl< T >::getNumberOfScalarFields(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), Intensity, Invalid, LAS_FIELD_NAMES, LAS_INTENSITY, LAS_NUMBER_OF_RETURNS, LAS_RETURN_NUMBER, M3C2, NbRet, NIR, masc::Feature::NO_OPERATION, masc::Feature::NO_STAT, masc::Feature::op, PCV, R, RetNb, s_M3C2SFName, s_NIRSFName, s_PCVSFName, masc::Feature::scaled(), SF, sourceSFIndex, masc::Feature::stat, type, X, Y, and Z.
|
inlineoverridevirtual |
Clones this feature.
Implements masc::Feature.
Definition at line 185 of file PointFeature.h.
References PointFeature().
| bool PointFeature::computeStat | ( | const cloudViewer::DgmOctree::NeighboursSet & | pointsInNeighbourhood, |
| const IScalarFieldWrapper::Shared & | sourceField, | ||
| double & | outputValue | ||
| ) | const |
Compute the associated 'stat' on a set of points (and with a given field)
Definition at line 683 of file PointFeature.cpp.
References masc::Feature::MEAN, masc::Feature::MEDIAN, masc::Feature::MODE, masc::Feature::NO_STAT, masc::Feature::RANGE, masc::Feature::SKEW, masc::Feature::stat, and masc::Feature::STD.
|
overridevirtual |
Finishes the feature preparation (update the scalar field, etc.)
Reimplemented from masc::Feature.
Definition at line 799 of file PointFeature.cpp.
References cloudViewer::ScalarField::computeMinAndMax(), corePoints, error(), cloudViewer::ScalarField::getName(), masc::Feature::NO_OPERATION, masc::Feature::op, masc::Feature::PerformMathOp(), masc::Feature::scaled(), masc::Feature::sf1WasAlreadyExisting, statSF1, and statSF2.
|
inlinestatic |
Definition at line 103 of file PointFeature.h.
References FromUpperString().
|
inlinestatic |
|
inlineoverridevirtual |
Returns the type (must be reimplemented by child struct)
Implements masc::Feature.
Definition at line 184 of file PointFeature.h.
References masc::Feature::PointFeature.
|
overridevirtual |
Prepares the feature (compute the scalar field, etc.)
Implements masc::Feature.
Definition at line 491 of file PointFeature.cpp.
References SFCollector::ALWAYS_KEEP, SFCollector::ALWAYS_REMOVE, SFCollector::CAN_REMOVE, masc::Feature::CheckSFExistence(), masc::Feature::cloud1, masc::Feature::cloud1Label, masc::Feature::cloud2, masc::Feature::cloud2Label, ComputeMathOpWithNearestNeighbor(), cloudViewer::ScalarField::computeMinAndMax(), corePoints, error(), field1, field2, cloudViewer::ScalarField::getName(), masc::Feature::Source::name, masc::Feature::NO_OPERATION, masc::Feature::NO_STAT, masc::Feature::op, masc::Feature::OpToString(), masc::Feature::PrepareSF(), SFCollector::push(), CCShareable::release(), cloudViewer::ScalarField::resizeSafe(), retrieveField(), SFCollector::scalarFields, masc::Feature::scale, masc::Feature::scaled(), SFCollector::setBehavior(), cloudViewer::ScalarField::setValue(), masc::Feature::sf1WasAlreadyExisting, masc::Feature::sf2WasAlreadyExisting, cloudViewer::GenericCloud::size(), masc::Feature::source, masc::Feature::stat, statSF1, statSF2, and masc::Feature::StatToString().
|
protected |
Returns the 'source' field from a given cloud.
Definition at line 244 of file PointFeature.cpp.
References B, ColorScalarFieldWrapper::Blue, DimScalarFieldWrapper::DimX, DimScalarFieldWrapper::DimY, DimScalarFieldWrapper::DimZ, Dip, NormDipAndDipDirFieldWrapper::Dip, DipDir, NormDipAndDipDirFieldWrapper::DipDir, EchoRat, error(), G, cloudViewer::PointCloudTpl< T >::getNumberOfScalarFields(), cloudViewer::PointCloudTpl< T >::getScalarField(), ColorScalarFieldWrapper::Green, ccPointCloud::hasNormals(), Intensity, LAS_FIELD_NAMES, LAS_INTENSITY, LAS_NUMBER_OF_RETURNS, LAS_RETURN_NUMBER, M3C2, NbRet, NIR, PCV, R, ColorScalarFieldWrapper::Red, RetNb, masc::Tools::RetrieveSF(), s_M3C2SFName, s_NIRSFName, s_PCVSFName, SF, cloudViewer::PointCloudTpl< T >::size(), sourceSFIndex, type, X, Y, and Z.
Referenced by prepare().
|
overridevirtual |
Returns the formatted description.
Implements masc::Feature.
Definition at line 859 of file PointFeature.cpp.
References masc::Feature::cloud1Label, masc::Feature::cloud2, masc::Feature::cloud2Label, masc::Feature::NO_OPERATION, masc::Feature::op, masc::Feature::OpToString(), masc::Feature::scale, masc::Feature::scaled(), SF, sourceSFIndex, masc::Feature::stat, masc::Feature::StatToString(), ToString(), and type.
|
inlinestatic |
| IScalarFieldWrapper::Shared masc::PointFeature::field1 |
| IScalarFieldWrapper::Shared masc::PointFeature::field2 |
Second cloud 'source' field (if any)
Definition at line 223 of file PointFeature.h.
Referenced by prepare().
| int masc::PointFeature::sourceSFIndex |
Source scalar field index (if the feature source is 'ScalarField')
Definition at line 217 of file PointFeature.h.
Referenced by checkValidity(), CreateFeaturesFromCommand(), retrieveField(), and toString().
| cloudViewer::ScalarField* masc::PointFeature::statSF1 |
For scaled features.
Definition at line 226 of file PointFeature.h.
| cloudViewer::ScalarField* masc::PointFeature::statSF2 |
Definition at line 227 of file PointFeature.h.
| PointFeatureType masc::PointFeature::type |
Point feature type.
Definition at line 214 of file PointFeature.h.
Referenced by checkValidity(), PointFeature(), retrieveField(), toString(), and ToString().