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
ccGenericPointCloud::computeOctree
virtual ccOctree::Shared computeOctree(cloudViewer::GenericProgressCallback *progressCb=nullptr, bool autoAddChild=true)
Computes the cloud octree.
Definition: ecvGenericPointCloud.cpp:124
cloudViewer::CloudSamplingTools::SFModulationParams::enabled
bool enabled
Whether the modulation is enabled or not.
Definition: CloudSamplingTools.h:144
masc
3DMASC classifier
Definition: ContextBasedFeature.h:30
masc::CorePoints::NONE
@ NONE
Definition: CorePoints.h:58
CloudSamplingTools.h
masc::CorePoints::selectionMethod
SubSamplingMethod selectionMethod
Definition: CorePoints.h:59
cloudViewer::CloudSamplingTools::SFModulationParams
Parameters for the scalar-field based modulation of a parameter.
Definition: CloudSamplingTools.h:138
GenericProgressCallback.h
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
cloudViewer::CloudSamplingTools::subsampleCloudRandomly
static ReferenceCloud * subsampleCloudRandomly(GenericIndexedCloudPersist *cloud, unsigned newNumberOfPoints, GenericProgressCallback *progressCb=nullptr)
Subsamples a point cloud (process based on random selections)
Definition: CloudSamplingTools.cpp:202
masc::CorePoints::selection
QSharedPointer< cloudViewer::ReferenceCloud > selection
Definition: CorePoints.h:57
cloudViewer::GenericProgressCallback
Definition: GenericProgressCallback.h:20
ccGenericPointCloud::getOctree
virtual ccOctree::Shared getOctree() const
Returns the associated octree (if any)
Definition: ecvGenericPointCloud.cpp:97
masc::CorePoints
Core points descriptor.
Definition: CorePoints.h:39
masc::CorePoints::origin
ccPointCloud * origin
Origin cloud.
Definition: CorePoints.h:41
ccPointCloud::partialClone
ccPointCloud * partialClone(const cloudViewer::ReferenceCloud *selection, int *warnings=nullptr, bool withChildEntities=true) const
Creates a new point cloud object from a ReferenceCloud (selection)
Definition: ecvPointCloud.cpp:290
masc::CorePoints::selectionParam
double selectionParam
Definition: CorePoints.h:60
masc::CorePoints::originIndex
unsigned originIndex(unsigned i) const
Return the point index.
Definition: CorePoints.h:52
masc::CorePoints::size
unsigned size() const
Return the size.
Definition: CorePoints.h:50
CorePoints.h
masc::CorePoints::RANDOM
@ RANDOM
Definition: CorePoints.h:58
masc::CorePoints::SPATIAL
@ SPATIAL
Definition: CorePoints.h:58
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
cloudViewer::ReferenceCloud
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
ReferenceCloud.h
masc::CorePoints::prepare
bool prepare(cloudViewer::GenericProgressCallback *progressCb=nullptr)
Prepares the selection (must be called once)
Definition: CorePoints.cpp:21
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
masc::CorePoints::cloud
ccPointCloud * cloud
Core points cloud.
Definition: CorePoints.h:44
masc::CorePoints::role
QString role
Core points 'role'.
Definition: CorePoints.h:47
masc::CorePoints::SubSamplingMethod
SubSamplingMethod
Definition: CorePoints.h:58
ecvPointCloud.h
cloudViewer::CloudSamplingTools::resampleCloudSpatially
static ReferenceCloud * resampleCloudSpatially(GenericIndexedCloudPersist *cloud, PointCoordinateType minDistance, const SFModulationParams &modParams, DgmOctree *octree=nullptr, GenericProgressCallback *progressCb=nullptr)
Resamples a point cloud (process based on inter point distance)
Definition: CloudSamplingTools.cpp:256