QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgschunkloader_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgschunkloader_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 QGSCHUNKLOADER_P_H
17 #define QGSCHUNKLOADER_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 "qgschunkqueuejob_p.h"
31 
32 #define SIP_NO_FILE
33 
42 class QgsChunkLoader : public QgsChunkQueueJob
43 {
44  Q_OBJECT
45  public:
47  QgsChunkLoader( QgsChunkNode *node ) : QgsChunkQueueJob( node ) { }
48 
53  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0;
54 };
55 
56 
62 class QgsChunkLoaderFactory : public QObject
63 {
64  Q_OBJECT
65  public:
66  virtual ~QgsChunkLoaderFactory() = default;
67 
69  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const = 0;
70 
72  virtual int primitivesCount( QgsChunkNode *node ) const
73  {
74  Q_UNUSED( node );
75  return 0;
76  }
77 
79  virtual QgsChunkNode *createRootNode() const = 0;
81  virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const = 0;
82 };
83 
84 
85 #include "qgsaabb.h"
86 
94 class _3D_EXPORT QgsQuadtreeChunkLoaderFactory : public QgsChunkLoaderFactory
95 {
96  Q_OBJECT
97  public:
98  QgsQuadtreeChunkLoaderFactory();
99  virtual ~QgsQuadtreeChunkLoaderFactory();
100 
102  void setupQuadtree( const QgsAABB &rootBbox, float rootError, int maxLevel );
103 
104  virtual QgsChunkNode *createRootNode() const override;
105  virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
106 
107  protected:
108  QgsAABB mRootBbox;
109  float mRootError;
111  int mMaxLevel;
112 
113 };
114 
116 
117 #endif // QGSCHUNKLOADER_P_H
3
Definition: qgsaabb.h:34