QGIS API Documentation 4.3.0-Master (16eddb2670e)
Loading...
Searching...
No Matches
qgsonlineterraingenerator.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsonlineterraingenerator.cpp
3 --------------------------------------
4 Date : March 2019
5 Copyright : (C) 2019 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
17
18#include <memory>
19
21
22#include "moc_qgsonlineterraingenerator.cpp"
23
25
27
32
34{
36 cloned->setTerrain( mTerrain );
37 cloned->mCrs = mCrs;
38 cloned->mResolution = mResolution;
39 cloned->mSkirtHeight = mSkirtHeight;
40 cloned->mExtent = mExtent;
41 cloned->updateGenerator();
42 return cloned;
43}
44
45// cppcheck-suppress duplInheritedMember
50
52{
53 if ( mExtent.isNull() )
54 {
56 }
57 else
58 {
59 // the real extent will be a square where the given extent fully fits
61 }
62
63 mHeightMapGenerator = std::make_unique<QgsDemHeightMapGenerator>( nullptr, mTerrainTilingScheme, mResolution, mTransformContext );
64}
std::unique_ptr< QgsDemHeightMapGenerator > mHeightMapGenerator
float mSkirtHeight
height of the "skirts" at the edges of tiles to hide cracks between adjacent cracks
QgsCoordinateTransformContext mTransformContext
QgsCoordinateReferenceSystem mCrs
int mResolution
how many vertices to place on one side of the tile
static QgsTerrainGenerator * create()
Creates a new instance of a QgsOnlineTerrainGenerator object.
~QgsOnlineTerrainGenerator() override
QgsTerrainGenerator * clone() const override
Makes a copy of the current instance.
Type type() const override
What texture generator implementation is this.
void updateGenerator() override
(Re-)creates mHeightMapGenerator based on current params
Type
Enumeration of the available terrain generators.
@ Online
Terrain is built from downloaded tiles with digital elevation model.
QgsTilingScheme mTerrainTilingScheme
Tiling scheme of the terrain.
QgsTerrainGenerator()
Create new terrain generator.
QgsTerrainEntity * mTerrain
virtual void setTerrain(QgsTerrainEntity *t)
Sets terrain entity for the generator (does not transfer ownership).
Encapsulates tiling schemes (just like with WMTS / TMS / XYZ layers).