Class: QgsAbstractTerrainSettings¶
Base class for all terrain settings classes.
QgsAbstractTerrainSettings
subclasses are responsible for
storing the configuration of terrain generators.
Warning
This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.
Added in version 3.42.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: clone()
, equals()
, readXml()
, type()
, writeXml()
Class Hierarchy¶
Subclasses¶
Terrain settings for a terrain generator that uses a raster DEM layer to build terrain. |
|
Terrain settings for a simple flat area terrain. |
|
Terrain settings for a terrain generator that uses the Z values of a mesh layer to build a terrain. |
|
Terrain settings for a terrain generator that uses an online DEM to build terrain. |
|
Terrain settings for a terrain generator that uses a quantized mesh tile layer to build a terrain. |
Abstract Methods
Returns a copy of the terrain settings. |
|
Returns |
|
Reads settings from a DOM element. |
|
Returns the unique type name for the terrain generator. |
|
Writes settings to a DOM element. |
Methods
Returns the elevation offset of the terrain (used to move the terrain up or down). |
|
Returns the resolution (in pixels) of the texture of a terrain tile. |
|
Returns the maximum ground error of terrain tiles in world units. |
|
Returns the maximum allowed screen error of terrain tiles in pixels. |
|
Sets the terrain elevation offset (used to move the terrain up or down). |
|
Sets the resolution (in pixels) of the texture of a terrain tile |
|
Sets the maximum ground error of terrain tiles in world units. |
|
Sets the maximum allowed screen error of terrain tiles in pixels. |
|
Sets the vertical scale (exaggeration) for terrain. |
|
Returns the vertical scale (exaggeration) for terrain. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsAbstractTerrainSettings. See the FAQ for more details.
After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs. |
- class qgis._3d.QgsAbstractTerrainSettings[source]¶
Bases:
object
- abstract clone(self) QgsAbstractTerrainSettings | None [source]¶
Returns a copy of the terrain settings.
- Return type:
Optional[QgsAbstractTerrainSettings]
- elevationOffset(self) float [source]¶
Returns the elevation offset of the terrain (used to move the terrain up or down).
See also
- Return type:
float
- abstract equals(self, other: QgsAbstractTerrainSettings | None) bool [source]¶
Returns
True
if this settings is exactly equal to anotherother
settings.- Parameters:
other (Optional[QgsAbstractTerrainSettings])
- Return type:
bool
- mapTileResolution(self) int [source]¶
Returns the resolution (in pixels) of the texture of a terrain tile.
This parameter influences how many zoom levels for terrain tiles there will be (together with
maxTerrainGroundError()
)See also
- Return type:
int
- maximumGroundError(self) float [source]¶
Returns the maximum ground error of terrain tiles in world units.
This parameter influences how many zoom levels there will be (together with
mapTileResolution()
). This value tells that when the given ground error is reached (e.g. 10 meters), it makes no sense to further split terrain tiles into finer ones because they will not add extra details anymore.See also
- Return type:
float
- maximumScreenError(self) float [source]¶
Returns the maximum allowed screen error of terrain tiles in pixels.
This parameter decides how aggressively less detailed terrain tiles are swapped to more detailed ones as camera gets closer. Each tile has its error defined in world units - this error gets projected to screen pixels according to camera view and if the tile’s error is greater than the allowed error, it will be swapped by more detailed tiles with lower error.
- Return type:
float
- abstract readXml(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Reads settings from a DOM
element
.Subclasses should take care to call
readCommonProperties()
to read common properties from the element.See also
See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- virtual resolveReferences(self, project: QgsProject | None)[source]¶
After reading settings from XML, resolves references to any layers in a
project
that have been read as layer IDs.See also
- Parameters:
project (Optional[QgsProject])
- setElevationOffset(self, offset: float)[source]¶
Sets the terrain elevation
offset
(used to move the terrain up or down).See also
- Parameters:
offset (float)
- setMapTileResolution(self, resolution: int)[source]¶
Sets the
resolution
(in pixels) of the texture of a terrain tileSee also
- Parameters:
resolution (int)
- setMaximumGroundError(self, error: float)[source]¶
Sets the maximum ground
error
of terrain tiles in world units.See also
- Parameters:
error (float)
- setMaximumScreenError(self, error: float)[source]¶
Sets the maximum allowed screen
error
of terrain tiles in pixels.See also
- Parameters:
error (float)
- setVerticalScale(self, scale: float)[source]¶
Sets the vertical
scale
(exaggeration) for terrain.(1 = true scale, > 1 = hills get more pronounced)
See also
- Parameters:
scale (float)
- abstract type(self) str [source]¶
Returns the unique type name for the terrain generator.
- Return type:
str
- verticalScale(self) float [source]¶
Returns the vertical scale (exaggeration) for terrain.
(1 = true scale, > 1 = hills get more pronounced)
See also
- Return type:
float
- abstract writeXml(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Writes settings to a DOM
element
.Subclasses should take care to call
writeCommonProperties()
to write common properties to the element.See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)