QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
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
25class QgsDemHeightMapGenerator;
26
27#define SIP_NO_FILE
28
38{
39 Q_OBJECT
40 public:
43
45 void setCrs( const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context );
47 QgsCoordinateReferenceSystem crs() const override { return mCrs; }
48
50 void setResolution( int resolution ) { mResolution = resolution; updateGenerator(); }
52 int resolution() const { return mResolution; }
53
55 void setSkirtHeight( float skirtHeight ) { mSkirtHeight = skirtHeight; }
57 float skirtHeight() const { return mSkirtHeight; }
58
60 QgsDemHeightMapGenerator *heightMapGenerator() { return mHeightMapGenerator.get(); }
61
62 QgsTerrainGenerator *clone() const override SIP_FACTORY;
63 Type type() const override;
64 QgsRectangle rootChunkExtent() const override;
65 void setExtent( const QgsRectangle &extent ) override;
66 float heightAt( double x, double y, const Qgs3DRenderContext &context ) const override;
67 void writeXml( QDomElement &elem ) const override;
68 void readXml( const QDomElement &elem ) override;
69 //void resolveReferences( const QgsProject &project ) override;
70
71 QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override SIP_FACTORY;
72
73 private:
74
75 void updateGenerator();
76
78 QgsCoordinateTransformContext mTransformContext;
79
81 int mResolution = 16;
83 float mSkirtHeight = 10.f;
84
85 std::unique_ptr<QgsDemHeightMapGenerator> mHeightMapGenerator;
86};
87
88#endif // QGSONLINETERRAINGENERATOR_H
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
~QgsOnlineTerrainGenerator() override
QgsDemHeightMapGenerator * heightMapGenerator()
Returns height map generator object - takes care of extraction of elevations from the layer)
void setSkirtHeight(float skirtHeight)
Sets skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between adj...
QgsCoordinateReferenceSystem crs() const override
Returns CRS of the terrain.
int resolution() const
Returns resolution of the generator (how many elevation samples on one side of a terrain tile)
void setResolution(int resolution)
Sets resolution of the generator (how many elevation samples on one side of a terrain tile)
float skirtHeight() const
Returns skirt height (in world units). Skirts at the edges of terrain tiles help hide cracks between ...
A rectangle specified with double values.
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
#define SIP_FACTORY
Definition qgis_sip.h:76
const QgsCoordinateReferenceSystem & crs