QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsvectorlayerchunkloader_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerchunkloader_p.h
3  --------------------------------------
4  Date : July 2019
5  Copyright : (C) 2019 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 QGSVECTORLAYERCHUNKLOADER_P_H
17 #define QGSVECTORLAYERCHUNKLOADER_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 "qgschunkloader_p.h"
31 #include "qgsfeature3dhandler_p.h"
32 #include "qgschunkedentity_p.h"
33 
34 #define SIP_NO_FILE
35 
36 class Qgs3DMapSettings;
37 class QgsVectorLayer;
41 class QgsFeature3DHandler;
42 
43 #include <QFutureWatcher>
44 
45 
53 class QgsVectorLayerChunkLoaderFactory : public QgsChunkLoaderFactory
54 {
55  public:
57  QgsVectorLayerChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsAbstract3DSymbol *symbol, int leafLevel );
58 
60  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
61 
62  const Qgs3DMapSettings &mMap;
63  QgsVectorLayer *mLayer;
64  std::unique_ptr<QgsAbstract3DSymbol> mSymbol;
65  int mLeafLevel;
66 };
67 
68 
77 class QgsVectorLayerChunkLoader : public QgsChunkLoader
78 {
79  public:
81  QgsVectorLayerChunkLoader( const QgsVectorLayerChunkLoaderFactory *factory, QgsChunkNode *node );
82  ~QgsVectorLayerChunkLoader() override;
83 
84  virtual void cancel() override;
85  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
86 
87  private:
88  const QgsVectorLayerChunkLoaderFactory *mFactory;
89  std::unique_ptr<QgsFeature3DHandler> mHandler;
90  Qgs3DRenderContext mContext;
91  std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
92  bool mCanceled = false;
93  QFutureWatcher<void> *mFutureWatcher = nullptr;
94 };
95 
96 
107 class QgsVectorLayerChunkedEntity : public QgsChunkedEntity
108 {
109  Q_OBJECT
110  public:
112  explicit QgsVectorLayerChunkedEntity( QgsVectorLayer *vl, double zMin, double zMax, const QgsVectorLayer3DTilingSettings &tilingSettings, QgsAbstract3DSymbol *symbol, const Qgs3DMapSettings &map );
113 
114  ~QgsVectorLayerChunkedEntity();
115 };
116 
118 
119 #endif // QGSVECTORLAYERCHUNKLOADER_P_H
qgsfeature3dhandler_p.h
qgschunkloader_p.h
QgsAbstract3DSymbol
Definition: qgsabstract3dsymbol.h:41
qgschunkedentity_p.h
Qgs3DMapSettings
Definition: qgs3dmapsettings.h:51
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsVectorLayerFeatureSource
Definition: qgsvectorlayerfeatureiterator.h:51
QgsVectorLayer3DTilingSettings
Definition: qgsabstractvectorlayer3drenderer.h:37