ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qFacets.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 // Local
11 #include "cellsFusionDlg.h"
12 
13 // Qt
14 #include <QObject>
15 
16 // qCC
17 #include "ecvStdPluginInterface.h"
18 
19 // cloudViewer
20 #include <AutoSegmentationTools.h>
21 #include <ReferenceCloud.h>
22 
23 // System
24 #include <unordered_set>
25 
26 class QAction;
27 class ccHObject;
28 class ccPointCloud;
29 class ccPolyline;
30 class ccFacet;
31 
33 
35 class qFacets : public QObject, public ccStdPluginInterface {
36  Q_OBJECT
38  Q_PLUGIN_METADATA(IID "ecvcorp.cloudviewer.plugin.qFacets" FILE
39  "../info.json")
40 
41 public:
43  qFacets(QObject* parent = nullptr);
44 
46  virtual ~qFacets();
47 
48  // inherited from ccStdPluginInterface
49  virtual void onNewSelection(
50  const ccHObject::Container& selectedEntities) override;
51  virtual QList<QAction*> getActions() override;
52 
53 protected slots:
54 
56  void fuseKdTreeCells();
57 
59  void extractFacetsWithFM();
60 
62  void exportFacets();
63 
65  void exportFacetsInfo();
66 
68  void classifyFacetsByAngle();
69 
71  void showStereogram();
72 
73 protected:
76 
80  unsigned minPointsPerComponent,
81  double maxEdgeLength,
82  bool randomColors,
83  bool& error);
84 
86  typedef std::unordered_set<ccFacet*> FacetSet;
87 
89  void getFacetsInCurrentSelection(FacetSet& facets) const;
90 
92  void classifyFacetsByAngle(ccHObject* group,
93  double angleStep_deg,
94  double maxDist);
95 
108 };
qFacets::m_doFuseKdTreeCells
QAction * m_doFuseKdTreeCells
Associated action.
Definition: qFacets.h:97
qFacets::fuseKdTreeCells
void fuseKdTreeCells()
Fuses the cells of a kd-tree to produces planar facets.
Definition: qFacets.cpp:200
qFacets::FacetSet
std::unordered_set< ccFacet * > FacetSet
Set of facets (pointers)
Definition: qFacets.h:86
qFacets::showStereogram
void showStereogram()
Displays the selected entity stereogram.
Definition: qFacets.cpp:942
AutoSegmentationTools.h
cellsFusionDlg.h
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
qFacets::m_doExportFacets
QAction * m_doExportFacets
Associated action.
Definition: qFacets.h:101
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
slots
#define slots
Definition: PythonPlugin.cpp:25
qFacets::extractFacetsWithFM
void extractFacetsWithFM()
Uses Fast Marching to detect planar facets.
Definition: qFacets.cpp:196
qFacets::m_doClassifyFacetsByAngle
QAction * m_doClassifyFacetsByAngle
Associated action.
Definition: qFacets.h:105
ecvStdPluginInterface.h
qFacets::createFacets
ccHObject * createFacets(ccPointCloud *cloud, cloudViewer::ReferenceCloudContainer &components, unsigned minPointsPerComponent, double maxEdgeLength, bool randomColors, bool &error)
Creates facets from components.
Definition: qFacets.cpp:435
qFacets
Facet detection plugin (BRGM)
Definition: qFacets.h:35
qFacets::m_doExportFacetsInfo
QAction * m_doExportFacetsInfo
Associated action.
Definition: qFacets.h:103
qFacets::m_fastMarchingExtraction
QAction * m_fastMarchingExtraction
Associated action.
Definition: qFacets.h:99
CellsFusionDlg::Algorithm
Algorithm
Cell fusion algorithm.
Definition: cellsFusionDlg.h:17
qFacets::getFacetsInCurrentSelection
void getFacetsInCurrentSelection(FacetSet &facets) const
Returns all the facets in the current selection.
Definition: qFacets.cpp:557
qFacets::exportFacets
void exportFacets()
Exports facets (as shapefiles)
Definition: qFacets.cpp:682
qFacets::exportFacetsInfo
void exportFacetsInfo()
Exports statistics on a set of facets.
Definition: qFacets.cpp:1034
ccPluginInterface
Standard ECV plugin interface.
Definition: ecvPluginInterface.h:33
qFacets::m_doShowStereogram
QAction * m_doShowStereogram
Associated action.
Definition: qFacets.h:107
cloudViewer::ReferenceCloudContainer
std::vector< ReferenceCloud * > ReferenceCloudContainer
A standard container to store several subsets of points.
Definition: AutoSegmentationTools.h:28
ReferenceCloud.h
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
qFacets::classifyFacetsByAngle
void classifyFacetsByAngle()
Classifies facets by orientation.
Definition: qFacets.cpp:976
ccStdPluginInterface
Standard ECV plugin interface.
Definition: ecvStdPluginInterface.h:31
ccFacet
Facet.
Definition: ecvFacet.h:25
qFacets::extractFacets
void extractFacets(CellsFusionDlg::Algorithm algo)
Uses the given algorithm to detect planar facets.
Definition: qFacets.cpp:202
ccPolyline
Colored polyline.
Definition: ecvPolyline.h:23