Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgcurveprocessor_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 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#ifndef QSGCURVEPROCESSOR_P_H
5#define QSGCURVEPROCESSOR_P_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 <QtQuick/qtquickexports.h>
19#include <QtQuick/private/qquadpath_p.h>
21
22#include <QtCore/qloggingcategory.h>
23
24QT_BEGIN_NAMESPACE
25
26Q_DECLARE_LOGGING_CATEGORY(lcSGCurveProcessor);
27
28class Q_QUICK_EXPORT QSGCurveProcessor
29{
30public:
31 typedef std::function<QVector3D(QVector2D)> uvForPointCallback;
32 typedef std::function<void(const std::array<QVector2D, 3> &,
33 const std::array<QVector2D, 3> &,
34 uvForPointCallback)> addTriangleCallback;
35 typedef std::function<void(const std::array<QVector2D, 3> &, // vertex coordinates
36 const std::array<QVector2D, 3> &, // start, control, end
37 const std::array<QVector2D, 3> &, // normals
38 const std::array<float, 3> &, // extrusions
39 QSGCurveStrokeNode::TriangleFlags)> addStrokeTriangleCallback;
40
41 static void processFill(const QQuadPath &path,
42 Qt::FillRule fillRule,
43 addTriangleCallback addTriangle);
44 static void processStroke(const QQuadPath &strokePath,
45 float miterLimit,
46 float penWidth,
47 bool cosmetic,
48 Qt::PenJoinStyle joinStyle,
49 Qt::PenCapStyle capStyle,
50 addStrokeTriangleCallback addTriangle,
51 int subdivisions = 3);
52 static bool solveOverlaps(QQuadPath &path);
53 static QList<std::pair<int, int>> findOverlappingCandidates(const QQuadPath &path);
54 static bool removeNestedSubpaths(QQuadPath &path);
55 static bool solveIntersections(QQuadPath &path, bool removeNestedPaths = true);
56};
57
58QT_END_NAMESPACE
59
60#endif // QSGCURVEPROCESSOR_P_H