QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsonlineterraingenerator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsonlineterraingenerator.h
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 
16 #ifndef QGSONLINETERRAINGENERATOR_H
17 #define QGSONLINETERRAINGENERATOR_H
18 
19 #include "qgis_3d.h"
20 
21 #include "qgsterraingenerator.h"
22 
24 
25 class QgsDemHeightMapGenerator;
26 
27 #define SIP_NO_FILE
28 
38 {
39  public:
43 
45  void setExtent( const QgsRectangle &extent );
46 
48  void setCrs( const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context );
50  QgsCoordinateReferenceSystem crs() const { return mCrs; }
51 
53  void setResolution( int resolution ) { mResolution = resolution; updateGenerator(); }
55  int resolution() const { return mResolution; }
56 
58  void setSkirtHeight( float skirtHeight ) { mSkirtHeight = skirtHeight; }
60  float skirtHeight() const { return mSkirtHeight; }
61 
63  QgsDemHeightMapGenerator *heightMapGenerator() { return mHeightMapGenerator.get(); }
64 
65  QgsTerrainGenerator *clone() const override SIP_FACTORY;
66  Type type() const override;
67  QgsRectangle extent() const override;
68  float heightAt( double x, double y, const Qgs3DMapSettings &map ) const override;
69  void writeXml( QDomElement &elem ) const override;
70  void readXml( const QDomElement &elem ) override;
71  //void resolveReferences( const QgsProject &project ) override;
72 
73  QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override SIP_FACTORY;
74 
75  private:
76 
77  void updateGenerator();
78 
79  QgsRectangle mExtent;
81  QgsCoordinateTransformContext mTransformContext;
82 
84  int mResolution = 16;
86  float mSkirtHeight = 10.f;
87 
88  std::unique_ptr<QgsDemHeightMapGenerator> mHeightMapGenerator;
89 };
90 
91 #endif // QGSONLINETERRAINGENERATOR_H
QgsCoordinateTransformContext
Contains information about the context in which a coordinate transform is executed.
Definition: qgscoordinatetransformcontext.h:58
qgscoordinatetransformcontext.h
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:51
QgsOnlineTerrainGenerator::resolution
int resolution() const
Returns resolution of the generator (how many elevation samples on one side of a terrain tile)
Definition: qgsonlineterraingenerator.h:55
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsOnlineTerrainGenerator::crs
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
Definition: qgsonlineterraingenerator.h:50
geos::unique_ptr
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
QgsTerrainGenerator
3 Base class for generators of terrain.
Definition: qgsterraingenerator.h:48
QgsTerrainGenerator::clone
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
qgsterraingenerator.h
QgsOnlineTerrainGenerator::heightMapGenerator
QgsDemHeightMapGenerator * heightMapGenerator()
Returns height map generator object - takes care of extraction of elevations from the layer)
Definition: qgsonlineterraingenerator.h:63
Qgs3DMapSettings
3 Definition of the world
Definition: qgs3dmapsettings.h:54
QgsOnlineTerrainGenerator::~QgsOnlineTerrainGenerator
~QgsOnlineTerrainGenerator() override
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:206
QgsOnlineTerrainGenerator::setSkirtHeight
void setSkirtHeight(float skirtHeight)
Sets skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adj...
Definition: qgsonlineterraingenerator.h:58
QgsOnlineTerrainGenerator::setResolution
void setResolution(int resolution)
Sets resolution of the generator (how many elevation samples on one side of a terrain tile)
Definition: qgsonlineterraingenerator.h:53
QgsOnlineTerrainGenerator
3 Implementation of terrain generator that uses online resources to download heightmaps.
Definition: qgsonlineterraingenerator.h:38
QgsOnlineTerrainGenerator::QgsOnlineTerrainGenerator
QgsOnlineTerrainGenerator()
Constructor for QgsOnlineTerrainGenerator.
QgsOnlineTerrainGenerator::skirtHeight
float skirtHeight() const
Returns skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between ...
Definition: qgsonlineterraingenerator.h:60