QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
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 ) : QgsChunkQueueJob( node ) { }
49
54 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0;
55};
56
57
62class 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
94 virtual bool canCreateChildren( QgsChunkNode *node ) { Q_UNUSED( node ); return true; }
95
106 virtual void prepareChildren( QgsChunkNode *node ) { Q_UNUSED( node ); }
107
108 signals:
110 void childrenPrepared( QgsChunkNode *node );
111};
112
113
121class _3D_EXPORT QgsQuadtreeChunkLoaderFactory : public QgsChunkLoaderFactory
122{
123 Q_OBJECT
124 public:
125 QgsQuadtreeChunkLoaderFactory();
126 virtual ~QgsQuadtreeChunkLoaderFactory();
127
129 void setupQuadtree( const QgsBox3D &rootBox3D, float rootError, int maxLevel, const QgsBox3D &clippingBox3D = QgsBox3D() );
130
131 virtual QgsChunkNode *createRootNode() const override;
132 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
133
134 protected:
135 QgsBox3D mRootBox3D;
136 QgsBox3D mClippingBox3D;
137 float mRootError = 0;
139 int mMaxLevel = 0;
140
141};
142
144
145#endif // QGSCHUNKLOADER_H
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:43