QGIS API Documentation 4.3.0-Master (16eddb2670e)
Loading...
Searching...
No Matches
qgsflatterraingenerator.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsflatterraingenerator.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 QGSFLATTERRAINGENERATOR_H
17#define QGSFLATTERRAINGENERATOR_H
18
19#include "qgis_3d.h"
20#include "qgsterraingenerator.h"
21
22#include <Qt3DExtras/QPlaneGeometry>
23
24#define SIP_NO_FILE
25
32{
33 Q_OBJECT
34 public:
39
41
42 QFuture<QgsChunkLoaderResult> loadChunk( QgsChunkNode *node ) override;
43
44 QgsTerrainGenerator *clone() const override SIP_FACTORY;
45 Type type() const override;
46 QgsRectangle rootChunkExtent() const override;
47 void setExtent( const QgsRectangle &extent ) override;
48 void rootChunkHeightRange( float &hMin, float &hMax ) const override;
49 float heightAt( double x, double y, const Qgs3DRenderContext &context ) const override;
50
51 void setCrs( const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context ) override;
52 QgsCoordinateReferenceSystem crs() const override { return mCrs; }
53
54 private:
55 void updateTilingScheme();
56 Qt3DCore::QEntity *createEntity( QgsChunkNode *node, QgsTerrainGenerator::TerrainTextureResources resources, Qt3DCore::QEntity *parent );
57
59};
60
61
62#endif // QGSFLATTERRAINGENERATOR_H
Rendering context for preparation of 3D entities.
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Type type() const override
What texture generator implementation is this.
QgsRectangle rootChunkExtent() const override
extent of the terrain's root chunk in terrain's CRS
void rootChunkHeightRange(float &hMin, float &hMax) const override
Returns height range of the root chunk in world coordinates.
static QgsTerrainGenerator * create()
Creates a new instance of a QgsFlatTerrainGenerator object.
QFuture< QgsChunkLoaderResult > loadChunk(QgsChunkNode *node) override
float heightAt(double x, double y, const Qgs3DRenderContext &context) const override
Returns height at (x,y) in map's CRS.
QgsFlatTerrainGenerator()=default
void setExtent(const QgsRectangle &extent) override
sets the extent of the terrain in terrain's CRS
QgsCoordinateReferenceSystem crs() const override
Returns CRS of the terrain.
void setCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context) override
Sets the CRS associated with the terrain.
A rectangle specified with double values.
Type
Enumeration of the available terrain generators.
QgsTerrainGenerator()
Create new terrain generator.
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
#define SIP_FACTORY
Definition qgis_sip.h:83