将视图控制封装到CloudView3D中
This commit is contained in:
parent
176a833bb2
commit
3156f82339
@ -17,17 +17,17 @@
|
||||
#include <QLineEdit>
|
||||
#include <QRadioButton>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDialog>
|
||||
#include <QStringList>
|
||||
#include <memory>
|
||||
#include <QComboBox>
|
||||
#include <QDialog>
|
||||
#include <QStringList>
|
||||
#include <memory>
|
||||
|
||||
#include "CloudView3D.h"
|
||||
#include "PointCloudConverter.h"
|
||||
#include "CloudView3D.h"
|
||||
#include "PointCloudConverter.h"
|
||||
|
||||
class QTextEdit;
|
||||
class QTableWidget;
|
||||
class QCloseEvent;
|
||||
class QTextEdit;
|
||||
class QTableWidget;
|
||||
class QCloseEvent;
|
||||
|
||||
/**
|
||||
* @brief 点云查看器主窗口
|
||||
@ -37,55 +37,55 @@ class CloudViewMainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
struct StartupFiles
|
||||
{
|
||||
QStringList displayFiles;
|
||||
QStringList bboxFiles;
|
||||
QStringList circleFiles;
|
||||
QStringList rectangleFiles;
|
||||
QStringList surfaceFiles;
|
||||
QStringList triangleFiles;
|
||||
bool sequential = false;
|
||||
};
|
||||
|
||||
explicit CloudViewMainWindow(QWidget* parent = nullptr);
|
||||
~CloudViewMainWindow() override;
|
||||
|
||||
bool loadStartupFiles(const StartupFiles& files);
|
||||
bool loadDisplayFile(const QString& fileName);
|
||||
bool loadCircleShapeFile(const QString& fileName);
|
||||
bool loadRectangleShapeFile(const QString& fileName);
|
||||
bool loadSurfaceShapeFile(const QString& fileName);
|
||||
bool loadTriangleShapeFile(const QString& fileName);
|
||||
void fitViewToContent();
|
||||
public:
|
||||
struct StartupFiles
|
||||
{
|
||||
QStringList displayFiles;
|
||||
QStringList bboxFiles;
|
||||
QStringList circleFiles;
|
||||
QStringList rectangleFiles;
|
||||
QStringList surfaceFiles;
|
||||
QStringList triangleFiles;
|
||||
bool sequential = false;
|
||||
};
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
private:
|
||||
enum class StartupFileType
|
||||
{
|
||||
Display,
|
||||
BBox,
|
||||
Circle,
|
||||
Rectangle,
|
||||
Surface,
|
||||
Triangle
|
||||
};
|
||||
|
||||
struct StartupItem
|
||||
{
|
||||
StartupFileType type;
|
||||
QString fileName;
|
||||
};
|
||||
|
||||
void buildStartupSequence(const StartupFiles& files);
|
||||
bool loadStartupItem(const StartupItem& item);
|
||||
bool loadCurrentStartupSequenceItem();
|
||||
|
||||
private slots:
|
||||
explicit CloudViewMainWindow(QWidget* parent = nullptr);
|
||||
~CloudViewMainWindow() override;
|
||||
|
||||
bool loadStartupFiles(const StartupFiles& files);
|
||||
bool loadDisplayFile(const QString& fileName);
|
||||
bool loadCircleShapeFile(const QString& fileName);
|
||||
bool loadRectangleShapeFile(const QString& fileName);
|
||||
bool loadSurfaceShapeFile(const QString& fileName);
|
||||
bool loadTriangleShapeFile(const QString& fileName);
|
||||
void fitViewToContent();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
private:
|
||||
enum class StartupFileType
|
||||
{
|
||||
Display,
|
||||
BBox,
|
||||
Circle,
|
||||
Rectangle,
|
||||
Surface,
|
||||
Triangle
|
||||
};
|
||||
|
||||
struct StartupItem
|
||||
{
|
||||
StartupFileType type;
|
||||
QString fileName;
|
||||
};
|
||||
|
||||
void buildStartupSequence(const StartupFiles& files);
|
||||
bool loadStartupItem(const StartupItem& item);
|
||||
bool loadCurrentStartupSequenceItem();
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief 打开文件
|
||||
*/
|
||||
@ -146,11 +146,6 @@ private slots:
|
||||
*/
|
||||
void onPoint2CoordChanged();
|
||||
|
||||
/**
|
||||
* @brief 处理视角旋转角度改变事件
|
||||
*/
|
||||
void onViewAnglesChanged(float rotX, float rotY, float rotZ);
|
||||
|
||||
/**
|
||||
* @brief 通过输入线号选择线
|
||||
*/
|
||||
@ -211,11 +206,11 @@ private slots:
|
||||
void onSavePointCloud(); // 保存 txt 点云
|
||||
void onSavePlyPcdCloud(); // 保存 ply/pcd 点云
|
||||
void onBatchConvertTxtToPly(); // 批量转换 txt -> ply
|
||||
void onConvertEulerMatrix();
|
||||
void onShowCircleShape();
|
||||
void onShowRectangleShape();
|
||||
void onShowSurfaceShape();
|
||||
void onShowTriangleShape();
|
||||
void onConvertEulerMatrix();
|
||||
void onShowCircleShape();
|
||||
void onShowRectangleShape();
|
||||
void onShowSurfaceShape();
|
||||
void onShowTriangleShape();
|
||||
|
||||
/**
|
||||
* @brief 姿态补偿计算
|
||||
@ -243,11 +238,6 @@ private:
|
||||
*/
|
||||
QGroupBox* createFileGroup();
|
||||
|
||||
/**
|
||||
* @brief 创建视图方向工具栏(纵向排列,位于3D视图左侧)
|
||||
*/
|
||||
QWidget* createViewToolbar();
|
||||
|
||||
/**
|
||||
* @brief 创建选点测距组
|
||||
*/
|
||||
@ -276,14 +266,14 @@ private:
|
||||
/**
|
||||
* @brief 更新选点信息显示
|
||||
*/
|
||||
void updateSelectedPointsDisplay();
|
||||
void clearMeasureResultDisplay();
|
||||
void updateMeasureResultDisplay(const SelectedPointInfo& p1,
|
||||
const SelectedPointInfo& p2,
|
||||
float distance,
|
||||
const QString& statusPrefix = QString());
|
||||
|
||||
/**
|
||||
void updateSelectedPointsDisplay();
|
||||
void clearMeasureResultDisplay();
|
||||
void updateMeasureResultDisplay(const SelectedPointInfo& p1,
|
||||
const SelectedPointInfo& p2,
|
||||
float distance,
|
||||
const QString& statusPrefix = QString());
|
||||
|
||||
/**
|
||||
* @brief 从原始数据获取线上点(包含0,0,0)
|
||||
*/
|
||||
QVector<QVector3D> getOriginalLinePoints(const SelectedLineInfo& lineInfo);
|
||||
@ -310,12 +300,12 @@ private:
|
||||
* @return 是否成功加载到包围盒数据
|
||||
*/
|
||||
bool loadBoundingBoxFile(const QString& fileName);
|
||||
void applyTransformToAllClouds(const QMatrix4x4& matrix);
|
||||
void addGeneratedCloud(const PointCloudXYZ& cloud, const QString& name);
|
||||
void showBasicShape(const QString& shapeName,
|
||||
const QVector<LineSegment>& segments,
|
||||
const QVector<BasicShapePoint>& points = QVector<BasicShapePoint>());
|
||||
void showBasicSurface(const QString& shapeName, const QVector<SurfaceQuad>& surfaces, const QVector<LineSegment>& outlines);
|
||||
void applyTransformToAllClouds(const QMatrix4x4& matrix);
|
||||
void addGeneratedCloud(const PointCloudXYZ& cloud, const QString& name);
|
||||
void showBasicShape(const QString& shapeName,
|
||||
const QVector<LineSegment>& segments,
|
||||
const QVector<BasicShapePoint>& points = QVector<BasicShapePoint>());
|
||||
void showBasicSurface(const QString& shapeName, const QVector<SurfaceQuad>& surfaces, const QVector<LineSegment>& outlines);
|
||||
|
||||
// 点云显示控件
|
||||
PointCloudGLWidget* m_glWidget;
|
||||
@ -328,18 +318,13 @@ private:
|
||||
QPushButton* m_btnOpenBBox;
|
||||
QPushButton* m_btnClearAll;
|
||||
|
||||
// 视图角度输入控件
|
||||
QLineEdit* m_editRotX;
|
||||
QLineEdit* m_editRotY;
|
||||
QLineEdit* m_editRotZ;
|
||||
|
||||
// 选点测距控件
|
||||
QCheckBox* m_cbMeasureDistance;
|
||||
QPushButton* m_btnClearPoints;
|
||||
QLabel* m_lblPoint1;
|
||||
QLabel* m_lblPoint2;
|
||||
QLabel* m_lblDistance;
|
||||
QLabel* m_lblDeltaXYZ;
|
||||
QLabel* m_lblPoint1;
|
||||
QLabel* m_lblPoint2;
|
||||
QLabel* m_lblDistance;
|
||||
QLabel* m_lblDeltaXYZ;
|
||||
|
||||
// 点1坐标编辑控件
|
||||
QLineEdit* m_editPoint1X;
|
||||
@ -407,14 +392,10 @@ private:
|
||||
QTableWidget* m_linePointsTable;
|
||||
QVector<QVector3D> m_currentLinePoints; // 当前线的原始点坐标
|
||||
|
||||
// 悬浮缩放按钮
|
||||
QToolButton* m_btnZoomIn;
|
||||
QToolButton* m_btnZoomOut;
|
||||
|
||||
// 启动参数序列显示
|
||||
QVector<StartupItem> m_startupSequence;
|
||||
int m_startupSequenceIndex;
|
||||
bool m_startupSequentialMode;
|
||||
};
|
||||
// 启动参数序列显示
|
||||
QVector<StartupItem> m_startupSequence;
|
||||
int m_startupSequenceIndex;
|
||||
bool m_startupSequentialMode;
|
||||
};
|
||||
|
||||
#endif // CLOUD_VIEW_MAIN_WINDOW_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@
|
||||
#include <QOpenGLWidget>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QMatrix4x4>
|
||||
#include <QVector3D>
|
||||
#include <QQuaternion>
|
||||
@ -11,8 +12,13 @@
|
||||
#include <QWheelEvent>
|
||||
#include <vector>
|
||||
|
||||
#include "CloudView3DTypes.h"
|
||||
#include "VZNL_Types.h"
|
||||
#include "CloudView3DTypes.h"
|
||||
#include "VZNL_Types.h"
|
||||
|
||||
class QToolButton;
|
||||
class QPushButton;
|
||||
class QPinchGesture;
|
||||
class QResizeEvent;
|
||||
|
||||
/**
|
||||
* @brief 点云显示颜色枚举
|
||||
@ -84,58 +90,58 @@ struct SelectedLineInfo
|
||||
/**
|
||||
* @brief 线段数据
|
||||
*/
|
||||
struct LineSegment
|
||||
{
|
||||
float x1, y1, z1; // 起点
|
||||
float x2, y2, z2; // 终点
|
||||
struct LineSegment
|
||||
{
|
||||
float x1, y1, z1; // 起点
|
||||
float x2, y2, z2; // 终点
|
||||
float r, g, b; // 颜色 (0-1)
|
||||
float lineWidth; // 线宽,0 表示使用默认值(来自 RGBA 中 A > 1 的值)
|
||||
|
||||
LineSegment() : x1(0), y1(0), z1(0), x2(0), y2(0), z2(0), r(1), g(1), b(1), lineWidth(0) {}
|
||||
LineSegment(float _x1, float _y1, float _z1, float _x2, float _y2, float _z2, float _r = 1.0f, float _g = 1.0f, float _b = 1.0f, float _lw = 0)
|
||||
: x1(_x1), y1(_y1), z1(_z1), x2(_x2), y2(_y2), z2(_z2), r(_r), g(_g), b(_b), lineWidth(_lw) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 面片数据
|
||||
*/
|
||||
struct SurfaceQuad
|
||||
{
|
||||
QVector3D p1, p2, p3, p4;
|
||||
float r, g, b, a;
|
||||
|
||||
SurfaceQuad() : p1(), p2(), p3(), p4(), r(0.0f), g(0.8f), b(1.0f), a(0.5f) {}
|
||||
SurfaceQuad(const QVector3D& _p1,
|
||||
const QVector3D& _p2,
|
||||
const QVector3D& _p3,
|
||||
const QVector3D& _p4,
|
||||
float _r = 0.0f,
|
||||
float _g = 0.8f,
|
||||
float _b = 1.0f,
|
||||
float _a = 0.5f)
|
||||
: p1(_p1), p2(_p2), p3(_p3), p4(_p4), r(_r), g(_g), b(_b), a(_a) {}
|
||||
};
|
||||
|
||||
struct BasicShapePoint
|
||||
{
|
||||
float x, y, z;
|
||||
float r, g, b;
|
||||
float pointSize;
|
||||
|
||||
BasicShapePoint() : x(0), y(0), z(0), r(1), g(1), b(1), pointSize(8.0f) {}
|
||||
BasicShapePoint(float _x,
|
||||
float _y,
|
||||
float _z,
|
||||
float _r = 1.0f,
|
||||
float _g = 1.0f,
|
||||
float _b = 1.0f,
|
||||
float _size = 8.0f)
|
||||
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), pointSize(_size) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 姿态点数据
|
||||
*
|
||||
: x1(_x1), y1(_y1), z1(_z1), x2(_x2), y2(_y2), z2(_z2), r(_r), g(_g), b(_b), lineWidth(_lw) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 面片数据
|
||||
*/
|
||||
struct SurfaceQuad
|
||||
{
|
||||
QVector3D p1, p2, p3, p4;
|
||||
float r, g, b, a;
|
||||
|
||||
SurfaceQuad() : p1(), p2(), p3(), p4(), r(0.0f), g(0.8f), b(1.0f), a(0.5f) {}
|
||||
SurfaceQuad(const QVector3D& _p1,
|
||||
const QVector3D& _p2,
|
||||
const QVector3D& _p3,
|
||||
const QVector3D& _p4,
|
||||
float _r = 0.0f,
|
||||
float _g = 0.8f,
|
||||
float _b = 1.0f,
|
||||
float _a = 0.5f)
|
||||
: p1(_p1), p2(_p2), p3(_p3), p4(_p4), r(_r), g(_g), b(_b), a(_a) {}
|
||||
};
|
||||
|
||||
struct BasicShapePoint
|
||||
{
|
||||
float x, y, z;
|
||||
float r, g, b;
|
||||
float pointSize;
|
||||
|
||||
BasicShapePoint() : x(0), y(0), z(0), r(1), g(1), b(1), pointSize(8.0f) {}
|
||||
BasicShapePoint(float _x,
|
||||
float _y,
|
||||
float _z,
|
||||
float _r = 1.0f,
|
||||
float _g = 1.0f,
|
||||
float _b = 1.0f,
|
||||
float _size = 8.0f)
|
||||
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), pointSize(_size) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 姿态点数据
|
||||
*
|
||||
* 坐标系约定(右手坐标系):
|
||||
* - X轴:红色,指向右
|
||||
* - Y轴:绿色,指向上
|
||||
@ -168,15 +174,15 @@ public:
|
||||
explicit PointCloudGLWidget(QWidget* parent = nullptr);
|
||||
~PointCloudGLWidget() override;
|
||||
|
||||
void addPointCloud(const PointCloudXYZ& cloud, const QString& name = "");
|
||||
void addPointCloud(const PointCloudXYZRGB& cloud, const QString& name = "");
|
||||
void appendPointCloud(const PointCloudXYZRGB& cloud, const QString& name = "");
|
||||
void clearPointClouds();
|
||||
void setPointCloudColor(PointCloudColor color);
|
||||
void setPointSize(float size);
|
||||
void resetView();
|
||||
void fitToContent();
|
||||
void zoomIn();
|
||||
void addPointCloud(const PointCloudXYZ& cloud, const QString& name = "");
|
||||
void addPointCloud(const PointCloudXYZRGB& cloud, const QString& name = "");
|
||||
void appendPointCloud(const PointCloudXYZRGB& cloud, const QString& name = "");
|
||||
void clearPointClouds();
|
||||
void setPointCloudColor(PointCloudColor color);
|
||||
void setPointSize(float size);
|
||||
void resetView();
|
||||
void fitToContent();
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
/**
|
||||
* @brief 设置视角旋转角度(不改变缩放和平移)
|
||||
@ -308,26 +314,26 @@ public:
|
||||
*/
|
||||
void clearLineSegments();
|
||||
|
||||
/**
|
||||
* @brief 设置基础图形线段
|
||||
*/
|
||||
void setBasicShapeSegments(const QVector<LineSegment>& segments);
|
||||
|
||||
/**
|
||||
* @brief 追加基础图形线段
|
||||
*/
|
||||
void appendBasicShapeSegments(const QVector<LineSegment>& segments);
|
||||
|
||||
/**
|
||||
* @brief 追加基础图形面片
|
||||
*/
|
||||
void appendBasicShapeSurfaces(const QVector<SurfaceQuad>& surfaces);
|
||||
void appendBasicShapePoints(const QVector<BasicShapePoint>& points);
|
||||
|
||||
/**
|
||||
* @brief 清除基础图形线段
|
||||
*/
|
||||
void clearBasicShapeSegments();
|
||||
/**
|
||||
* @brief 设置基础图形线段
|
||||
*/
|
||||
void setBasicShapeSegments(const QVector<LineSegment>& segments);
|
||||
|
||||
/**
|
||||
* @brief 追加基础图形线段
|
||||
*/
|
||||
void appendBasicShapeSegments(const QVector<LineSegment>& segments);
|
||||
|
||||
/**
|
||||
* @brief 追加基础图形面片
|
||||
*/
|
||||
void appendBasicShapeSurfaces(const QVector<SurfaceQuad>& surfaces);
|
||||
void appendBasicShapePoints(const QVector<BasicShapePoint>& points);
|
||||
|
||||
/**
|
||||
* @brief 清除基础图形线段
|
||||
*/
|
||||
void clearBasicShapeSegments();
|
||||
|
||||
/**
|
||||
* @brief 添加姿态点
|
||||
@ -339,20 +345,21 @@ public:
|
||||
*/
|
||||
void clearPosePoints();
|
||||
|
||||
signals:
|
||||
void pointSelected(const SelectedPointInfo& point);
|
||||
void twoPointsSelected(const SelectedPointInfo& p1, const SelectedPointInfo& p2, float distance);
|
||||
void measurementFinished(const SelectedPointInfo& p1,
|
||||
const SelectedPointInfo& p2,
|
||||
float distance,
|
||||
float dx,
|
||||
float dy,
|
||||
float dz);
|
||||
void lineSelected(const SelectedLineInfo& line);
|
||||
void viewAnglesChanged(float rotX, float rotY, float rotZ);
|
||||
signals:
|
||||
void pointSelected(const SelectedPointInfo& point);
|
||||
void twoPointsSelected(const SelectedPointInfo& p1, const SelectedPointInfo& p2, float distance);
|
||||
void measurementFinished(const SelectedPointInfo& p1,
|
||||
const SelectedPointInfo& p2,
|
||||
float distance,
|
||||
float dx,
|
||||
float dy,
|
||||
float dz);
|
||||
void lineSelected(const SelectedLineInfo& line);
|
||||
void viewAnglesChanged(float rotX, float rotY, float rotZ);
|
||||
|
||||
protected:
|
||||
void initializeGL() override;
|
||||
protected:
|
||||
bool event(QEvent* event) override;
|
||||
void initializeGL() override;
|
||||
void resizeGL(int w, int h) override;
|
||||
void paintGL() override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
@ -361,6 +368,7 @@ protected:
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
|
||||
private:
|
||||
struct PointCloudData
|
||||
@ -455,34 +463,69 @@ private:
|
||||
PointCloudData& operator=(const PointCloudData&) = delete;
|
||||
};
|
||||
|
||||
void computeBoundingBox();
|
||||
void updateProjection(const QMatrix4x4& modelView);
|
||||
float minimumCameraDistance() const;
|
||||
void setCurrentColor(PointCloudColor color);
|
||||
void setColorByIndex(int colorIndex); // 根据索引设置颜色
|
||||
void computeBoundingBox();
|
||||
void updateProjection(const QMatrix4x4& modelView);
|
||||
float fittedCameraDistance(float padding = 1.05f) const;
|
||||
float minimumCameraDistance() const;
|
||||
QVector3D colorForIndex(int colorIndex) const;
|
||||
SelectedPointInfo pickPoint(int screenX, int screenY);
|
||||
void drawSelectedPoints();
|
||||
void drawMeasurementLine();
|
||||
void drawAxis();
|
||||
void drawSelectedLine(); // 绘制选中的线
|
||||
void drawLineSegments(); // 绘制线段
|
||||
void drawBasicShapeSurfaces(); // 绘制基础图形面片
|
||||
void drawBasicShapeSegments(); // 绘制基础图形
|
||||
void drawBasicShapePoints();
|
||||
void drawLineSegmentList(const QVector<LineSegment>& segments);
|
||||
void drawPosePoints(); // 绘制姿态点
|
||||
void drawSelectedLine(); // 绘制选中的线
|
||||
void drawLineSegments(); // 绘制线段
|
||||
void drawBasicShapeSurfaces(); // 绘制基础图形面片
|
||||
void drawBasicShapeSegments(); // 绘制基础图形
|
||||
void drawBasicShapePoints();
|
||||
void drawLineSegmentList(const QVector<LineSegment>& segments);
|
||||
void drawPosePoints(); // 绘制姿态点
|
||||
void drawAxisLabels(); // 绘制坐标轴 XYZ 标注
|
||||
void uploadToVBO(PointCloudData& data); // 上传数据到 VBO
|
||||
void releaseVBO(PointCloudData& data); // 释放 VBO 资源
|
||||
|
||||
// GLES2 shader 渲染
|
||||
bool ensureShader();
|
||||
void drawCloud(PointCloudData& data, float pointSize);
|
||||
void drawPrimitives(const QMatrix4x4& mvp,
|
||||
const float* positions,
|
||||
int vertexCount,
|
||||
GLenum mode,
|
||||
const float* colors,
|
||||
const QVector3D& uniformColor,
|
||||
float pointSize,
|
||||
float alpha,
|
||||
bool depthTest);
|
||||
void resetRenderState();
|
||||
|
||||
// 覆盖控件:左侧竖向视图按钮 / 左下角旋转角度 / 右侧缩放
|
||||
void createOverlayControls();
|
||||
void repositionOverlayControls();
|
||||
void showViewAngleDialog();
|
||||
void updateViewAngleDisplay();
|
||||
bool handlePinchGesture(QPinchGesture* gesture);
|
||||
|
||||
std::vector<PointCloudData> m_pointClouds;
|
||||
|
||||
QMatrix4x4 m_projection;
|
||||
QMatrix4x4 m_view;
|
||||
QMatrix4x4 m_model;
|
||||
QMatrix4x4 m_mvp; // 当前帧的模型视图投影矩阵(点云主渲染用)
|
||||
|
||||
float m_distance;
|
||||
float m_rotationX;
|
||||
// GLES2 shader 渲染资源
|
||||
QOpenGLShaderProgram* m_shader;
|
||||
QOpenGLBuffer m_dynamicVbo; // 动态叠加图元(选中点/线/轴/姿态等)的临时 VBO
|
||||
bool m_shaderReady;
|
||||
GLint m_mvpLocation;
|
||||
GLint m_positionLocation;
|
||||
GLint m_colorLocation;
|
||||
GLint m_pointSizeLocation;
|
||||
GLint m_alphaLocation;
|
||||
GLint m_useVertexColorLocation;
|
||||
GLint m_uniformColorLocation;
|
||||
|
||||
float m_distance;
|
||||
float m_pinchStartDistance;
|
||||
float m_rotationX;
|
||||
float m_rotationY;
|
||||
float m_rotationZ;
|
||||
QQuaternion m_rotation; // 使用四元数存储旋转状态
|
||||
@ -513,12 +556,19 @@ private:
|
||||
int m_colorIndex; // 颜色轮换索引
|
||||
static const int COLOR_COUNT = 7; // 可用颜色数量
|
||||
|
||||
// 线段和姿态点数据
|
||||
QVector<LineSegment> m_lineSegments;
|
||||
QVector<LineSegment> m_basicShapeSegments;
|
||||
QVector<SurfaceQuad> m_basicShapeSurfaces;
|
||||
QVector<BasicShapePoint> m_basicShapePoints;
|
||||
QVector<PosePoint> m_posePoints;
|
||||
};
|
||||
// 线段和姿态点数据
|
||||
QVector<LineSegment> m_lineSegments;
|
||||
QVector<LineSegment> m_basicShapeSegments;
|
||||
QVector<SurfaceQuad> m_basicShapeSurfaces;
|
||||
QVector<BasicShapePoint> m_basicShapePoints;
|
||||
QVector<PosePoint> m_posePoints;
|
||||
|
||||
// 覆盖控件
|
||||
QWidget* m_viewToolbar; // 左侧竖向视图按钮容器
|
||||
QVector<QToolButton*> m_viewButtons;
|
||||
QPushButton* m_viewAngleButton; // 左下角旋转角度显示按钮
|
||||
QToolButton* m_zoomInButton;
|
||||
QToolButton* m_zoomOutButton;
|
||||
};
|
||||
|
||||
#endif // POINT_CLOUD_GL_WIDGET_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user