Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopengl2pexvertexarray_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QOPENGL2PEXVERTEXARRAY_P_H
16#define QOPENGL2PEXVERTEXARRAY_P_H
17
18#include <QRectF>
19
20#include <private/qdatabuffer_p.h>
21#include <private/qvectorpath_p.h>
22#include <private/qopenglcontext_p.h>
23
25
27{
28public:
30 x(new_x), y(new_y) {}
31
33 x(p.x()), y(p.y()) {}
34
36 x(p->x()), y(p->y()) {}
37
40
41 operator QPointF() {return QPointF(x,y);}
42 operator QPointF() const {return QPointF(x,y);}
43};
45
47{
49 : left(r.left()), top(r.top()), right(r.right()), bottom(r.bottom()) {}
50
53
58
59 operator QRectF() const {return QRectF(left, top, right-left, bottom-top);}
60};
62
64{
65public:
67 vertexArray(0), vertexArrayStops(0),
68 maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
69 boundingRectDirty(true)
70 { }
71
72 inline void addRect(const QRectF &rect)
73 {
74 qreal top = rect.top();
75 qreal left = rect.left();
76 qreal bottom = rect.bottom();
77 qreal right = rect.right();
78
79 vertexArray << QOpenGLPoint(left, top)
85 }
86
87 inline void addQuad(const QRectF &rect)
88 {
89 qreal top = rect.top();
90 qreal left = rect.left();
91 qreal bottom = rect.bottom();
92 qreal right = rect.right();
93
94 vertexArray << QOpenGLPoint(left, top)
98
99 }
100
101 inline void addVertex(const GLfloat x, const GLfloat y)
102 {
103 vertexArray.add(QOpenGLPoint(x, y));
104 }
105
106 void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
107 void clear();
108
109 QOpenGLPoint* data() {return vertexArray.data();}
110 int *stops() const { return vertexArrayStops.data(); }
111 int stopCount() const { return vertexArrayStops.size(); }
113
114 int vertexCount() const { return vertexArray.size(); }
115
116 void lineToArray(const GLfloat x, const GLfloat y);
117
118private:
119 QDataBuffer<QOpenGLPoint> vertexArray;
120 QDataBuffer<int> vertexArrayStops;
121
124 GLfloat minX;
126 bool boundingRectDirty;
127 void addClosingLine(int index);
128 void addCentroid(const QVectorPath &path, int subPathIndex);
129};
130
132
133#endif
void add(const Type &t)
qsizetype size() const
Type * data() const
void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline=true)
void addQuad(const QRectF &rect)
void addRect(const QRectF &rect)
void lineToArray(const GLfloat x, const GLfloat y)
void addVertex(const GLfloat x, const GLfloat y)
QOpenGLPoint(const QPointF &p)
QOpenGLPoint(const QPointF *p)
QOpenGLPoint(GLfloat new_x, GLfloat new_y)
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qrect.h:484
rect
[4]
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
typedef GLfloat(GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path
GLfloat GLfloat GLfloat GLfloat GLfloat maxY
GLuint index
[2]
GLboolean r
[2]
GLdouble GLdouble GLdouble GLdouble top
GLfloat minY
GLdouble GLdouble right
GLint left
GLint GLint bottom
GLint y
GLfloat GLfloat GLfloat GLfloat maxX
GLdouble GLdouble t
Definition qopenglext.h:243
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
double qreal
Definition qtypes.h:187
QOpenGLRect(GLfloat l, GLfloat t, GLfloat r, GLfloat b)
QOpenGLRect(const QRectF &r)