QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 
26 #define SIP_NO_FILE
27 
29 
31 class FlatTerrainChunkLoader : public QgsTerrainTileLoader
32 {
33  Q_OBJECT
34 
35  public:
37  FlatTerrainChunkLoader( QgsTerrainEntity *terrain, QgsChunkNode *mNode );
38 
39  Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
40 
41  private:
42  Qt3DExtras::QPlaneGeometry *mTileGeometry = nullptr;
43 };
44 
46 
54 {
55  Q_OBJECT
56  public:
58  QgsFlatTerrainGenerator() = default;
59 
60  QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override SIP_FACTORY;
61 
62  QgsTerrainGenerator *clone() const override SIP_FACTORY;
63  Type type() const override;
64  QgsRectangle extent() const override;
65  void setExtent( const QgsRectangle &extent ) override;
66  void rootChunkHeightRange( float &hMin, float &hMax ) const override;
67  void writeXml( QDomElement &elem ) const override;
68  void readXml( const QDomElement &elem ) override;
69 
71  void setCrs( const QgsCoordinateReferenceSystem &crs );
73  QgsCoordinateReferenceSystem crs() const { return mCrs; }
74 
75  private:
76 
77  void updateTilingScheme();
78 
79  QgsRectangle mExtent;
81 };
82 
83 
84 
85 
86 #endif // QGSFLATTERRAINGENERATOR_H
QgsTerrainGenerator::writeXml
virtual void writeXml(QDomElement &elem) const =0
Write terrain generator's configuration to XML.
QgsTerrainGenerator::readXml
virtual void readXml(const QDomElement &elem)=0
Read terrain generator's configuration from XML.
QgsTerrainGenerator::type
virtual Type type() const =0
What texture generator implementation is this.
qgsrectangle.h
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsFlatTerrainGenerator::crs
QgsCoordinateReferenceSystem crs() const
Returns CRS of the terrain.
Definition: qgsflatterraingenerator.h:73
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsTerrainGenerator::rootChunkHeightRange
virtual void rootChunkHeightRange(float &hMin, float &hMax) const
Returns height range of the root chunk in world coordinates.
Definition: qgsterraingenerator.cpp:46
QgsTerrainGenerator
Base class for generators of terrain.
Definition: qgsterraingenerator.h:49
QgsTerrainGenerator::clone
virtual QgsTerrainGenerator * clone() const =0SIP_FACTORY
Makes a copy of the current instance.
qgsterraingenerator.h
QgsTerrainGenerator::Type
Type
Enumeration of the available terrain generators.
Definition: qgsterraingenerator.h:55
QgsFlatTerrainGenerator
Terrain generator that creates a simple square flat area.
Definition: qgsflatterraingenerator.h:53
qgsterraintileloader_p.h
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsTerrainGenerator::setExtent
virtual void setExtent(const QgsRectangle &extent)
sets the extent of the terrain in terrain's CRS
Definition: qgsterraingenerator.h:76
QgsTerrainGenerator::extent
virtual QgsRectangle extent() const =0
extent of the terrain in terrain's CRS