QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 class Qgs3DMapSettings;
36 class QgsVectorLayer;
39 class QgsFeature3DHandler;
40 
41 
49 class QgsRuleBasedChunkLoaderFactory : public QgsChunkLoaderFactory
50 {
51  public:
53  QgsRuleBasedChunkLoaderFactory( const Qgs3DMapSettings &map, QgsVectorLayer *vl, QgsRuleBased3DRenderer::Rule *rootRule, int leafLevel );
54  ~QgsRuleBasedChunkLoaderFactory() override;
55 
57  virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
58 
59  const Qgs3DMapSettings &mMap;
60  QgsVectorLayer *mLayer;
61  std::unique_ptr<QgsRuleBased3DRenderer::Rule> mRootRule;
62  int mLeafLevel;
63 };
64 
65 
74 class QgsRuleBasedChunkLoader : public QgsChunkLoader
75 {
76  public:
78  QgsRuleBasedChunkLoader( const QgsRuleBasedChunkLoaderFactory *factory, QgsChunkNode *node );
79  ~QgsRuleBasedChunkLoader() override;
80 
81  virtual void cancel() override;
82  virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
83 
84  private:
85  const QgsRuleBasedChunkLoaderFactory *mFactory;
87  Qgs3DRenderContext mContext;
88  std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
89  bool mCanceled = false;
90  QFutureWatcher<void> *mFutureWatcher = nullptr;
91  std::unique_ptr<QgsRuleBased3DRenderer::Rule> mRootRule;
92 };
93 
94 
106 class QgsRuleBasedChunkedEntity : public QgsChunkedEntity
107 {
108  Q_OBJECT
109  public:
111  explicit QgsRuleBasedChunkedEntity( QgsVectorLayer *vl, double zMin, double zMax, const QgsVectorLayer3DTilingSettings &tilingSettings, QgsRuleBased3DRenderer::Rule *rootRule, const Qgs3DMapSettings &map );
112 
113  ~QgsRuleBasedChunkedEntity();
114 };
115 
117 
118 #endif // QGSRULEBASEDCHUNKLOADER_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) ...
QHash< const QgsRuleBased3DRenderer::Rule *, QgsFeature3DHandler * > RuleToHandlerMap
Represents a vector layer which manages a vector based data sets.