QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgschunkloader.h
Go to the documentation of this file.
1/***************************************************************************
2 qgschunkloader.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_H
17#define QGSCHUNKLOADER_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.h"
31
32#define SIP_NO_FILE
33
41class QgsChunkLoader : public QgsChunkQueueJob
42{
43 Q_OBJECT
44 public:
46 QgsChunkLoader( QgsChunkNode *node ) : QgsChunkQueueJob( node ) { }
47
52 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0;
53};
54
55
60class QgsChunkLoaderFactory : public QObject
61{
62 Q_OBJECT
63 public:
64 virtual ~QgsChunkLoaderFactory() = default;
65
67 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const = 0;
68
70 virtual int primitivesCount( QgsChunkNode *node ) const
71 {
72 Q_UNUSED( node );
73 return 0;
74 }
75
77 virtual QgsChunkNode *createRootNode() const = 0;
79 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const = 0;
80
92 virtual bool canCreateChildren( QgsChunkNode *node ) { Q_UNUSED( node ); return true; }
93
104 virtual void prepareChildren( QgsChunkNode *node ) { Q_UNUSED( node ); }
105
106 signals:
108 void childrenPrepared( QgsChunkNode *node );
109};
110
111
112#include "qgsaabb.h"
113
121class _3D_EXPORT QgsQuadtreeChunkLoaderFactory : public QgsChunkLoaderFactory
122{
123 Q_OBJECT
124 public:
125 QgsQuadtreeChunkLoaderFactory();
126 virtual ~QgsQuadtreeChunkLoaderFactory();
127
129 void setupQuadtree( const QgsAABB &rootBbox, float rootError, int maxLevel, const QgsAABB &clippingBbox = QgsAABB() );
130
131 virtual QgsChunkNode *createRootNode() const override;
132 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
133
134 protected:
135 QgsAABB mRootBbox;
136 QgsAABB mClippingBbox;
137 float mRootError = 0;
139 int mMaxLevel = 0;
140
141};
142
144
145#endif // QGSCHUNKLOADER_H