ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
masc::NeighborhoodFeature Struct Reference

Neighborhood-based feature. More...

#include <NeighborhoodFeature.h>

Inheritance diagram for masc::NeighborhoodFeature:
Collaboration diagram for masc::NeighborhoodFeature:

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< NeighborhoodFeatureShared
 
- 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< FeatureShared
 Shared type. More...
 
typedef std::vector< SharedSet
 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::ScalarFieldPrepareSF (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::ScalarFieldsf1
 Feature values. More...
 
cloudViewer::ScalarFieldsf2
 
- Public Attributes inherited from masc::Feature
double scale
 Scale (diameter) More...
 
ccPointCloudcloud1
 
ccPointCloudcloud2
 
QString cloud1Label
 
QString cloud2Label
 
Source source
 
Stat stat
 
Operation op
 
bool sf1WasAlreadyExisting
 
bool sf2WasAlreadyExisting
 

Detailed Description

Neighborhood-based feature.

Definition at line 32 of file NeighborhoodFeature.h.

Member Typedef Documentation

◆ Shared

Definition at line 34 of file NeighborhoodFeature.h.

Member Enumeration Documentation

◆ NeighborhoodFeatureType

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.

Constructor & Destructor Documentation

◆ NeighborhoodFeature()

masc::NeighborhoodFeature::NeighborhoodFeature ( NeighborhoodFeatureType  p_type)
inline

Default constructor.

Definition at line 156 of file NeighborhoodFeature.h.

Referenced by clone().

Member Function Documentation

◆ checkValidity()

bool NeighborhoodFeature::checkValidity ( QString  corePointRole,
QString &  error 
) const
overridevirtual

◆ clone()

virtual Feature::Shared masc::NeighborhoodFeature::clone ( ) const
inlineoverridevirtual

Clones this feature.

Implements masc::Feature.

Definition at line 161 of file NeighborhoodFeature.h.

References NeighborhoodFeature().

◆ computeValue()

◆ finish()

bool NeighborhoodFeature::finish ( const CorePoints corePoints,
QString &  error 
)
overridevirtual

◆ FromString()

static NeighborhoodFeatureType masc::NeighborhoodFeature::FromString ( const QString &  token)
inlinestatic

Definition at line 108 of file NeighborhoodFeature.h.

References FromUpperString().

◆ FromUpperString()

static NeighborhoodFeatureType masc::NeighborhoodFeature::FromUpperString ( const QString &  token)
inlinestatic

Definition at line 111 of file NeighborhoodFeature.h.

References ANISO, CURV, Dip, DipDir, FOM, Invalid, LINEA, NBPTS, PCA1, PCA2, PCA3, PLANA, ROUGH, SPHER, VERT, Zmax, Zmin, and ZRANGE.

Referenced by CreateFeaturesFromCommand(), and FromString().

◆ getType()

virtual Type masc::NeighborhoodFeature::getType ( ) const
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.

◆ prepare()

◆ toString()

QString NeighborhoodFeature::toString ( ) const
overridevirtual

◆ ToString()

static QString masc::NeighborhoodFeature::ToString ( NeighborhoodFeatureType  type)
inlinestatic

Definition at line 59 of file NeighborhoodFeature.h.

References ANISO, CURV, Dip, DipDir, FOM, Invalid, LINEA, NBPTS, PCA1, PCA2, PCA3, PLANA, ROUGH, SPHER, type, VERT, Zmax, Zmin, and ZRANGE.

Referenced by prepare(), and toString().

Member Data Documentation

◆ sf1

cloudViewer::ScalarField* masc::NeighborhoodFeature::sf1

Feature values.

Definition at line 187 of file NeighborhoodFeature.h.

Referenced by finish(), and prepare().

◆ sf2

cloudViewer::ScalarField * masc::NeighborhoodFeature::sf2

Definition at line 187 of file NeighborhoodFeature.h.

Referenced by finish(), and prepare().

◆ type

NeighborhoodFeatureType masc::NeighborhoodFeature::type

Neighborhood feature type.

Warning
different from the feature type

Definition at line 184 of file NeighborhoodFeature.h.

Referenced by checkValidity(), computeValue(), prepare(), toString(), and ToString().


The documentation for this struct was generated from the following files: