118 lines
4.2 KiB
C++
118 lines
4.2 KiB
C++
#pragma once
|
|||
|
|
// ════════════════════════════════════════════════════════════════════════════
|
||
|
|
// ShapeModelGenDialog.h ─ 离线轮廓库生成工具 (V5)
|
||
|
|
//
|
||
|
|
// V5: 支持左右相机分别加载标定参数,分别生成轮廓库
|
||
|
|
// ════════════════════════════════════════════════════════════════════════════
|
||
|
|
#include <QDialog>
|
||
|
|
#include <QString>
|
||
|
|
#include <QImage>
|
||
|
|
#include <memory>
|
||
|
|
class QLabel;
|
||
|
|
class QLineEdit;
|
||
|
|
class QPushButton;
|
||
|
|
class QProgressBar;
|
||
|
|
class QTextEdit;
|
||
|
|
class QDoubleSpinBox;
|
||
|
|
class QSpinBox;
|
||
|
|
class QCheckBox;
|
||
|
|
class QGroupBox;
|
||
|
|
class QComboBox;
|
||
|
|
|
||
|
|
class ShapeModelGenDialog : public QDialog
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit ShapeModelGenDialog(QWidget* parent = nullptr);
|
||
|
|
~ShapeModelGenDialog();
|
||
|
|
|
||
|
|
QString appliedModelPathLeft() const { return m_appliedPathLeft; }
|
||
|
|
QString appliedModelPathRight() const { return m_appliedPathRight; }
|
||
|
|
bool hasApplied() const { return !m_appliedPathLeft.isEmpty() || !m_appliedPathRight.isEmpty(); }
|
||
|
|
|
||
|
|
// 兼容旧接口
|
||
|
|
QString appliedModelPath() const { return m_appliedPathLeft; }
|
||
|
|
|
||
|
|
signals:
|
||
|
|
// V5: 信号携带左右两个路径
|
||
|
|
void modelApplied(const QString& sm3PathLeft, const QString& sm3PathRight);
|
||
|
|
|
||
|
|
private slots:
|
||
|
|
void onBrowseCAD();
|
||
|
|
void onLoadCAD();
|
||
|
|
void onBrowseCamParamLeft();
|
||
|
|
void onBrowseCamParamRight();
|
||
|
|
void onGenerate();
|
||
|
|
void onExportSM3();
|
||
|
|
void onApplyToMain();
|
||
|
|
void onImportSM3Left();
|
||
|
|
void onImportSM3Right();
|
||
|
|
void onRefreshPreview();
|
||
|
|
|
||
|
|
private:
|
||
|
|
void buildUi();
|
||
|
|
void setupConnections();
|
||
|
|
void log(const QString& msg);
|
||
|
|
void setProgress(int pct, const QString& msg = {});
|
||
|
|
void updatePreview();
|
||
|
|
void saveParams();
|
||
|
|
void loadParams();
|
||
|
|
|
||
|
|
struct Impl;
|
||
|
|
std::unique_ptr<Impl> m_d;
|
||
|
|
|
||
|
|
QString m_appliedPathLeft;
|
||
|
|
QString m_appliedPathRight;
|
||
|
|
QString m_lastSM3PathLeft;
|
||
|
|
QString m_lastSM3PathRight;
|
||
|
|
|
||
|
|
// CAD
|
||
|
|
QLineEdit* m_editCADPath = nullptr;
|
||
|
|
QPushButton* m_btnBrowseCAD = nullptr;
|
||
|
|
QPushButton* m_btnLoadCAD = nullptr;
|
||
|
|
QLabel* m_labelCADInfo = nullptr;
|
||
|
|
|
||
|
|
// Camera (左右分开)
|
||
|
|
QLineEdit* m_editCamParamLeft = nullptr;
|
||
|
|
QPushButton* m_btnBrowseCamLeft = nullptr;
|
||
|
|
QLabel* m_labelCamLeftStatus = nullptr;
|
||
|
|
QLineEdit* m_editCamParamRight = nullptr;
|
||
|
|
QPushButton* m_btnBrowseCamRight = nullptr;
|
||
|
|
QLabel* m_labelCamRightStatus = nullptr;
|
||
|
|
|
||
|
|
// 生成参数 — 角度(°), 距离(m)
|
||
|
|
QDoubleSpinBox* m_spinLongMin = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinLongMax = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinLatMin = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinLatMax = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinRollMin = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinRollMax = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinDistMin = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinDistMax = nullptr;
|
||
|
|
QSpinBox* m_spinMinContrast = nullptr;
|
||
|
|
QCheckBox* m_chkCustomLevels = nullptr;
|
||
|
|
QSpinBox* m_spinNumLevels = nullptr;
|
||
|
|
QCheckBox* m_chkCustomLowestLevel = nullptr;
|
||
|
|
QSpinBox* m_spinLowestLevel = nullptr;
|
||
|
|
|
||
|
|
// 预览 — 自由视角(°), 距离(m)
|
||
|
|
QDoubleSpinBox* m_spinPreviewLong = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinPreviewLat = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinPreviewRoll = nullptr;
|
||
|
|
QDoubleSpinBox* m_spinPreviewDist = nullptr;
|
||
|
|
QLabel* m_labelPreview = nullptr;
|
||
|
|
QLabel* m_labelViewInfo = nullptr;
|
||
|
|
// 预览选择: 左/右
|
||
|
|
QComboBox* m_comboPreviewSide = nullptr;
|
||
|
|
|
||
|
|
// Buttons
|
||
|
|
QPushButton* m_btnGenerate = nullptr;
|
||
|
|
QPushButton* m_btnExport = nullptr;
|
||
|
|
QPushButton* m_btnApply = nullptr;
|
||
|
|
QPushButton* m_btnImportSM3Left = nullptr;
|
||
|
|
QPushButton* m_btnImportSM3Right = nullptr;
|
||
|
|
QPushButton* m_btnRefreshPreview = nullptr;
|
||
|
|
QProgressBar* m_progress = nullptr;
|
||
|
|
QTextEdit* m_textLog = nullptr;
|
||
|
|
};
|