ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccMeasurementDevice.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 // CC
11 #include "ecvMainAppInterface.h"
12 #include "ecvPlane.h"
13 #include "ecvPointCloud.h"
14 #include "ecvScalarField.h"
15 
16 // Local dependecies
17 #include "ccMPlanePoint.h"
18 
20 public:
21  explicit ccMeasurementDevice(ecvMainAppInterface *app) : m_app(app) {}
22 
23  ccPlane *fitPlaneToPoints(const std::vector<ccMPlanePoint> &fittingPoints,
24  const QString &planeName) const;
25  void createScalarFieldForCloud(const ccPlane *plane,
26  ccPointCloud *cloud,
27  bool signedMeasurement) const;
28  void deleteScalarFieldFromCloud(ccPointCloud *cloud) const;
29  float measurePointToPlaneDistance(const ccPlane *plane,
30  const CCVector3 &point,
31  bool signedMeasurement) const;
32 
33 private:
34  ecvMainAppInterface *m_app;
35  void setupPlaneUiDisplay(ccPlane *plane, const QString planeName) const;
36  std::tuple<ccScalarField *, int> findOrCreateScalarfieldForCloud(
37  ccPointCloud *cloud) const;
38  void addPointDistancesToScalarfield(ccScalarField *scalarField,
39  const ccPointCloud *cloud,
40  const PointCoordinateType *equation,
41  bool signedMeasurement) const;
42 };
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
void createScalarFieldForCloud(const ccPlane *plane, ccPointCloud *cloud, bool signedMeasurement) const
void deleteScalarFieldFromCloud(ccPointCloud *cloud) const
ccMeasurementDevice(ecvMainAppInterface *app)
ccPlane * fitPlaneToPoints(const std::vector< ccMPlanePoint > &fittingPoints, const QString &planeName) const
float measurePointToPlaneDistance(const ccPlane *plane, const CCVector3 &point, bool signedMeasurement) const
Plane (primitive)
Definition: ecvPlane.h:18
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
A scalar field associated to display-related parameters.
Main application interface (for plugins)
Definition: lsd.c:149