| 1 |
#pragma once |
| 2 |
|
| 3 |
//########################################################################## |
| 4 |
//# # |
| 5 |
//# CLOUDCOMPARE PLUGIN: qSRA # |
| 6 |
//# # |
| 7 |
//# This program is free software; you can redistribute it and/or modify # |
| 8 |
//# it under the terms of the GNU General Public License as published by # |
| 9 |
//# the Free Software Foundation; version 2 or later of the License. # |
| 10 |
//# # |
| 11 |
//# This program is distributed in the hope that it will be useful, # |
| 12 |
//# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 13 |
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 14 |
//# GNU General Public License for more details. # |
| 15 |
//# # |
| 16 |
//# COPYRIGHT: EDF # |
| 17 |
//# # |
| 18 |
//########################################################################## |
| 19 |
|
| 20 |
#include "ccStdPluginInterface.h" |
| 21 |
|
| 22 |
class ccPointCloud; |
| 23 |
class ccPolyline; |
| 24 |
|
| 25 |
//! Surface of Revolution Analysis plugin |
| 26 |
class qSRA : public QObject, public ccStdPluginInterface |
| 27 |
{ |
| 28 |
Q_OBJECT |
| 29 |
Q_INTERFACES( ccPluginInterface ccStdPluginInterface ) |
| 30 |
|
| 31 |
Q_PLUGIN_METADATA( IID "cccorp.cloudcompare.plugin.qSRA" FILE "../info.json" ) |
| 32 |
|
| 33 |
public: |
| 34 |
|
| 35 |
//! Default constructor |
| 36 |
explicit qSRA(QObject* parent = nullptr); |
| 37 |
|
| 38 |
virtual ~qSRA() = default; |
| 39 |
|
| 40 |
//inherited from ccStdPluginInterface |
| 41 |
virtual void onNewSelection(const ccHObject::Container& selectedEntities) override; |
| 42 |
virtual QList<QAction *> getActions() override; |
| 43 |
|
| 44 |
protected: |
| 45 |
|
| 46 |
//! Loads profile from a dedicated file |
| 47 |
void loadProfile() const; |
| 48 |
|
| 49 |
//! Computes cloud-to-profile radial distances |
| 50 |
void computeCloud2ProfileRadialDist() const; |
| 51 |
|
| 52 |
//! Projects the cloud distances into a 2D grid |
| 53 |
void projectCloudDistsInGrid() const; |
| 54 |
|
| 55 |
protected: |
| 56 |
|
| 57 |
//! Projects the cloud distances into a 2D grid (needs the revolution profile) |
| 58 |
void doProjectCloudDistsInGrid(ccPointCloud* cloud, ccPolyline* polyline) const; |
| 59 |
|
| 60 |
//! Computes cloud-to-profile radial distances |
| 61 |
bool doComputeRadialDists(ccPointCloud* cloud, ccPolyline* polyline) const; |
| 62 |
|
| 63 |
//! Associated action |
| 64 |
QAction* m_doLoadProfile; |
| 65 |
//! Associated action |
| 66 |
QAction* m_doCompareCloudToProfile; |
| 67 |
//! Associated action |
| 68 |
QAction* m_doProjectCloudDists; |
| 69 |
}; |