QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 namespace Qt3DCore
44 {
45  class QTransform;
46 }
47 
48 #include <QFutureWatcher>
49 
50 
58 class QgsVectorLayerChunkLoaderFactory : public QgsQuadtreeChunkLoaderFactory
59 {
60  Q_OBJECT
61 
62  public:
64  QgsVectorLayerChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsAbstract3DSymbol *symbol, int leafLevel, double zMin, double zMax );
65 
67  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
68 
69  const Qgs3DMapSettings &mMap;
70  QgsVectorLayer *mLayer;
71  std::unique_ptr<QgsAbstract3DSymbol> mSymbol;
72  int mLeafLevel;
73 };
74 
75 
84 class QgsVectorLayerChunkLoader : public QgsChunkLoader
85 {
86  Q_OBJECT
87 
88  public:
90  QgsVectorLayerChunkLoader( const QgsVectorLayerChunkLoaderFactory *factory, QgsChunkNode *node );
91  ~QgsVectorLayerChunkLoader() override;
92 
93  virtual void cancel() override;
94  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
95 
96  private:
97  const QgsVectorLayerChunkLoaderFactory *mFactory;
98  std::unique_ptr<QgsFeature3DHandler> mHandler;
99  Qgs3DRenderContext mContext;
100  std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
101  bool mCanceled = false;
102  QFutureWatcher<void> *mFutureWatcher = nullptr;
103 };
104 
105 
116 class QgsVectorLayerChunkedEntity : public QgsChunkedEntity
117 {
118  Q_OBJECT
119  public:
121  explicit QgsVectorLayerChunkedEntity( QgsVectorLayer *vl, double zMin, double zMax, const QgsVectorLayer3DTilingSettings &tilingSettings, QgsAbstract3DSymbol *symbol, const Qgs3DMapSettings &map );
122 
123  ~QgsVectorLayerChunkedEntity();
124  private slots:
125  void onTerrainElevationOffsetChanged( float newOffset );
126 
127  private:
128  Qt3DCore::QTransform *mTransform = nullptr;
129 };
130 
132 
133 #endif // QGSVECTORLAYERCHUNKLOADER_P_H
qgsfeature3dhandler_p.h
qgschunkloader_p.h
QgsAbstract3DSymbol
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Definition: qgsabstract3dsymbol.h:46
qgschunkedentity_p.h
Qt3DCore
Definition: qgsabstract3drenderer.h:30
Qgs3DMapSettings
Definition of the world.
Definition: qgs3dmapsettings.h:57
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsVectorLayerFeatureSource
Partial snapshot of vector layer's state (only the members necessary for access to features)
Definition: qgsvectorlayerfeatureiterator.h:52
QgsVectorLayer3DTilingSettings
This class defines configuration of how a vector layer gets tiled for 3D rendering.
Definition: qgsabstractvectorlayer3drenderer.h:37