QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsdemterrainsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdemterrainsettings.h
3 --------------------------------------
4 Date : August 2024
5 Copyright : (C) 2024 by Nyall Dawson
6 Email : nyall dot dawson 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 QGSDEMTERRAINSETTINGS_H
17#define QGSDEMTERRAINSETTINGS_H
18
19#include "qgis_3d.h"
20#include "qgis_sip.h"
22#include "qgsmaplayerref.h"
23
24class QgsRasterLayer;
25
36{
37 public:
42
44 QString type() const final;
45 void readXml( const QDomElement &element, const QgsReadWriteContext &context ) final;
46 void writeXml( QDomElement &element, const QgsReadWriteContext &context ) const final;
47 void resolveReferences( const QgsProject *project ) final;
48 bool equals( const QgsAbstractTerrainSettings *other ) const final;
49 std::unique_ptr<QgsTerrainGenerator> createTerrainGenerator( const Qgs3DRenderContext &context ) const override SIP_SKIP;
50
55 void setLayer( QgsRasterLayer *layer );
56
62 QgsRasterLayer *layer() const;
63
69 void setResolution( int resolution ) { mResolution = resolution; }
70
76 int resolution() const { return mResolution; }
77
85 void setSkirtHeight( double height ) { mSkirtHeight = height; }
86
94 double skirtHeight() const { return mSkirtHeight; }
95
96 private:
98 QgsMapLayerRef mLayer;
100 int mResolution = 16;
102 double mSkirtHeight = 10.;
103};
104
105
106#endif // QGSDEMTERRAINSETTINGS_H
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads settings from a DOM element.
virtual void resolveReferences(const QgsProject *project)
After reading settings from XML, resolves references to any layers in a project that have been read a...
virtual std::unique_ptr< QgsTerrainGenerator > createTerrainGenerator(const Qgs3DRenderContext &context) const =0
Creates a new instance of a terrain generator which matches the terrain settings.
virtual QgsAbstractTerrainSettings * clone() const =0
Returns a copy of the terrain settings.
virtual bool equals(const QgsAbstractTerrainSettings *other) const =0
Returns true if this settings is exactly equal to another other settings.
virtual QString type() const =0
Returns the unique type name for the terrain generator.
virtual void writeXml(QDomElement &element, const QgsReadWriteContext &context) const =0
Writes settings to a DOM element.
int resolution() const
Returns the resolution of the terrain (how many elevation samples are taken on one side of a terrain ...
void setSkirtHeight(double height)
Sets the skirt height (in world units).
void setResolution(int resolution)
Sets the resolution of the terrain (how many elevation samples are taken on one side of a terrain til...
double skirtHeight() const
Returns the skirt height (in world units).
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
Represents a raster layer.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76