ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccMPlaneDlgController.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 // Std
11 #include <memory>
12 
13 // Qt
14 #include <QtGui>
15 
16 // CC
17 #include <ecvPickingListener.h>
18 
19 #include "ecvMainAppInterface.h"
20 
21 // Local dependencies
22 #include "ccMPlaneDlg.h"
23 #include "ccMeasurementDevice.h"
24 #include "ccMeasurementRecorder.h"
25 
26 class ccMPlaneDlgController : public QObject, public ccPickingListener {
27  Q_OBJECT
28 
29 public:
31  void openDialog(ccPointCloud *selectedCloud);
32 
33 protected slots:
34  void onCloseButtonPressed();
35  void onNewTab(int tabIndex);
36  void onMeasureNameChanged(QTableWidgetItem *);
38  void onFittingPointDelete(int index);
39  void onNormalCheckBoxClicked(bool checked);
40  void onSaveButtonClicked();
41  virtual void onItemPicked(const ccPickingListener::PickedItem &pi) override;
42 
43 private:
44  void loadDataFromSelectedCloud();
45  void registerDialog();
46  void startPicking();
47  void stopPicking();
48  void pickFittingPoint(const ccPickingListener::PickedItem &item);
49  void pickMeasurementPoint(const ccPickingListener::PickedItem &item);
50  void updatePlane();
51  void updateScalarfield();
52  void updateMeasurements();
53  void updateFittingPoints();
54  void updatAllMeasurementEntities();
55 
56 private:
57  ecvMainAppInterface *m_app;
58  ccMPlaneDlg *m_dialog;
59  std::unique_ptr<ccMeasurementRecorder> m_data;
60  std::unique_ptr<ccMeasurementDevice> m_device;
61  ccPointCloud *m_selectedCloud = nullptr;
62 
63  enum CC_Mode { CC_POINT_SELECTION, CC_MEASUREMENT };
64  CC_Mode m_mode = CC_POINT_SELECTION;
65 
66  bool m_signedMeasurement = false;
67  bool m_showNormal = false;
68 };
#define slots
void onMeasureNameChanged(QTableWidgetItem *)
virtual void onItemPicked(const ccPickingListener::PickedItem &pi) override
ccMPlaneDlgController(ecvMainAppInterface *app)
void onFittingPointDelete(int index)
void onNormalCheckBoxClicked(bool checked)
void openDialog(ccPointCloud *selectedCloud)
Point/triangle picking listener interface.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Main application interface (for plugins)