1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial 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 QtDataVisualization 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#ifndef VERTEXINDEXER_P_H
15#define VERTEXINDEXER_P_H
16
17#include "datavisualizationglobal_p.h"
18
19#include <QtCore/QList>
20#include <QtGui/QVector2D>
21
22QT_BEGIN_NAMESPACE
23
24class VertexIndexer
25{
26public:
27 struct PackedVertex {
28 QVector3D position;
29 QVector2D uv;
30 QVector3D normal;
31 bool operator<(const PackedVertex that) const {
32 return memcmp(s1: (void*)this, s2: (void*)&that, n: sizeof(PackedVertex)) > 0;
33 }
34 };
35
36 static void indexVBO(const QList<QVector3D> &in_vertices, const QList<QVector2D> &in_uvs,
37 const QList<QVector3D> &in_normals, QList<GLuint> &out_indices,
38 QList<QVector3D> &out_vertices, QList<QVector2D> &out_uvs,
39 QList<QVector3D> &out_normals);
40
41private:
42 static bool getSimilarVertexIndex_fast(const PackedVertex &packed,
43 QMap<PackedVertex, GLuint> &VertexToOutIndex,
44 GLuint &result);
45};
46
47QT_END_NAMESPACE
48
49#endif
50

source code of qtdatavis3d/src/datavisualization/utils/vertexindexer_p.h