GrabBag/Tools/CalibView/Inc/CalibDataWidget.h

160 lines
3.3 KiB
C++

#ifndef CALIBDATAWIDGET_H
#define CALIBDATAWIDGET_H
#include <QWidget>
#include <QTableWidget>
#include <QPushButton>
#include <QComboBox>
#include <QGroupBox>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QLabel>
#include <vector>
#include "HandEyeCalibTypes.h"
/**
* @brief 标定数据输入控件
* 支持 Eye-To-Hand 和 Eye-In-Hand 两种模式的数据输入
*/
class CalibDataWidget : public QWidget
{
Q_OBJECT
public:
explicit CalibDataWidget(QWidget* parent = nullptr);
~CalibDataWidget() override;
/**
* @brief 获取 Eye-To-Hand 标定数据
*/
void getEyeToHandData(std::vector<HECPoint3D>& eyePoints,
std::vector<HECPoint3D>& robotPoints) const;
/**
* @brief 获取 Eye-In-Hand 标定数据
*/
void getEyeInHandData(std::vector<HECEyeInHandData>& calibData) const;
/**
* @brief 获取当前标定模式
*/
HECCalibrationType getCalibType() const;
/**
* @brief 获取欧拉角顺序
*/
HECEulerOrder getEulerOrder() const;
/**
* @brief 清除所有数据
*/
void clearAll();
/**
* @brief 加载测试数据
*/
void loadTestData();
/**
* @brief 设置待变换的点
*/
void setTransformPoint(const HECPoint3D& point);
/**
* @brief 获取待变换的点
*/
HECPoint3D getTransformPoint() const;
/**
* @brief 设置欧拉角
*/
void setEulerAngles(const HECEulerAngles& angles);
/**
* @brief 获取欧拉角
*/
HECEulerAngles getEulerAngles() const;
signals:
/**
* @brief 标定模式改变信号
*/
void calibTypeChanged(HECCalibrationType type);
private slots:
/**
* @brief 添加一行数据
*/
void onAddRow();
/**
* @brief 删除选中行
*/
void onDeleteRow();
/**
* @brief 标定模式切换
*/
void onCalibTypeChanged(int index);
private:
/**
* @brief 初始化界面
*/
void setupUI();
/**
* @brief 创建 Eye-To-Hand 数据表格
*/
QGroupBox* createEyeToHandGroup();
/**
* @brief 创建 Eye-In-Hand 数据表格
*/
QGroupBox* createEyeInHandGroup();
/**
* @brief 创建变换测试组
*/
QGroupBox* createTransformGroup();
/**
* @brief 创建欧拉角测试组
*/
QGroupBox* createEulerGroup();
/**
* @brief 更新表格显示
*/
void updateTableVisibility();
// 标定模式选择
QComboBox* m_cbCalibType;
// Eye-To-Hand 数据表格
QTableWidget* m_tableEyeToHand;
QGroupBox* m_groupEyeToHand;
// Eye-In-Hand 数据表格
QTableWidget* m_tableEyeInHand;
QGroupBox* m_groupEyeInHand;
// 变换测试输入
QDoubleSpinBox* m_sbTransformX;
QDoubleSpinBox* m_sbTransformY;
QDoubleSpinBox* m_sbTransformZ;
// 欧拉角测试输入
QDoubleSpinBox* m_sbRoll;
QDoubleSpinBox* m_sbPitch;
QDoubleSpinBox* m_sbYaw;
QComboBox* m_cbEulerOrder;
// 按钮
QPushButton* m_btnAddRow;
QPushButton* m_btnDeleteRow;
};
#endif // CALIBDATAWIDGET_H