QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgspointcloudlayerchunkloader_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudlayerchunkloader_p.h
3 --------------------------------------
4 Date : October 2020
5 Copyright : (C) 2020 by Peter Petrik
6 Email : zilolv 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 QGSPOINTCLOUDLAYERCHUNKLOADER_P_H
17#define QGSPOINTCLOUDLAYERCHUNKLOADER_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"
32#include "qgschunkedentity_p.h"
36
37#include <memory>
38
39#include <QFutureWatcher>
40#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
41#include <Qt3DRender/QGeometry>
42#include <Qt3DRender/QBuffer>
43#else
44#include <Qt3DCore/QGeometry>
45#include <Qt3DCore/QBuffer>
46#endif
47#include <Qt3DRender/QMaterial>
48#include <QVector3D>
49
50#define SIP_NO_FILE
51
59class QgsPointCloudLayerChunkLoaderFactory : public QgsChunkLoaderFactory
60{
61 Q_OBJECT
62
63 public:
64
69 QgsPointCloudLayerChunkLoaderFactory( const Qgs3DMapSettings &map, const QgsCoordinateTransform &coordinateTransform, QgsPointCloudIndex *pc, QgsPointCloud3DSymbol *symbol,
70 double zValueScale, double zValueOffset, int pointBudget );
71
73 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
74 virtual QgsChunkNode *createRootNode() const override;
75 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
76 virtual int primitivesCount( QgsChunkNode *node ) const override;
77 const Qgs3DMapSettings &mMap;
78 QgsCoordinateTransform mCoordinateTransform;
79 QgsPointCloudIndex *mPointCloudIndex;
80 std::unique_ptr< QgsPointCloud3DSymbol > mSymbol;
81 double mZValueScale = 1.0;
82 double mZValueOffset = 0;
83 int mPointBudget = 1000000;
84 bool mTriangulate = false;
85};
86
87
96class QgsPointCloudLayerChunkLoader : public QgsChunkLoader
97{
98 Q_OBJECT
99
100 public:
101
106 QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr< QgsPointCloud3DSymbol > symbol,
107 const QgsCoordinateTransform &coordinateTransform, double zValueScale, double zValueOffset );
108 ~QgsPointCloudLayerChunkLoader() override;
109
110 virtual void cancel() override;
111 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
112
113 private:
114 const QgsPointCloudLayerChunkLoaderFactory *mFactory;
115 std::unique_ptr<QgsPointCloud3DSymbolHandler> mHandler;
117 QFutureWatcher<void> *mFutureWatcher = nullptr;
118};
119
120
131class QgsPointCloudLayerChunkedEntity : public QgsChunkedEntity
132{
133 Q_OBJECT
134 public:
135 explicit QgsPointCloudLayerChunkedEntity( QgsPointCloudIndex *pc, const Qgs3DMapSettings &map, const QgsCoordinateTransform &coordinateTransform, QgsPointCloud3DSymbol *symbol, float maxScreenError, bool showBoundingBoxes,
136 double zValueScale, double zValueOffset, int pointBudget );
137
138 ~QgsPointCloudLayerChunkedEntity();
139};
140
142
143#endif // QGSPOINTCLOUDLAYERCHUNKLOADER_P_H
Class for doing transforms between two map coordinate systems.
Encapsulates the render context for a 3D point cloud rendering operation.
Represents a indexed point clouds data in octree.