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


Public Types | |
| enum | NeighborhoodFeatureType { Invalid = 0 , PCA1 , PCA2 , PCA3 , SPHER , LINEA , PLANA , Dip , DipDir , ROUGH , NBPTS , CURV , ZRANGE , Zmax , Zmin , ANISO , FOM , VERT } |
| typedef QSharedPointer< NeighborhoodFeature > | 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 | |
| NeighborhoodFeature (NeighborhoodFeatureType p_type) | |
| Default constructor. 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 | computeValue (cloudViewer::DgmOctree::NeighboursSet &pointsInNeighbourhood, const CCVector3 &queryPoint, double &outputValue) const |
| Compute the feature value on a set of points. More... | |
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 (NeighborhoodFeatureType type) |
| static NeighborhoodFeatureType | FromString (const QString &token) |
| static NeighborhoodFeatureType | 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 | |
| NeighborhoodFeatureType | type |
| Neighborhood feature type. More... | |
| cloudViewer::ScalarField * | sf1 |
| Feature values. More... | |
| cloudViewer::ScalarField * | sf2 |
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 |
Neighborhood-based feature.
Definition at line 32 of file NeighborhoodFeature.h.
| typedef QSharedPointer<NeighborhoodFeature> masc::NeighborhoodFeature::Shared |
Definition at line 34 of file NeighborhoodFeature.h.
| Enumerator | |
|---|---|
| Invalid | |
| PCA1 | |
| PCA2 | |
| PCA3 | |
| SPHER | |
| LINEA | |
| PLANA | |
| Dip | |
| DipDir | |
| ROUGH | |
| NBPTS | |
| CURV | |
| ZRANGE | |
| Zmax | |
| Zmin | |
| ANISO | |
| FOM | |
| VERT | |
Definition at line 36 of file NeighborhoodFeature.h.
|
inline |
|
overridevirtual |
Checks the feature definition validity.
Reimplemented from masc::Feature.
Definition at line 17 of file NeighborhoodFeature.cpp.
References masc::Feature::checkValidity(), masc::Feature::cloud2, error(), Invalid, masc::Feature::NO_OPERATION, masc::Feature::NO_STAT, masc::Feature::op, masc::Feature::scale, masc::Feature::stat, and type.
Referenced by prepare().
|
inlineoverridevirtual |
Clones this feature.
Implements masc::Feature.
Definition at line 161 of file NeighborhoodFeature.h.
References NeighborhoodFeature().
| bool NeighborhoodFeature::computeValue | ( | cloudViewer::DgmOctree::NeighboursSet & | pointsInNeighbourhood, |
| const CCVector3 & | queryPoint, | ||
| double & | outputValue | ||
| ) | const |
Compute the feature value on a set of points.
Definition at line 196 of file NeighborhoodFeature.cpp.
References ANISO, cloudViewer::Neighbourhood::computeCurvature(), cloudViewer::Neighbourhood::computeFeature(), cloudViewer::Neighbourhood::computeMomentOrder1(), cloudViewer::Neighbourhood::computeRoughness(), ccNormalVectors::ConvertNormalToDipAndDipDir(), CURV, Dip, DipDir, FOM, cloudViewer::Neighbourhood::getGravityCenter(), cloudViewer::Neighbourhood::getLSPlaneNormal(), LINEA, cloudViewer::Neighbourhood::Linearity, NBPTS, PC_ONE, cloudViewer::Neighbourhood::PCA1, PCA1, cloudViewer::Neighbourhood::PCA2, PCA2, PCA3, PLANA, cloudViewer::Neighbourhood::Planarity, ROUGH, SPHER, cloudViewer::Neighbourhood::Sphericity, cloudViewer::Neighbourhood::SurfaceVariation, type, VERT, cloudViewer::Neighbourhood::Verticality, CVLog::Warning(), Tuple3Tpl< Type >::z, Zmax, Zmin, and ZRANGE.
|
overridevirtual |
Finishes the feature preparation (update the scalar field, etc.)
Reimplemented from masc::Feature.
Definition at line 122 of file NeighborhoodFeature.cpp.
References cloudViewer::ScalarField::computeMinAndMax(), corePoints, error(), cloudViewer::ScalarField::getName(), masc::Feature::NO_OPERATION, masc::Feature::op, masc::Feature::PerformMathOp(), sf1, masc::Feature::sf1WasAlreadyExisting, and sf2.
|
inlinestatic |
Definition at line 108 of file NeighborhoodFeature.h.
References FromUpperString().
|
inlinestatic |
|
inlineoverridevirtual |
Returns the type (must be reimplemented by child struct)
Implements masc::Feature.
Definition at line 160 of file NeighborhoodFeature.h.
References masc::Feature::NeighborhoodFeature.
|
overridevirtual |
Prepares the feature (compute the scalar field, etc.)
Implements masc::Feature.
Definition at line 49 of file NeighborhoodFeature.cpp.
References SFCollector::ALWAYS_KEEP, SFCollector::ALWAYS_REMOVE, SFCollector::CAN_REMOVE, masc::Feature::CheckSFExistence(), checkValidity(), masc::Feature::cloud1, masc::Feature::cloud1Label, masc::Feature::cloud2, masc::Feature::cloud2Label, corePoints, error(), cloudViewer::ScalarField::getName(), masc::Feature::Source::name, masc::Feature::NO_OPERATION, masc::Feature::op, masc::Feature::OpToString(), masc::Feature::PrepareSF(), SFCollector::scalarFields, masc::Feature::scale, SFCollector::setBehavior(), sf1, masc::Feature::sf1WasAlreadyExisting, sf2, masc::Feature::sf2WasAlreadyExisting, masc::Feature::source, ToString(), and type.
|
overridevirtual |
Returns the formatted description.
Implements masc::Feature.
Definition at line 179 of file NeighborhoodFeature.cpp.
References masc::Feature::cloud1Label, masc::Feature::cloud2, masc::Feature::cloud2Label, masc::Feature::NO_OPERATION, masc::Feature::op, masc::Feature::OpToString(), masc::Feature::scale, ToString(), and type.
|
inlinestatic |
| cloudViewer::ScalarField* masc::NeighborhoodFeature::sf1 |
Feature values.
Definition at line 187 of file NeighborhoodFeature.h.
| cloudViewer::ScalarField * masc::NeighborhoodFeature::sf2 |
Definition at line 187 of file NeighborhoodFeature.h.
| NeighborhoodFeatureType masc::NeighborhoodFeature::type |
Neighborhood feature type.
Definition at line 184 of file NeighborhoodFeature.h.
Referenced by checkValidity(), computeValue(), prepare(), toString(), and ToString().