49 typedef QSharedPointer<Feature>
Shared;
52 typedef std::vector<Shared>
Set;
115 using Set = std::vector<Source>;
138 Feature(
double p_scale = std::numeric_limits<double>::quiet_NaN(),
140 QString p_sourceName = QString())
144 source(p_source, p_sourceName),
180 unsigned char cloudCount = (
cloud1 ? (
cloud2 ? 2 : 1) : 0);
181 if (cloudCount == 0) {
182 error =
"feature has no associated cloud";
187 error =
"STAT measures can only be defined on Point features";
192 error =
"at least two clouds are required to apply math operations";
208 const char* resultSFName,
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A simple scalar field (to be associated to a point cloud)
static void error(char *msg)
Sources of values for this feature.
Source(Type t=ScalarField, QString n=QString())
std::vector< Source > Set
Generic feature descriptor.
virtual ~Feature()
Destructor.
static bool CheckSFExistence(ccPointCloud *cloud, const char *resultSFName)
static bool ExtractSources(const Set &features, Source::Set &sources)
Extracts the set of 'sources' from a set of features.
virtual bool checkValidity(QString corePointRole, QString &error) const
Checks the feature definition validity.
static bool SaveSources(const Source::Set &sources, QString filename)
Saves a set of 'sources' to a file.
virtual Feature::Shared clone() const =0
Clones this feature.
std::vector< Shared > Set
Set of features.
virtual bool finish(const CorePoints &corePoints, QString &error)
Finishes the feature preparation (update the scalar field, etc.)
static bool LoadSources(Source::Set &sources, QString filename)
Loads a set of 'sources' from a file.
virtual bool prepare(const CorePoints &corePoints, QString &error, cloudViewer::GenericProgressCallback *progressCb=nullptr, SFCollector *generatedScalarFields=nullptr)=0
Prepares the feature (compute the scalar field, etc.)
QSharedPointer< Feature > Shared
Shared type.
virtual Type getType() const =0
Returns the type (must be reimplemented by child struct)
bool scaled() const
Returns whether the feature has an associated scale.
static QString StatToString(Stat stat)
virtual QString toString() const =0
Returns the formatted description.
bool sf2WasAlreadyExisting
static ScalarType PerformMathOp(double s1, double s2, Operation op)
Performs a mathematical operation between two scalars.
Feature(double p_scale=std::numeric_limits< double >::quiet_NaN(), Source::Type p_source=Source::ScalarField, QString p_sourceName=QString())
Default constructor.
static QString OpToString(Operation op)
double scale
Scale (diameter)
static cloudViewer::ScalarField * PrepareSF(ccPointCloud *cloud, const char *resultSFName, SFCollector *generatedScalarFields, SFCollector::Behavior behavior)
bool sf1WasAlreadyExisting