ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvShiftAndScaleCloudDlg.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 // LOCAL
11 #include "CV_io.h"
12 #include "ecvGlobalShiftManager.h"
13 
14 // Qt
15 #include <QDialog>
16 
17 // CV_CORE_LIB
18 #include <CVGeom.h>
19 
20 class Ui_GlobalShiftAndScaleDlg;
21 class QAbstractButton;
22 
24 class CV_IO_LIB_API ecvShiftAndScaleCloudDlg : public QDialog {
25  Q_OBJECT
26 
27 public:
29 
34  double Dg = 0,
35  QWidget* parent = 0);
36 
38 
45  double Dl,
46  const CCVector3d& Pg,
47  double Dg,
48  QWidget* parent = 0);
49 
51  void setShiftFieldsPrecision(int precision);
52 
54  virtual ~ecvShiftAndScaleCloudDlg();
55 
57  CCVector3d getShift() const;
58 
60  double getScale() const;
61 
63  bool applyAll() const { return m_applyAll; }
64 
66  bool cancelled() const { return m_cancel; }
67 
69  void showScaleItems(bool state);
70 
72  void showApplyAllButton(bool state);
74  void showApplyButton(bool state);
76  void showNoButton(bool state);
78  void showCancelButton(bool state);
79 
81  void showWarning(bool state);
82 
84  void showTitle(bool state);
85 
87  void showKeepGlobalPosCheckbox(bool state);
89  bool keepGlobalPos() const;
91  void setKeepGlobalPos(bool state);
92 
94  void showPreserveShiftOnSave(bool state);
96  bool preserveShiftOnSave() const;
98  void setPreserveShiftOnSave(bool state);
99 
101 
104  int addShiftInfo(const ecvGlobalShiftManager::ShiftInfo& info);
105 
107 
110  int addShiftInfo(const std::vector<ecvGlobalShiftManager::ShiftInfo>& info);
111 
113  bool getInfo(size_t index, ecvGlobalShiftManager::ShiftInfo& info) const;
114 
116  size_t infoCount() const { return m_defaultInfos.size(); }
117 
119  void setCurrentProfile(int index);
120 
122  bool addFileInfo();
123 
125  static void SetLastInfo(const CCVector3d& shift, double scale);
126 
127 protected slots:
128 
130  void onLoadIndexChanged(int);
132  void onGlobalPosCheckBoxToggled(bool);
134  void onClick(QAbstractButton* button);
136  void updateGlobalAndLocalSystems();
138  void displayMoreInfo();
139 
140 protected:
142  void init();
143 
145  void setShift(const CCVector3d& shift);
146 
148  void setScale(double scale);
149 
151  void updateLocalSystem();
153  void updateGlobalSystem();
154 
156 
160  bool loadInfoFromFile(QString filename);
161 
163  Ui_GlobalShiftAndScaleDlg* m_ui;
164 
168  bool m_cancel;
169 
171  std::vector<ecvGlobalShiftManager::ShiftInfo> m_defaultInfos;
174 
183 
186 };
ecvShiftAndScaleCloudDlg::m_ui
Ui_GlobalShiftAndScaleDlg * m_ui
Associated UI.
Definition: ecvShiftAndScaleCloudDlg.h:163
filename
std::string filename
Definition: PointCloudIO.cpp:47
ecvShiftAndScaleCloudDlg::m_localPoint
CCVector3d m_localPoint
Local coordinate system point (reversed mode only)
Definition: ecvShiftAndScaleCloudDlg.h:180
ecvShiftAndScaleCloudDlg::m_cancel
bool m_cancel
Whether the user has clicked on Cancel or not.
Definition: ecvShiftAndScaleCloudDlg.h:168
ecvShiftAndScaleCloudDlg::m_defaultInfos
std::vector< ecvGlobalShiftManager::ShiftInfo > m_defaultInfos
Default infos (typically loaded from the global_shift_list.txt' file)
Definition: ecvShiftAndScaleCloudDlg.h:171
ecvShiftAndScaleCloudDlg
Dialog for selection of cloud center.
Definition: ecvShiftAndScaleCloudDlg.h:24
ecvShiftAndScaleCloudDlg::cancelled
bool cancelled() const
Whether the user has clicked on the cancel button or not.
Definition: ecvShiftAndScaleCloudDlg.h:66
ecvGlobalShiftManager::ShiftInfo
Shift and scale info.
Definition: ecvGlobalShiftManager.h:81
ecvShiftAndScaleCloudDlg::m_reversedMode
bool m_reversedMode
Whether the reverse mode is active or not.
Definition: ecvShiftAndScaleCloudDlg.h:185
slots
#define slots
Definition: PythonPlugin.cpp:25
ecvShiftAndScaleCloudDlg::applyAll
bool applyAll() const
Whether shift should be applied to all files.
Definition: ecvShiftAndScaleCloudDlg.h:63
Vector3Tpl< double >
CV_io.h
ecvShiftAndScaleCloudDlg::m_activeInfoIndex
int m_activeInfoIndex
Active info entry index.
Definition: ecvShiftAndScaleCloudDlg.h:173
CVGeom.h
CV_IO_LIB_API
#define CV_IO_LIB_API
Definition: CV_io.h:15
ecvGlobalShiftManager.h
ecvShiftAndScaleCloudDlg::m_originalDiagonal
double m_originalDiagonal
Original coordinate system diagonal.
Definition: ecvShiftAndScaleCloudDlg.h:178
ecvShiftAndScaleCloudDlg::m_originalPoint
CCVector3d m_originalPoint
Original coordinate system point.
Definition: ecvShiftAndScaleCloudDlg.h:176
ecvShiftAndScaleCloudDlg::m_applyAll
bool m_applyAll
Whether shift should be applied to all files.
Definition: ecvShiftAndScaleCloudDlg.h:166
ecvShiftAndScaleCloudDlg::infoCount
size_t infoCount() const
Returns the number of info currently stored.
Definition: ecvShiftAndScaleCloudDlg.h:116
ecvShiftAndScaleCloudDlg::m_localDiagonal
double m_localDiagonal
Local coordinate system diagonal (reversed mode only)
Definition: ecvShiftAndScaleCloudDlg.h:182