QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
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 "qgsmaplayerref.h"
21#include "qgsterrainentity.h"
22#include "qgsrectangle.h"
23#include "qgsterraingenerator.h"
25#include "qgstiledsceneindex.h"
26#include "qgstiledscenelayer.h"
27#include "qgstiles.h"
28
29#define SIP_NO_FILE
30
37{
38 Q_OBJECT
39 public:
40 QgsQuantizedMeshTerrainGenerator() { mIsValid = false; }
41
42 virtual void setTerrain( QgsTerrainEntity *t ) override;
43 virtual QgsTerrainGenerator *clone() const override SIP_FACTORY;
44 virtual QgsTerrainGenerator::Type type() const override;
45 virtual void setExtent( const QgsRectangle &extent ) override;
46 virtual QgsRectangle rootChunkExtent() const override;
47 virtual float rootChunkError( const Qgs3DMapSettings &map ) const override;
48 virtual void rootChunkHeightRange( float &hMin, float &hMax ) const override;
49 virtual float heightAt( double x, double y, const Qgs3DRenderContext &context ) const override;
50 virtual void writeXml( QDomElement &elem ) const override;
51 virtual void readXml( const QDomElement &elem ) override;
52 virtual void resolveReferences( const QgsProject &project ) override;
53 virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
54 // Root node has zoom=0, x=0, y=0.
55 // It corresponds to a fake zoom=-1 tile for QgsTileMatrix
56 virtual QgsChunkNode *createRootNode() const override;
57 virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
58
63 bool setLayer( QgsTiledSceneLayer *layer );
65 QgsTiledSceneLayer *layer() const;
66
67 private:
68 QgsMapLayerRef mLayerRef;
69 std::optional<QgsQuantizedMeshMetadata> mMetadata;
70 QgsCoordinateTransform mTileCrsToMapCrs;
71 QgsTiledSceneIndex mIndex;
72 QgsRectangle mMapExtent;
73
74 QgsQuantizedMeshTerrainGenerator( QgsMapLayerRef layerRef, const QgsQuantizedMeshMetadata &metadata );
75 QgsTileXYZ nodeIdToTile( QgsChunkNodeId nodeId ) const;
76};
Class for doing transforms between two map coordinate systems.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
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