QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
21 #include "qgsterraingenerator.h"
22 #include "qgsterraintileloader_p.h"
23 #include "qgsrectangle.h"
24 #include <Qt3DExtras/QPlaneGeometry>
25 
27 
29 class FlatTerrainChunkLoader : public QgsTerrainTileLoader
30 {
31  Q_OBJECT
32 
33  public:
35  FlatTerrainChunkLoader( QgsTerrainEntity *terrain, QgsChunkNode *mNode );
36 
37  Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
38 
39  private:
40  Qt3DExtras::QPlaneGeometry *mTileGeometry = nullptr;
41 };
42 
44 
52 {
53  public:
55  QgsFlatTerrainGenerator() = default;
56 
57  QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override SIP_FACTORY;
58 
59  QgsTerrainGenerator *clone() const override SIP_FACTORY;
60  Type type() const override;
61  QgsRectangle extent() const override;
62  void rootChunkHeightRange( float &hMin, float &hMax ) const override;
63  void writeXml( QDomElement &elem ) const override;
64  void readXml( const QDomElement &elem ) override;
65 
67  void setExtent( const QgsRectangle &extent );
68 
70  void setCrs( const QgsCoordinateReferenceSystem &crs );
72  QgsCoordinateReferenceSystem crs() const { return mCrs; }
73 
74  private:
75 
76  void updateTilingScheme();
77 
78  QgsRectangle mExtent;
80 };
81 
82 
83 
84 
85 #endif // QGSFLATTERRAINGENERATOR_H
3 Terrain generator that creates a simple square flat area.
A rectangle specified with double values.
Definition: qgsrectangle.h:40
const QgsCoordinateReferenceSystem & crs
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
#define SIP_FACTORY
Definition: qgis_sip.h:69
Type
Enumeration of the available terrain generators.
3 Base class for generators of terrain.
This class represents a coordinate reference system (CRS).