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 };
#define slots
Algorithm
Cell fusion algorithm.
Facet.
Definition: ecvFacet.h:25
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
Standard ECV plugin interface.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
Standard ECV plugin interface.
Facet detection plugin (BRGM)
Definition: qFacets.h:35
void extractFacets(CellsFusionDlg::Algorithm algo)
Uses the given algorithm to detect planar facets.
Definition: qFacets.cpp:202
void showStereogram()
Displays the selected entity stereogram.
Definition: qFacets.cpp:942
QAction * m_doShowStereogram
Associated action.
Definition: qFacets.h:107
QAction * m_doExportFacets
Associated action.
Definition: qFacets.h:101
QAction * m_doFuseKdTreeCells
Associated action.
Definition: qFacets.h:97
void exportFacets()
Exports facets (as shapefiles)
Definition: qFacets.cpp:682
void exportFacetsInfo()
Exports statistics on a set of facets.
Definition: qFacets.cpp:1034
QAction * m_doExportFacetsInfo
Associated action.
Definition: qFacets.h:103
QAction * m_fastMarchingExtraction
Associated action.
Definition: qFacets.h:99
void classifyFacetsByAngle()
Classifies facets by orientation.
Definition: qFacets.cpp:976
ccHObject * createFacets(ccPointCloud *cloud, cloudViewer::ReferenceCloudContainer &components, unsigned minPointsPerComponent, double maxEdgeLength, bool randomColors, bool &error)
Creates facets from components.
Definition: qFacets.cpp:435
void getFacetsInCurrentSelection(FacetSet &facets) const
Returns all the facets in the current selection.
Definition: qFacets.cpp:557
void extractFacetsWithFM()
Uses Fast Marching to detect planar facets.
Definition: qFacets.cpp:196
void fuseKdTreeCells()
Fuses the cells of a kd-tree to produces planar facets.
Definition: qFacets.cpp:200
std::unordered_set< ccFacet * > FacetSet
Set of facets (pointers)
Definition: qFacets.h:86
QAction * m_doClassifyFacetsByAngle
Associated action.
Definition: qFacets.h:105
static void error(char *msg)
Definition: lsd.c:159
std::vector< ReferenceCloud * > ReferenceCloudContainer
A standard container to store several subsets of points.