QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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 #include <Qt3DRender/QAttribute>
32 #include <Qt3DRender/QGeometry>
33 #include <QVector3D>
34 #include <Qt3DRender/QGeometryRenderer>
35 
36 class QgsAABB;
37 class AABBMesh;
38 
39 #define SIP_NO_FILE
40 
41 
48 class QgsChunkBoundsEntity : public Qt3DCore::QEntity
49 {
50  Q_OBJECT
51 
52  public:
54  QgsChunkBoundsEntity( Qt3DCore::QNode *parent = nullptr );
55 
57  void setBoxes( const QList<QgsAABB> &bboxes );
58 
59  private:
60  AABBMesh *mAabbMesh = nullptr;
61 };
62 
63 
64 class LineMeshGeometry : public Qt3DRender::QGeometry
65 {
66  Q_OBJECT
67 
68  public:
69  LineMeshGeometry( Qt3DCore::QNode *parent = nullptr );
70 
71  int vertexCount()
72  {
73  return mVertexCount;
74  }
75 
76  void setVertices( const QList<QVector3D> &vertices );
77 
78  private:
79  Qt3DRender::QAttribute *mPositionAttribute = nullptr;
80  Qt3DRender::QBuffer *mVertexBuffer = nullptr;
81  int mVertexCount = 0;
82 
83 };
84 
85 
87 class AABBMesh : public Qt3DRender::QGeometryRenderer
88 {
89  Q_OBJECT
90 
91  public:
92  AABBMesh( Qt3DCore::QNode *parent = nullptr );
93 
94  void setBoxes( const QList<QgsAABB> &bboxes );
95 
96  private:
97  LineMeshGeometry *mLineMeshGeo = nullptr;
98 };
99 
101 
102 #endif // QGSCHUNKBOUNDSENTITY_P_H
3
Definition: qgsaabb.h:34