ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DualCloudFeature.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include "DualCloudFeature.h"
9 
10 using namespace masc;
11 
13  const CorePoints& corePoints,
14  QString& error,
15  cloudViewer::GenericProgressCallback* progressCb /*=nullptr*/,
16  SFCollector* generatedScalarFields /*=nullptr*/) {
17  // TODO
18  return false;
19 }
20 
21 QString DualCloudFeature::toString() const {
22  // use the default keyword + "_SC" + the scale
23  return ToString(type) + "_SC" + QString::number(scale);
24 }
25 
26 bool DualCloudFeature::checkValidity(QString corePointRole,
27  QString& error) const {
28  if (!Feature::checkValidity(corePointRole, error)) {
29  return false;
30  }
31 
32  unsigned char cloudCount = (cloud1 ? (cloud2 ? 2 : 1) : 0);
33  if (cloudCount < 2) {
34  error = "at least two clouds are required to compute context-based "
35  "features";
36  return false;
37  }
38 
39  if (op != NO_OPERATION) {
40  error = "math operations can't be defined on dual-cloud features";
41  return false;
42  }
43 
44  return true;
45 }
SF collector.
static void error(char *msg)
Definition: lsd.c:159
3DMASC classifier
cloudViewer::GenericIndexedCloud * corePoints
Core points descriptor.
Definition: CorePoints.h:39
DualCloudFeatureType type
Dual-cloud feature type.
virtual bool checkValidity(QString corePointRole, QString &error) const override
Checks the feature definition validity.
static QString ToString(DualCloudFeatureType type)
virtual QString toString() const override
Returns the formatted description.
virtual bool prepare(const CorePoints &corePoints, QString &error, cloudViewer::GenericProgressCallback *progressCb=nullptr, SFCollector *generatedScalarFields=nullptr) override
Prepares the feature (compute the scalar field, etc.)
virtual bool checkValidity(QString corePointRole, QString &error) const
Checks the feature definition validity.
ccPointCloud * cloud1
ccPointCloud * cloud2
double scale
Scale (diameter)