QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 class Qgs3DMapSettings;
35 class QgsVectorLayer;
39 class QgsFeature3DHandler;
40 
41 #include <QFutureWatcher>
42 
43 
51 class QgsVectorLayerChunkLoaderFactory : public QgsChunkLoaderFactory
52 {
53  public:
55  QgsVectorLayerChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsAbstract3DSymbol *symbol, int leafLevel );
56 
58  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
59 
60  const Qgs3DMapSettings &mMap;
61  QgsVectorLayer *mLayer;
62  std::unique_ptr<QgsAbstract3DSymbol> mSymbol;
63  int mLeafLevel;
64 };
65 
66 
75 class QgsVectorLayerChunkLoader : public QgsChunkLoader
76 {
77  public:
79  QgsVectorLayerChunkLoader( const QgsVectorLayerChunkLoaderFactory *factory, QgsChunkNode *node );
80  ~QgsVectorLayerChunkLoader() override;
81 
82  virtual void cancel() override;
83  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
84 
85  private:
86  const QgsVectorLayerChunkLoaderFactory *mFactory;
87  std::unique_ptr<QgsFeature3DHandler> mHandler;
88  Qgs3DRenderContext mContext;
89  std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
90  bool mCanceled = false;
91  QFutureWatcher<void> *mFutureWatcher = nullptr;
92 };
93 
94 
105 class QgsVectorLayerChunkedEntity : public QgsChunkedEntity
106 {
107  Q_OBJECT
108  public:
110  explicit QgsVectorLayerChunkedEntity( QgsVectorLayer *vl, double zMin, double zMax, const QgsVectorLayer3DTilingSettings &tilingSettings, QgsAbstract3DSymbol *symbol, const Qgs3DMapSettings &map );
111 
112  ~QgsVectorLayerChunkedEntity();
113 };
114 
116 
117 #endif // QGSVECTORLAYERCHUNKLOADER_P_H
3 This class defines configuration of how a vector layer gets tiled for 3D rendering.
3 Definition of the world
3 Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Partial snapshot of vector layer&#39;s state (only the members necessary for access to features) ...
Represents a vector layer which manages a vector based data sets.