QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
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
57class QgsChunkBoundsEntity : public Qt3DCore::QEntity
58{
59 Q_OBJECT
60
61 public:
63 QgsChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );
64
66 void setBoxes( const QList<QgsAABB> &bboxes );
67
68 private:
69 AABBMesh *mAabbMesh = nullptr;
70};
71
72
73class LineMeshGeometry : public Qt3DQGeometry
74{
75 Q_OBJECT
76
77 public:
78 LineMeshGeometry( Qt3DCore::QNode *parent = nullptr );
79
80 int vertexCount()
81 {
82 return mVertexCount;
83 }
84
85 void setVertices( const QList<QVector3D> &vertices );
86
87 private:
88 Qt3DQAttribute *mPositionAttribute = nullptr;
89#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
90 Qt3DRender::QBuffer *mVertexBuffer = nullptr;
91#else
92 Qt3DCore::QBuffer *mVertexBuffer = nullptr;
93#endif
94 int mVertexCount = 0;
95
96};
97
98
100class AABBMesh : public Qt3DRender::QGeometryRenderer
101{
102 Q_OBJECT
103
104 public:
105 AABBMesh( Qt3DCore::QNode *parent = nullptr );
106
107 void setBoxes( const QList<QgsAABB> &bboxes );
108
109 private:
110 LineMeshGeometry *mLineMeshGeo = nullptr;
111};
112
114
115#endif // QGSCHUNKBOUNDSENTITY_P_H
Qt3DCore::QAttribute Qt3DQAttribute
Definition qgs3daxis.cpp:28
Qt3DCore::QGeometry Qt3DQGeometry
Definition qgs3daxis.cpp:29