QGIS API Documentation 3.41.0-Master (cea29feecf2)
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 "qgis_3d.h"
31#include "qgschunkqueuejob.h"
32#include "qgsbox3d.h"
33
34#define SIP_NO_FILE
35
43class QgsChunkLoader : public QgsChunkQueueJob
44{
45 Q_OBJECT
46 public:
48 QgsChunkLoader( QgsChunkNode *node )
49 : QgsChunkQueueJob( node ) {}
50
55 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0;
56};
57
58
63class QgsChunkLoaderFactory : public QObject
64{
65 Q_OBJECT
66 public:
67 virtual ~QgsChunkLoaderFactory() = default;
68
70 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const = 0;
71
73 virtual int primitivesCount( QgsChunkNode *node ) const
74 {
75 Q_UNUSED( node );
76 return 0;
77 }
78
80 virtual QgsChunkNode *createRootNode() const = 0;
82 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const = 0;
83
95 virtual bool canCreateChildren( QgsChunkNode *node )
96 {
97 Q_UNUSED( node );
98 return true;
99 }
100
111 virtual void prepareChildren( QgsChunkNode *node ) { Q_UNUSED( node ); }
112
113 signals:
115 void childrenPrepared( QgsChunkNode *node );
116};
117
118
126class _3D_EXPORT QgsQuadtreeChunkLoaderFactory : public QgsChunkLoaderFactory
127{
128 Q_OBJECT
129 public:
130 QgsQuadtreeChunkLoaderFactory();
131 virtual ~QgsQuadtreeChunkLoaderFactory();
132
134 void setupQuadtree( const QgsBox3D &rootBox3D, float rootError, int maxLevel, const QgsBox3D &clippingBox3D = QgsBox3D() );
135
136 virtual QgsChunkNode *createRootNode() const override;
137 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
138
139 protected:
140 QgsBox3D mRootBox3D;
141 QgsBox3D mClippingBox3D;
142 float mRootError = 0;
144 int mMaxLevel = 0;
145};
146
148
149#endif // QGSCHUNKLOADER_H
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:43