QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsterraingenerator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsterraingenerator.h
3 --------------------------------------
4 Date : July 2017
5 Copyright : (C) 2017 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 QGSTERRAINGENERATOR_H
17#define QGSTERRAINGENERATOR_H
18
19#include "qgis_3d.h"
20
21#include "qgstilingscheme.h"
22#include "qgschunkloader.h"
23
24class QgsAABB;
27class QgsRectangle;
28class QgsTerrainEntity;
30
31class QDomElement;
32class QDomDocument;
33class QgsProject;
34
35#define SIP_NO_FILE
36
49class _3D_EXPORT QgsTerrainGenerator : public QgsQuadtreeChunkLoaderFactory
50{
51 Q_OBJECT
52 public:
62
64 virtual void setTerrain( QgsTerrainEntity *t ) { mTerrain = t; }
65
68
70 virtual Type type() const = 0;
71
73 virtual void setExtent( const QgsRectangle &extent ) { Q_UNUSED( extent ) }
74
76 virtual QgsRectangle rootChunkExtent() const = 0;
77
79 virtual QgsBox3D rootChunkBox3D( const Qgs3DMapSettings &map ) const;
80
82 virtual float rootChunkError( const Qgs3DMapSettings &map ) const;
83
85 virtual void rootChunkHeightRange( float &hMin, float &hMax ) const;
86
88 virtual float heightAt( double x, double y, const Qgs3DRenderContext &context ) const;
89
91 static QString typeToString( Type type );
92
94 const QgsTilingScheme &tilingScheme() const { return mTerrainTilingScheme; }
95
101 virtual void setCrs( const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context );
102
104 virtual QgsCoordinateReferenceSystem crs() const { return mTerrainTilingScheme.crs(); }
105
107 bool isValid() const;
108
109 signals:
110
113
114 protected:
116 QgsTerrainEntity *mTerrain = nullptr;
118
119 bool mIsValid = true;
120};
121
122
123#endif // QGSTERRAINGENERATOR_H
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:43
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
A rectangle specified with double values.
Type
Enumeration of the available terrain generators.
@ QuantizedMesh
Terrain is built from quantized mesh tiles.
@ Dem
Terrain is built from raster layer with digital elevation model.
@ Online
Terrain is built from downloaded tiles with digital elevation model.
@ Mesh
Terrain is built from mesh layer with z value on vertices.
@ Flat
The whole terrain is flat area.
QgsTilingScheme mTerrainTilingScheme
Tiling scheme of the terrain.
void terrainChanged()
Emitted when the terrain changed (for example, raster DEM or mesh have data changed)
virtual Type type() const =0
What texture generator implementation is this.
virtual void setExtent(const QgsRectangle &extent)
sets the extent of the terrain in terrain's CRS
virtual QgsRectangle rootChunkExtent() const =0
extent of the terrain's root chunk in terrain's CRS
virtual void setTerrain(QgsTerrainEntity *t)
Sets terrain entity for the generator (does not transfer ownership)
virtual QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
const QgsTilingScheme & tilingScheme() const
Returns tiling scheme of the terrain.
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
#define SIP_FACTORY
Definition qgis_sip.h:76
const QgsCoordinateReferenceSystem & crs