QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_render_context.h
1#ifndef QWT3D_RENDER_CONTEXT_H
2#define QWT3D_RENDER_CONTEXT_H
3
4#include "qwt3d_global.h"
5#include "qwt3d_types.h"
6
7#include <QMatrix4x4>
8#include <QOpenGLShaderProgram>
9#include <QPointF>
10#include <QSize>
11
37struct QWT3D_EXPORT Qwt3DRenderContext
38{
39 // Matrices — current at time of construction (per-call-site in paintGL)
40 QMatrix4x4 modelView;
41 QMatrix4x4 projection;
42
43 // Viewport in pixels (already resolved from widget size fallback)
44 QSize viewport;
45
46 // Shared shader programs (non-owning pointers, valid during paintGL)
47 QOpenGLShaderProgram* lineShader = nullptr;
48 QOpenGLShaderProgram* polygonShader = nullptr;
49 QOpenGLShaderProgram* textShader = nullptr;
50
51 // Projects a world-space point to screen (viewport) pixel coordinates
52 QPointF worldToScreen(const Triple& world) const;
53
54 // Unprojects a screen (viewport) pixel point to world-space coordinates
55 Triple screenToWorld(const QPointF& screen) const;
56
57 // Converts a relative viewport position [0..1] to world coordinates
58 Triple relativePosition(Triple rel) const;
59};
60
61#endif
Bundles all widget resources that drawables need during rendering
Definition qwt3d_render_context.h:38
Triple [x,y,z]
Definition qwt3d_types.h:201