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

Point feature. More...

#include <PointFeature.h>

Inheritance diagram for masc::PointFeature:
Collaboration diagram for masc::PointFeature:

Public Types

enum  PointFeatureType {
  Invalid = 0 , Intensity , X , Y ,
  Z , NbRet , RetNb , EchoRat ,
  R , G , B , NIR ,
  Dip , DipDir , M3C2 , PCV ,
  SF
}
 
typedef QSharedPointer< PointFeatureShared
 
- 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

 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::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

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::ScalarFieldstatSF1
 For scaled features. More...
 
cloudViewer::ScalarFieldstatSF2
 
- 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
 

Protected Member Functions

IScalarFieldWrapper::Shared retrieveField (ccPointCloud *cloud, QString &error)
 Returns the 'source' field from a given cloud. More...
 

Detailed Description

Point feature.

Definition at line 36 of file PointFeature.h.

Member Typedef Documentation

◆ Shared

typedef QSharedPointer<PointFeature> masc::PointFeature::Shared

Definition at line 38 of file PointFeature.h.

Member Enumeration Documentation

◆ PointFeatureType

Enumerator
Invalid 
Intensity 
NbRet 
RetNb 
EchoRat 
NIR 
Dip 
DipDir 
M3C2 
PCV 
SF 

Definition at line 40 of file PointFeature.h.

Constructor & Destructor Documentation

◆ PointFeature()

◆ ~PointFeature()

masc::PointFeature::~PointFeature ( )
inlineoverride

Destructor.

Definition at line 181 of file PointFeature.h.

Member Function Documentation

◆ checkValidity()

◆ clone()

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

Clones this feature.

Implements masc::Feature.

Definition at line 185 of file PointFeature.h.

References PointFeature().

◆ computeStat()

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.

◆ finish()

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

◆ FromString()

static PointFeatureType masc::PointFeature::FromString ( const QString &  token)
inlinestatic

Definition at line 103 of file PointFeature.h.

References FromUpperString().

◆ FromUpperString()

static PointFeatureType masc::PointFeature::FromUpperString ( const QString &  token)
inlinestatic

Definition at line 107 of file PointFeature.h.

References B, Dip, DipDir, EchoRat, G, Intensity, Invalid, M3C2, NbRet, NIR, PCV, R, RetNb, SF, X, Y, and Z.

Referenced by CreateFeaturesFromCommand(), and FromString().

◆ getType()

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

◆ prepare()

◆ retrieveField()

◆ toString()

◆ ToString()

static QString masc::PointFeature::ToString ( PointFeatureType  type)
inlinestatic

Definition at line 60 of file PointFeature.h.

References B, Dip, DipDir, EchoRat, G, Intensity, Invalid, M3C2, NbRet, NIR, PCV, R, RetNb, SF, type, X, Y, and Z.

Referenced by toString().

Member Data Documentation

◆ field1

IScalarFieldWrapper::Shared masc::PointFeature::field1

First cloud 'source' field.

Definition at line 220 of file PointFeature.h.

Referenced by prepare().

◆ field2

IScalarFieldWrapper::Shared masc::PointFeature::field2

Second cloud 'source' field (if any)

Definition at line 223 of file PointFeature.h.

Referenced by prepare().

◆ sourceSFIndex

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().

◆ statSF1

cloudViewer::ScalarField* masc::PointFeature::statSF1

For scaled features.

Definition at line 226 of file PointFeature.h.

Referenced by finish(), and prepare().

◆ statSF2

cloudViewer::ScalarField* masc::PointFeature::statSF2

Definition at line 227 of file PointFeature.h.

Referenced by finish(), and prepare().

◆ type

PointFeatureType masc::PointFeature::type

Point feature type.

Warning
different from the feature type

Definition at line 214 of file PointFeature.h.

Referenced by checkValidity(), PointFeature(), retrieveField(), toString(), and ToString().


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