Debian Codegraph @

plugins/core/Standard/qMPlane/src/ccMeasurementDevice.h

raw
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_MEASUREMENT_DEVICE
19 #define CC_MEASUREMENT_DEVICE
20
21 // CC
22 #include "ccMainAppInterface.h"
23 #include "ccPointCloud.h"
24 #include "ccPlane.h"
25 #include "ccScalarField.h"
26
27 // Local dependecies
28 #include "ccMPlanePoint.h"
29
30 class ccMeasurementDevice {
31
32 public:
33 explicit ccMeasurementDevice(ccMainAppInterface *app) : m_app(app) {}
34
35 ccPlane* fitPlaneToPoints(const std::vector<ccMPlanePoint>& fittingPoints, const QString& planeName) const;
36 void createScalarFieldForCloud(const ccPlane *plane, ccPointCloud *cloud, bool signedMeasurement) const;
37 void deleteScalarFieldFromCloud(ccPointCloud *cloud) const;
38 float measurePointToPlaneDistance(const ccPlane *plane, const CCVector3& point, bool signedMeasurement) const;
39
40 private:
41 ccMainAppInterface *m_app;
42 void setupPlaneUiDisplay(ccPlane *plane, const QString planeName) const;
43 std::tuple<ccScalarField*, int> findOrCreateScalarfieldForCloud(ccPointCloud *cloud) const;
44 void addPointDistancesToScalarfield(ccScalarField *scalarField, const ccPointCloud *cloud, const PointCoordinateType *equation, bool signedMeasurement) const;
45 };
46
47 #endif