Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qssgdebugdrawsystem_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGDEBUGDRAWSYSTEM_H
5#define QSSGDEBUGDRAWSYSTEM_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
20#include <QtQuick3DUtils/private/qssgbounds3_p.h>
21#include <QtGui/QVector3D>
22#include <QtGui/QColor>
23
25
26class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGDebugDrawSystem
27{
28 Q_DISABLE_COPY(QSSGDebugDrawSystem)
29public:
32
33 bool hasContent() const;
34
35 void drawLine(const QVector3D &startPoint,
36 const QVector3D &endPoint,
37 const QColor &color,
38 bool isPersistent = false);
39 void drawBounds(const QSSGBounds3 &bounds,
40 const QColor &color,
41 bool isPersistent = false);
42 void drawPoint(const QVector3D &vertex,
43 const QColor &color,
44 bool isPersistent = false);
45
46 void prepareGeometry(QSSGRhiContext *rhiCtx, QRhiResourceUpdateBatch *rub);
47 void recordRenderDebugObjects(QSSGRhiContext *rhiCtx,
51
52private:
53 struct LineData {
54 QVector3D startPoint;
55 QVector3D endPoint;
57 };
58 struct BoundsData {
59 QSSGBounds3 bounds;
61 };
62 struct VertexData {
65 };
66
67
68 void generateLine(const LineData &line, QVector<VertexData> &vertexArray, QVector<quint32> &indexArray);
69 void generateBox(const BoundsData &bounds, QVector<VertexData> &vertexArray, QVector<quint32> &indexArray);
70
71
72 quint32 m_indexSize = 0;
73 quint32 m_pointsSize = 0;
74 QVector<LineData> m_persistentLines;
75 QVector<LineData> m_lines;
76 QVector<BoundsData> m_persistentBounds;
77 QVector<BoundsData> m_bounds;
78 QVector<VertexData> m_persistentPoints;
79 QVector<VertexData> m_points;
80
81 QSSGRhiBufferPtr m_lineVertexBuffer;
82 QSSGRhiBufferPtr m_lineIndexBuffer;
83 QSSGRhiBufferPtr m_pointVertexBuffer;
84};
85
87
88#endif // QSSGDEBUGDRAWSYSTEM_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
Definition qlist.h:74
\inmodule QtGui
Definition qrhi.h:1119
\inmodule QtGui
Definition qrhi.h:1694
\inmodule QtGui
Definition qrhi.h:1190
Class representing 3D range or axis aligned bounding box.
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
std::shared_ptr< QSSGRhiBuffer > QSSGRhiBufferPtr
unsigned int quint32
Definition qtypes.h:45