QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgstiledscenechunkloader_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledscenechunkloader_p.h
3 --------------------------------------
4 Date : July 2023
5 Copyright : (C) 2023 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 QGSTILEDSCENECHUNKLOADER_P_H
17#define QGSTILEDSCENECHUNKLOADER_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
31#include "qgschunkedentity.h"
32#include "qgschunkloader.h"
33#include "qgschunknode.h"
34#include "qgstiledsceneindex.h"
35#include "qgstiledscenetile.h"
36#include "qgs3drendercontext.h"
37
38#include <QFutureWatcher>
39
40#define SIP_NO_FILE
41
43class QgsTiledSceneChunkLoaderFactory;
44
45
54class QgsTiledSceneChunkLoader : public QgsChunkLoader
55{
56 Q_OBJECT
57 public:
58 QgsTiledSceneChunkLoader( QgsChunkNode *node, const QgsTiledSceneIndex &index, const QgsTiledSceneChunkLoaderFactory &factory, double zValueScale, double zValueOffset );
59
60 ~QgsTiledSceneChunkLoader();
61
62 virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent );
63
64 private:
65 const QgsTiledSceneChunkLoaderFactory &mFactory;
66 QgsTiledSceneIndex mIndex;
67 QFutureWatcher<void> *mFutureWatcher = nullptr;
68 Qt3DCore::QEntity *mEntity = nullptr;
69};
70
71
79class QgsTiledSceneChunkLoaderFactory : public QgsChunkLoaderFactory
80{
81 Q_OBJECT
82 public:
83 QgsTiledSceneChunkLoaderFactory(
84 const Qgs3DRenderContext &context, const QgsTiledSceneIndex &index, QgsCoordinateReferenceSystem tileCrs,
85 double zValueScale, double zValueOffset );
86
87 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
88 virtual QgsChunkNode *createRootNode() const override;
89 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
90
91 virtual bool canCreateChildren( QgsChunkNode *node ) override;
92 virtual void prepareChildren( QgsChunkNode *node ) override;
93
94 QgsChunkNode *nodeForTile( const QgsTiledSceneTile &t, const QgsChunkNodeId &nodeId, QgsChunkNode *parent ) const;
95 void fetchHierarchyForNode( long long nodeId, QgsChunkNode *origNode );
96
97 Qgs3DRenderContext mRenderContext;
98 QString mRelativePathBase;
99 mutable QgsTiledSceneIndex mIndex;
100 double mZValueScale = 1.0;
101 double mZValueOffset = 0;
102 QgsCoordinateTransform mBoundsTransform;
103 QSet<long long> mPendingHierarchyFetches;
104 QSet<long long> mFutureHierarchyFetches;
105};
106
107
118class QgsTiledSceneLayerChunkedEntity : public QgsChunkedEntity
119{
120 Q_OBJECT
121 public:
122 explicit QgsTiledSceneLayerChunkedEntity( Qgs3DMapSettings *map, const QgsTiledSceneIndex &index, QgsCoordinateReferenceSystem tileCrs, double maximumScreenError, bool showBoundingBoxes,
123 double zValueScale, double zValueOffset );
124
125 ~QgsTiledSceneLayerChunkedEntity();
126
127 QVector<QgsRayCastingUtils::RayHit> rayIntersection( const QgsRayCastingUtils::Ray3D &ray, const QgsRayCastingUtils::RayCastContext &context ) const override;
128
129 int pendingJobsCount() const override;
130
131 private:
132 mutable QgsTiledSceneIndex mIndex;
133};
134
136
137#endif // QGSTILEDSCENECHUNKLOADER_P_H
This class represents a coordinate reference system (CRS).
Class for doing transforms between two map coordinate systems.
An index for tiled scene data providers.
Represents an individual tile from a tiled scene data source.
Helper struct to store ray casting parameters.