QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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.h"
31#include "qgschunkedentity.h"
35
36#include <memory>
37
38#include <QFutureWatcher>
39#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
40#include <Qt3DRender/QGeometry>
41#include <Qt3DRender/QBuffer>
42#else
43#include <Qt3DCore/QGeometry>
44#include <Qt3DCore/QBuffer>
45#endif
46#include <QVector3D>
47
48#define SIP_NO_FILE
49
57class QgsPointCloudLayerChunkLoaderFactory : public QgsChunkLoaderFactory
58{
59 Q_OBJECT
60
61 public:
66 QgsPointCloudLayerChunkLoaderFactory( const Qgs3DRenderContext &context, const QgsCoordinateTransform &coordinateTransform, QgsPointCloudIndex *pc, QgsPointCloud3DSymbol *symbol, double zValueScale, double zValueOffset, int pointBudget );
67
69 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
70 virtual QgsChunkNode *createRootNode() const override;
71 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
72 virtual int primitivesCount( QgsChunkNode *node ) const override;
73 Qgs3DRenderContext mRenderContext;
74 QgsCoordinateTransform mCoordinateTransform;
75 QgsPointCloudIndex *mPointCloudIndex;
76 std::unique_ptr<QgsPointCloud3DSymbol> mSymbol;
77 double mZValueScale = 1.0;
78 double mZValueOffset = 0;
79 int mPointBudget = 1000000;
80 bool mTriangulate = false;
81 QgsRectangle mExtent;
82};
83
84
93class QgsPointCloudLayerChunkLoader : public QgsChunkLoader
94{
95 Q_OBJECT
96
97 public:
102 QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr<QgsPointCloud3DSymbol> symbol, const QgsCoordinateTransform &coordinateTransform, double zValueScale, double zValueOffset );
103 ~QgsPointCloudLayerChunkLoader() override;
104
105 virtual void cancel() override;
106 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
107
108 private:
109 const QgsPointCloudLayerChunkLoaderFactory *mFactory;
110 std::unique_ptr<QgsPointCloud3DSymbolHandler> mHandler;
112 QFutureWatcher<void> *mFutureWatcher = nullptr;
113};
114
115
126class QgsPointCloudLayerChunkedEntity : public QgsChunkedEntity
127{
128 Q_OBJECT
129 public:
130 explicit QgsPointCloudLayerChunkedEntity( Qgs3DMapSettings *map, QgsPointCloudIndex *pc, const QgsCoordinateTransform &coordinateTransform, QgsPointCloud3DSymbol *symbol, float maxScreenError, bool showBoundingBoxes, double zValueScale, double zValueOffset, int pointBudget );
131
132 QVector<QgsRayCastingUtils::RayHit> rayIntersection( const QgsRayCastingUtils::Ray3D &ray, const QgsRayCastingUtils::RayCastContext &context ) const override;
133
134 ~QgsPointCloudLayerChunkedEntity();
135};
136
138
139#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.
A rectangle specified with double values.
Helper struct to store ray casting parameters.