QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsrulebasedchunkloader_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrulebasedchunkloader_p.h
3  --------------------------------------
4  Date : November 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 QGSRULEBASEDCHUNKLOADER_H
17 #define QGSRULEBASEDCHUNKLOADER_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 #include "qgsrulebased3drenderer.h"
34 
35 #define SIP_NO_FILE
36 
37 class Qgs3DMapSettings;
38 class QgsVectorLayer;
41 class QgsFeature3DHandler;
42 
43 
51 class QgsRuleBasedChunkLoaderFactory : public QgsChunkLoaderFactory
52 {
53  public:
55  QgsRuleBasedChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsRuleBased3DRenderer::Rule *rootRule, int leafLevel );
56  ~QgsRuleBasedChunkLoaderFactory() override;
57 
59  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
60 
61  const Qgs3DMapSettings &mMap;
62  QgsVectorLayer *mLayer;
63  std::unique_ptr<QgsRuleBased3DRenderer::Rule> mRootRule;
64  int mLeafLevel;
65 };
66 
67 
76 class QgsRuleBasedChunkLoader : public QgsChunkLoader
77 {
78  public:
80  QgsRuleBasedChunkLoader( const QgsRuleBasedChunkLoaderFactory *factory, QgsChunkNode *node );
81  ~QgsRuleBasedChunkLoader() override;
82 
83  virtual void cancel() override;
84  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
85 
86  private:
87  const QgsRuleBasedChunkLoaderFactory *mFactory;
89  Qgs3DRenderContext mContext;
90  std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
91  bool mCanceled = false;
92  QFutureWatcher<void> *mFutureWatcher = nullptr;
93  std::unique_ptr<QgsRuleBased3DRenderer::Rule> mRootRule;
94 };
95 
96 
108 class QgsRuleBasedChunkedEntity : public QgsChunkedEntity
109 {
110  Q_OBJECT
111  public:
113  explicit QgsRuleBasedChunkedEntity( QgsVectorLayer *vl, double zMin, double zMax, const QgsVectorLayer3DTilingSettings &tilingSettings, QgsRuleBased3DRenderer::Rule *rootRule, const Qgs3DMapSettings &map );
114 
115  ~QgsRuleBasedChunkedEntity();
116 };
117 
119 
120 #endif // QGSRULEBASEDCHUNKLOADER_H
qgsfeature3dhandler_p.h
QgsRuleBased3DRenderer::RuleToHandlerMap
QHash< const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler * > RuleToHandlerMap
Definition: qgsrulebased3drenderer.h:67
qgschunkloader_p.h
QgsAbstract3DSymbol
Definition: qgsabstract3dsymbol.h:41
qgschunkedentity_p.h
Qgs3DMapSettings
Definition: qgs3dmapsettings.h:51
qgsrulebased3drenderer.h
QgsVectorLayer
Definition: qgsvectorlayer.h:385
QgsRuleBased3DRenderer::Rule
Definition: qgsrulebased3drenderer.h:74
QgsVectorLayerFeatureSource
Definition: qgsvectorlayerfeatureiterator.h:51
QgsVectorLayer3DTilingSettings
Definition: qgsabstractvectorlayer3drenderer.h:37