QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsquantizedmeshterraingenerator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsterraingenerator.h
3 --------------------------------------
4 Date : August 2024
5 Copyright : (C) 2024 by David Koňařík
6 Email : dvdkon at konarici dot cz
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#pragma once
17
18#include "qgschunknode.h"
20#include "qgsterrainentity.h"
21#include "qgsrectangle.h"
22#include "qgsterraingenerator.h"
24#include "qgstiledsceneindex.h"
25#include "qgstiledscenelayer.h"
26#include "qgstiles.h"
27#include <QPointer>
28
29#define SIP_NO_FILE
30
37{
38 Q_OBJECT
39 public:
43 static QgsTerrainGenerator *create() SIP_FACTORY;
44
45 QgsQuantizedMeshTerrainGenerator() { mIsValid = false; }
46
47 virtual void setTerrain( QgsTerrainEntity *t ) override;
48 virtual QgsTerrainGenerator *clone() const override SIP_FACTORY;
49 virtual QgsTerrainGenerator::Type type() const override;
50 virtual void setExtent( const QgsRectangle &extent ) override;
51 virtual QgsRectangle rootChunkExtent() const override;
52 virtual float rootChunkError( const Qgs3DMapSettings &map ) const override;
53 virtual void rootChunkHeightRange( float &hMin, float &hMax ) const override;
54 virtual float heightAt( double x, double y, const Qgs3DRenderContext &context ) const override;
55 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
56 // Root node has zoom=0, x=0, y=0.
57 // It corresponds to a fake zoom=-1 tile for QgsTileMatrix
58 virtual QgsChunkNode *createRootNode() const override;
59 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
60
65 bool setLayer( QgsTiledSceneLayer *layer );
67 QgsTiledSceneLayer *layer() const;
68
69 private:
70 QPointer<QgsTiledSceneLayer> mLayer;
71 std::optional<QgsQuantizedMeshMetadata> mMetadata;
72 QgsCoordinateTransform mTileCrsToMapCrs;
73 QgsTiledSceneIndex mIndex;
74 QgsRectangle mMapExtent;
75 QgsTileXYZ nodeIdToTile( QgsChunkNodeId nodeId ) const;
76};
Class for doing transforms between two map coordinate systems.
A rectangle specified with double values.
virtual void setTerrain(QgsTerrainEntity *t)
Sets terrain entity for the generator (does not transfer ownership)
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
Stores coordinates of a tile in a tile matrix set.
Definition qgstiles.h:40
An index for tiled scene data providers.
Represents a map layer supporting display of tiled scene objects.
#define SIP_FACTORY
Definition qgis_sip.h:76