4#ifndef QSGCURVEFILLNODE_P_H
5#define QSGCURVEFILLNODE_P_H
7#include <QtGui/qbrush.h>
9#include <QtQuick/qtquickexports.h>
10#include <QtQuick/private/qsggradientcache_p.h>
11#include <QtQuick/private/qsgtransform_p.h>
12#include <QtQuick/qsgnode.h>
49 m_fillGradient = fillGradient;
54 return &m_fillGradient;
59 if (m_gradientType !=
type) {
60 m_gradientType =
type;
67 return m_gradientType;
77 return &m_fillTransform;
91 const std::array<QVector2D, 3> &
n,
102 m_uncookedIndexes.append(m_uncookedVertexes.size());
103 m_uncookedVertexes.append( {
v[0].x(),
v[0].
y(),
104 uv1.
x(), uv1.
y(), uv1.
z(),
105 duvdx.
x(), duvdx.
y(),
106 duvdy.
x(), duvdy.
y(),
110 m_uncookedIndexes.append(m_uncookedVertexes.size());
111 m_uncookedVertexes.append( {
v[1].x(),
v[1].
y(),
112 uv2.x(), uv2.y(), uv2.z(),
113 duvdx.
x(), duvdx.
y(),
114 duvdy.
x(), duvdy.
y(),
118 m_uncookedIndexes.append(m_uncookedVertexes.size());
119 m_uncookedVertexes.append( {
v[2].x(),
v[2].
y(),
120 uv3.x(), uv3.y(), uv3.z(),
121 duvdx.
x(), duvdx.
y(),
122 duvdy.
x(), duvdy.
y(),
139 m_uncookedIndexes.append(m_uncookedVertexes.size());
140 m_uncookedVertexes.append( {
v1.x(),
v1.y(),
141 uv1.
x(), uv1.
y(), uv1.
z(),
142 duvdx.
x(), duvdx.
y(),
143 duvdy.
x(), duvdy.
y(),
147 m_uncookedIndexes.append(m_uncookedVertexes.size());
148 m_uncookedVertexes.append( {
v2.x(),
v2.y(),
149 uv2.x(), uv2.y(), uv2.z(),
150 duvdx.
x(), duvdx.
y(),
151 duvdy.
x(), duvdy.
y(),
155 m_uncookedIndexes.append(m_uncookedVertexes.size());
156 m_uncookedVertexes.append( {
v3.x(),
v3.y(),
157 uv3.x(), uv3.y(), uv3.z(),
158 duvdx.
x(), duvdx.
y(),
159 duvdy.
x(), duvdy.
y(),
169 appendTriangle({
v1,
v2,
v3}, {}, uvForPoint);
174 return m_uncookedIndexes;
177 void cookGeometry()
override;
181 m_uncookedIndexes.reserve(
size);
182 m_uncookedVertexes.reserve(
size);
186 struct CurveNodeVertex
189 float dudx, dvdx, dudy, dvdy;
193 void updateMaterial();
197 float m_debug = 0.0f;
202 QScopedPointer<QSGMaterial> m_material;
204 QVector<CurveNodeVertex> m_uncookedVertexes;
205 QVector<quint32> m_uncookedIndexes;
The QColor class provides colors based on RGB, HSV or CMYK values.
Type
Specifies the type of gradient.
QGradient::Type gradientType() const
void appendTriangle(const QVector2D &v1, const QVector2D &v2, const QVector2D &v3, const QVector3D &uv1, const QVector3D &uv2, const QVector3D &uv3, const QVector2D &n1, const QVector2D &n2, const QVector2D &n3, const QVector2D &duvdx, const QVector2D &duvdy)
void setDebug(float newDebug)
const QSGGradientCache::GradientDesc * fillGradient() const
void setFillGradient(const QSGGradientCache::GradientDesc &fillGradient)
void reserve(qsizetype size)
const QSGTransform * fillTransform() const
void appendTriangle(const std::array< QVector2D, 3 > &v, const std::array< QVector2D, 3 > &n, std::function< QVector3D(QVector2D)> uvForPoint)
void setFillTransform(const QSGTransform &transform)
QVector< quint32 > uncookedIndexes() const
void setColor(QColor col) override
void setGradientType(QGradient::Type type)
void appendTriangle(const QVector2D &v1, const QVector2D &v2, const QVector2D &v3, std::function< QVector3D(QVector2D)> uvForPoint)
The QVector2D class represents a vector or vertex in 2D space.
constexpr float y() const noexcept
Returns the y coordinate of this point.
constexpr float x() const noexcept
Returns the x coordinate of this point.
The QVector3D class represents a vector or vertex in 3D space.
constexpr float y() const noexcept
Returns the y coordinate of this point.
constexpr float x() const noexcept
Returns the x coordinate of this point.
constexpr float z() const noexcept
Returns the z coordinate of this point.
Combined button and popup list for selecting options.
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLfloat GLfloat GLfloat GLfloat v3
GLuint GLenum GLenum transform
The QSGGeometry::AttributeSet describes how the vertices in a QSGGeometry are built up.