| 1 |
//########################################################################## |
| 2 |
//# # |
| 3 |
//# CLOUDCOMPARE PLUGIN: qMPlane # |
| 4 |
//# # |
| 5 |
//# This program is free software; you can redistribute it and/or modify # |
| 6 |
//# it under the terms of the GNU General Public License as published by # |
| 7 |
//# the Free Software Foundation; version 2 of the License. # |
| 8 |
//# # |
| 9 |
//# This program is distributed in the hope that it will be useful, # |
| 10 |
//# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 11 |
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 12 |
//# GNU General Public License for more details. # |
| 13 |
//# # |
| 14 |
//# COPYRIGHT: AIT Austrian Institute of Technology GmbH # |
| 15 |
//# # |
| 16 |
//########################################################################## |
| 17 |
|
| 18 |
#ifndef CC_MPLANE_MEASUREMENT |
| 19 |
#define CC_MPLANE_MEASUREMENT |
| 20 |
|
| 21 |
// CC |
| 22 |
#include "ccPointCloud.h" |
| 23 |
#include "ccHObject.h" |
| 24 |
#include "ccMainAppInterface.h" |
| 25 |
#include "ccPickingListener.h" |
| 26 |
#include "ccPlane.h" |
| 27 |
#include "cc2DLabel.h" |
| 28 |
|
| 29 |
// Local dependencies |
| 30 |
#include "ccMPlanePoint.h" |
| 31 |
|
| 32 |
|
| 33 |
class ccMeasurementRecorder { |
| 34 |
|
| 35 |
public: |
| 36 |
ccMeasurementRecorder(ccPointCloud *rootCloud, ccMainAppInterface *app) : |
| 37 |
m_rootCloud(rootCloud), |
| 38 |
m_app(app) |
| 39 |
{} |
| 40 |
|
| 41 |
void loadDataFromSelectedCloud(); |
| 42 |
|
| 43 |
void addFittingPoint(const ccPickingListener::PickedItem& item); |
| 44 |
void deleteFittingPoint(unsigned int index); |
| 45 |
void renameFittingPoint(const QString& newName, unsigned int fittingPointIndex); |
| 46 |
const std::vector<ccMPlanePoint>& getFittingPoints() const; |
| 47 |
unsigned int getActualFittingPointIndex() const; |
| 48 |
unsigned int getFittingPointAmount() const; |
| 49 |
|
| 50 |
void addMeasurementPoint(const ccPickingListener::PickedItem& item, float distance); |
| 51 |
const std::vector<ccMPlanePoint>& getMeasurementPoints() const; |
| 52 |
bool renameMeasurement(const QString& newName, unsigned int measurementIndex); |
| 53 |
void updateMeasurement(float distance, unsigned int measurementIndex); |
| 54 |
|
| 55 |
ccPlane* getPlane() const; |
| 56 |
void setPlane(const ccPlane *plane); |
| 57 |
void deletePlane(); |
| 58 |
|
| 59 |
private: |
| 60 |
ccMainAppInterface *m_app = nullptr; |
| 61 |
ccPointCloud *m_rootCloud = nullptr; |
| 62 |
ccPlane *m_plane = nullptr; |
| 63 |
|
| 64 |
ccHObject *m_rootFolder = nullptr; |
| 65 |
ccHObject *m_fittingPointFolder = nullptr; |
| 66 |
ccHObject *m_measurementFolder = nullptr; |
| 67 |
|
| 68 |
std::vector<ccMPlanePoint> m_fittingPoints; |
| 69 |
std::vector<ccMPlanePoint> m_measurementPoints; |
| 70 |
|
| 71 |
private: |
| 72 |
void loadFolders(); |
| 73 |
void loadFittingPoints(); |
| 74 |
void loadMeasurementPoints(); |
| 75 |
void loadAndDeleteFittingPlane(); |
| 76 |
}; |
| 77 |
|
| 78 |
#endif |