QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
qgschunkboundsentity_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgschunkboundsentity_p.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCHUNKBOUNDSENTITY_P_H
17#define QGSCHUNKBOUNDSENTITY_P_H
18
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the QGIS API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29
30#include <Qt3DCore/QEntity>
31
32#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
33#include <Qt3DRender/QAttribute>
34#include <Qt3DRender/QGeometry>
35typedef Qt3DRender::QAttribute Qt3DQAttribute;
36typedef Qt3DRender::QGeometry Qt3DQGeometry;
37#else
38#include <Qt3DCore/QAttribute>
39#include <Qt3DCore/QGeometry>
40typedef Qt3DCore::QAttribute Qt3DQAttribute;
41typedef Qt3DCore::QGeometry Qt3DQGeometry;
42#endif
43#include <QVector3D>
44#include <Qt3DRender/QGeometryRenderer>
45
46class QgsAABB;
47class AABBMesh;
48
49#define SIP_NO_FILE
50
51
58class QgsChunkBoundsEntity : public Qt3DCore::QEntity
59{
60 Q_OBJECT
61
62 public:
64 QgsChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );
65
67 void setBoxes( const QList<QgsAABB> &bboxes );
68
69 private:
70 AABBMesh *mAabbMesh = nullptr;
71};
72
73
74class LineMeshGeometry : public Qt3DQGeometry
75{
76 Q_OBJECT
77
78 public:
79 LineMeshGeometry( Qt3DCore::QNode *parent = nullptr );
80
81 int vertexCount()
82 {
83 return mVertexCount;
84 }
85
86 void setVertices( const QList<QVector3D> &vertices );
87
88 private:
89 Qt3DQAttribute *mPositionAttribute = nullptr;
90#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
91 Qt3DRender::QBuffer *mVertexBuffer = nullptr;
92#else
93 Qt3DCore::QBuffer *mVertexBuffer = nullptr;
94#endif
95 int mVertexCount = 0;
96
97};
98
99
101class AABBMesh : public Qt3DRender::QGeometryRenderer
102{
103 Q_OBJECT
104
105 public:
106 AABBMesh( Qt3DCore::QNode *parent = nullptr );
107
108 void setBoxes( const QList<QgsAABB> &bboxes );
109
110 private:
111 LineMeshGeometry *mLineMeshGeo = nullptr;
112};
113
115
116#endif // QGSCHUNKBOUNDSENTITY_P_H
3
Definition: qgsaabb.h:34
Qt3DCore::QAttribute Qt3DQAttribute
Definition: qgs3daxis.cpp:28
Qt3DCore::QGeometry Qt3DQGeometry
Definition: qgs3daxis.cpp:29