QWT API (中文)
7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
src
plot3d
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
37
struct
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
// True while the scene is replayed for the gl2ps vector capture: line and
47
// polygon draws then use qwt3dEmitVerticesForVectorExport() instead of the
48
// shader paths (the feedback buffer needs explicit colors)
49
bool
vectorExport =
false
;
50
51
// Shared shader programs (non-owning pointers, valid during paintGL)
52
QOpenGLShaderProgram* lineShader =
nullptr
;
53
QOpenGLShaderProgram* polygonShader =
nullptr
;
54
QOpenGLShaderProgram* textShader =
nullptr
;
55
56
// Projects a world-space point to screen (viewport) pixel coordinates
57
QPointF worldToScreen(
const
Triple
& world)
const
;
58
59
// Unprojects a screen (viewport) pixel point to world-space coordinates
60
Triple
screenToWorld(
const
QPointF& screen)
const
;
61
62
// Converts a relative viewport position [0..1] to world coordinates
63
Triple
relativePosition(
Triple
rel)
const
;
64
};
65
66
#endif
Qwt3DRenderContext
Bundles all widget resources that drawables need during rendering
Definition
qwt3d_render_context.h:38
Triple
Triple [x,y,z]
Definition
qwt3d_types.h:201
制作者
1.9.8