ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DualCloudFeature.h
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 #pragma once
9 
10 // ##########################################################################
11 // # #
12 // # ACLOUDVIEWER PLUGIN: q3DMASC #
13 // # #
14 // # This program is free software; you can redistribute it and/or modify #
15 // # it under the terms of the GNU General Public License as published by #
16 // # the Free Software Foundation; version 2 or later of the License. #
17 // # #
18 // # This program is distributed in the hope that it will be useful, #
19 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 // # GNU General Public License for more details. #
22 // # #
23 // # COPYRIGHT: Dimitri Lague / CNRS / UEB #
24 // # #
25 // ##########################################################################
26 
27 // Local
28 #include "FeaturesInterface.h"
29 
30 namespace masc {
32 struct DualCloudFeature : public Feature {
33 public: // DualCloudFeatureType
35 
37  switch (type) {
38  case Invalid:
39  return "Invalid";
40  case IDIFF:
41  return "IDIFF";
42  default:
43  assert(false);
44  break;
45  }
46  return "Invalid";
47  }
48 
49  static inline DualCloudFeatureType FromString(const QString& token) {
50  return FromUpperString(token.toUpper());
51  }
52  static DualCloudFeatureType FromUpperString(const QString& token) {
53  if (token == "IDIFF") return IDIFF;
54 
55  return Invalid;
56  }
57 
58 public: // methods
61 
62  // inherited from Feature
63  virtual Type getType() const override { return Type::DualCloudFeature; }
64  virtual Feature::Shared clone() const override {
65  return Feature::Shared(new DualCloudFeature(*this));
66  }
67  virtual bool prepare(
68  const CorePoints& corePoints,
69  QString& error,
70  cloudViewer::GenericProgressCallback* progressCb = nullptr,
71  SFCollector* generatedScalarFields = nullptr) override;
72  virtual bool checkValidity(QString corePointRole,
73  QString& error) const override;
74  virtual QString toString() const override;
75 
77 
80 };
81 } // namespace masc
SF collector.
static void error(char *msg)
Definition: lsd.c:159
3DMASC classifier
cloudViewer::GenericIndexedCloud * corePoints
Core points descriptor.
Definition: CorePoints.h:39
Dual-cloud feature.
static DualCloudFeatureType FromUpperString(const QString &token)
DualCloudFeatureType type
Dual-cloud feature type.
virtual Type getType() const override
Returns the type (must be reimplemented by child struct)
virtual bool checkValidity(QString corePointRole, QString &error) const override
Checks the feature definition validity.
static QString ToString(DualCloudFeatureType type)
virtual Feature::Shared clone() const override
Clones this feature.
static DualCloudFeatureType FromString(const QString &token)
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.)
DualCloudFeature(DualCloudFeatureType p_type)
Default constructor.
Generic feature descriptor.
QSharedPointer< Feature > Shared
Shared type.
Type
Feature type.