GrabBag/Tools/CloudView/Inc/CloudViewMainWindow.h

313 lines
6.6 KiB
C
Raw Normal View History

2026-01-16 01:04:43 +08:00
#ifndef CLOUD_VIEW_MAIN_WINDOW_H
#define CLOUD_VIEW_MAIN_WINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QListWidget>
#include <QGroupBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSplitter>
#include <QFileDialog>
#include <QMessageBox>
#include <QStatusBar>
#include <QLineEdit>
#include <QRadioButton>
#include <QCheckBox>
2026-02-11 00:53:51 +08:00
#include <QComboBox>
#include <QDialog>
2026-01-16 01:04:43 +08:00
#include <memory>
#include "PointCloudGLWidget.h"
#include "PointCloudConverter.h"
class QTextEdit;
class QTableWidget;
2026-01-16 01:04:43 +08:00
/**
* @brief
*
*/
class CloudViewMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit CloudViewMainWindow(QWidget* parent = nullptr);
~CloudViewMainWindow() override;
private slots:
/**
* @brief
*/
void onOpenFile();
/**
* @brief 线
*/
void onOpenSegmentFile();
/**
* @brief 姿
*/
void onOpenPoseFile();
2026-01-16 01:04:43 +08:00
/**
* @brief
*/
void onClearAll();
/**
* @brief
*/
void onResetView();
/**
* @brief
*/
void onClearSelectedPoints();
/**
* @brief 线
*/
void onClearLinePoints();
/**
* @brief
*/
void onPointSelected(const SelectedPointInfo& point);
/**
* @brief
*/
void onTwoPointsSelected(const SelectedPointInfo& p1, const SelectedPointInfo& p2, float distance);
/**
* @brief 线
*/
void onLineSelected(const SelectedLineInfo& line);
2026-02-11 00:53:51 +08:00
/**
* @brief
*/
void onViewAnglesChanged(float rotX, float rotY, float rotZ);
2026-01-16 01:04:43 +08:00
/**
* @brief 线线
*/
void onSelectLineByNumber();
/**
* @brief 线/
*/
void onLineSelectModeChanged(bool checked);
/**
* @brief 线
*/
void onShowLinePoints();
/**
* @brief 线
*/
void onLinePointTableClicked(int row, int column);
/**
* @brief 1姿
*/
void onShowPose1();
/**
* @brief 2姿
*/
void onShowPose2();
/**
* @brief 线
*/
void onShowInputLine();
/**
* @brief 线
*/
void onClearInputLine();
2026-02-11 00:53:51 +08:00
/**
* @brief
*/
void onEulerOrderChanged(int index);
/**
* @brief
*/
void onLoadMatrix();
/**
* @brief
*/
void onApplyMatrix();
/**
* @brief
*/
void onResetMatrix();
2026-01-16 01:04:43 +08:00
private:
/**
* @brief
*/
void setupUI();
/**
* @brief
*/
QWidget* createViewerArea();
/**
* @brief
*/
QWidget* createControlPanel();
/**
* @brief
*/
QGroupBox* createFileGroup();
2026-02-11 00:53:51 +08:00
/**
* @brief
*/
QGroupBox* createViewGroup();
2026-01-16 01:04:43 +08:00
/**
* @brief
*/
QGroupBox* createMeasureGroup();
/**
* @brief
*/
QWidget* createMeasurePage();
/**
* @brief 线
*/
QWidget* createLinePage();
2026-02-11 00:53:51 +08:00
/**
* @brief
*/
QWidget* createTransformPage();
2026-01-16 01:04:43 +08:00
/**
* @brief 线
*/
QGroupBox* createLineGroup();
/**
* @brief
*/
QGroupBox* createCloudListGroup();
/**
* @brief
*/
void updateSelectedPointsDisplay();
/**
* @brief 线0,0,0
*/
QVector<QVector3D> getOriginalLinePoints(const SelectedLineInfo& lineInfo);
/**
* @brief 线
*/
void updateLinePointsDialog();
2026-01-16 01:04:43 +08:00
// 点云显示控件
PointCloudGLWidget* m_glWidget;
// 点云转换器
std::unique_ptr<PointCloudConverter> m_converter;
// 文件操作控件
QPushButton* m_btnOpenFile;
QPushButton* m_btnOpenSegment;
QPushButton* m_btnOpenPose;
2026-01-16 01:04:43 +08:00
QPushButton* m_btnClearAll;
2026-02-11 00:53:51 +08:00
// 视图角度输入控件
QLineEdit* m_editRotX;
QLineEdit* m_editRotY;
QLineEdit* m_editRotZ;
2026-01-16 01:04:43 +08:00
// 选点测距控件
QCheckBox* m_cbMeasureDistance;
2026-01-16 01:04:43 +08:00
QPushButton* m_btnClearPoints;
QLabel* m_lblPoint1;
QLabel* m_lblPoint2;
QLabel* m_lblDistance;
// 点1姿态输入控件
QLineEdit* m_editRx1;
QLineEdit* m_editRy1;
QLineEdit* m_editRz1;
QPushButton* m_btnShowPose1;
// 点2姿态输入控件
QLineEdit* m_editRx2;
QLineEdit* m_editRy2;
QLineEdit* m_editRz2;
QPushButton* m_btnShowPose2;
2026-02-11 00:53:51 +08:00
// 欧拉角旋转顺序选择
QComboBox* m_comboEulerOrder;
2026-01-16 01:04:43 +08:00
// 选线拟合控件
QPushButton* m_btnClearLine;
QPushButton* m_btnShowLinePoints;
2026-01-16 01:04:43 +08:00
QLineEdit* m_lineNumberInput;
QPushButton* m_btnSelectByNumber;
QRadioButton* m_rbVertical;
QRadioButton* m_rbHorizontal;
QLabel* m_lblLineIndex;
QLabel* m_lblLinePointCount;
// 输入线段控件
QLineEdit* m_editLineX1;
QLineEdit* m_editLineY1;
QLineEdit* m_editLineZ1;
QLineEdit* m_editLineX2;
QLineEdit* m_editLineY2;
QLineEdit* m_editLineZ2;
QPushButton* m_btnShowLine;
QPushButton* m_btnClearLine2;
2026-01-16 01:04:43 +08:00
// 点云列表
QListWidget* m_cloudList;
// 已加载的点云数量
int m_cloudCount;
// 当前点云的线信息(用于旋转)
int m_currentLineNum;
int m_currentLinePtNum;
// 原始完整点云数据包含0,0,0点用于旋转
PointCloudXYZ m_originalCloud;
// 线上点对话框
QDialog* m_linePointsDialog;
QTableWidget* m_linePointsTable;
QVector<QVector3D> m_currentLinePoints; // 当前线的原始点坐标
2026-02-11 00:53:51 +08:00
// 矩阵变换控件
QTextEdit* m_matrixEdit;
QPushButton* m_btnLoadMatrix;
QPushButton* m_btnApplyMatrix;
QPushButton* m_btnResetMatrix;
2026-01-16 01:04:43 +08:00
};
#endif // CLOUD_VIEW_MAIN_WINDOW_H