ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CorePoints.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 // qCC_db
28 #include <ecvPointCloud.h>
29 
30 // CCLib
32 #include <ReferenceCloud.h>
33 
34 // Qt
35 #include <QSharedPointer>
36 
37 namespace masc {
39 struct CorePoints {
41  ccPointCloud* origin = nullptr;
42 
44  ccPointCloud* cloud = nullptr;
45 
47  QString role;
48 
50  inline unsigned size() const { return (cloud ? cloud->size() : 0); }
52  inline unsigned originIndex(unsigned i) const {
53  return selection ? selection->getPointGlobalIndex(i) : i;
54  }
55 
56  // selection (if any)
57  QSharedPointer<cloudViewer::ReferenceCloud> selection;
60  double selectionParam = std::numeric_limits<double>::quiet_NaN();
61 
63  bool prepare(cloudViewer::GenericProgressCallback* progressCb = nullptr);
64 };
65 
66 }; // namespace masc
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
unsigned size() const override
Definition: PointCloudTpl.h:38
3DMASC classifier
Core points descriptor.
Definition: CorePoints.h:39
bool prepare(cloudViewer::GenericProgressCallback *progressCb=nullptr)
Prepares the selection (must be called once)
Definition: CorePoints.cpp:21
unsigned size() const
Return the size.
Definition: CorePoints.h:50
double selectionParam
Definition: CorePoints.h:60
SubSamplingMethod selectionMethod
Definition: CorePoints.h:59
ccPointCloud * cloud
Core points cloud.
Definition: CorePoints.h:44
unsigned originIndex(unsigned i) const
Return the point index.
Definition: CorePoints.h:52
ccPointCloud * origin
Origin cloud.
Definition: CorePoints.h:41
QSharedPointer< cloudViewer::ReferenceCloud > selection
Definition: CorePoints.h:57
QString role
Core points 'role'.
Definition: CorePoints.h:47