QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
QgsVectorLayer3DTilingSettings Class Reference

Defines configuration of how a vector layer gets tiled for 3D rendering. More...

#include <qgsabstractvectorlayer3drenderer.h>

Public Member Functions

int maximumChunkFeatures () const
 Returns the maximum number of features that will be fetched in any chunk.
void readXml (const QDomElement &elem)
 Reads content of the object from XML.
void setMaximumChunkFeatures (int value)
 Sets the maximum number of features that will be fetched in any chunk.
void setShowBoundingBoxes (bool enabled)
 Sets whether to display bounding boxes of entity's tiles (for debugging).
Q_DECL_DEPRECATED void setZoomLevelsCount (int count)
 Sets number of zoom levels.
bool showBoundingBoxes () const
 Returns whether to display bounding boxes of entity's tiles (for debugging).
void writeXml (QDomElement &elem) const
 Writes content of the object to XML.
Q_DECL_DEPRECATED int zoomLevelsCount () const
 Returns number of zoom levels.

Static Public Member Functions

static double maximumLeafExtent ()
 This is the maximum width or height a tile can have and still be considered a leaf node.
static double tileGeometryErrorRatio ()
 This is the ratio of tile's largest size to geometry error and is used when setting the root tile's error.

Detailed Description

Defines configuration of how a vector layer gets tiled for 3D rendering.

Root node has the layer's extent and geometry error is set as a fraction of the extent (see maximumLeafExtent()) Child nodes are created using quadtree approach - a node gets four children, each having their width/height (2D extent) and geometry error halved.

For example a root tile that is 1'000 meters wide will get geometry error set as 10 meters.

When loading data for each tile, we fetch up to maximumChunkFeatures() features. If the limit is hit, we will recursively create children, so that user gets to see more features when zoomed in. If the geographical extent is very large (see maximumLeafExtent()), we would still recursively create children, even if the limit of features is not hit, to avoid jitter due to numerical precision issues.

Since
QGIS 3.12

Definition at line 43 of file qgsabstractvectorlayer3drenderer.h.

Member Function Documentation

◆ maximumChunkFeatures()

int QgsVectorLayer3DTilingSettings::maximumChunkFeatures ( ) const
inline

Returns the maximum number of features that will be fetched in any chunk.

If more features than the maximum belong to the chunk, further features will become available in child nodes. This is meant as a control for performance - fewer features mean faster load times, but user needs to zoom in more to see everything.

See also
setMaximumChunkFeatures()
Since
QGIS 4.0

Definition at line 74 of file qgsabstractvectorlayer3drenderer.h.

◆ maximumLeafExtent()

double QgsVectorLayer3DTilingSettings::maximumLeafExtent ( )
inlinestatic

This is the maximum width or height a tile can have and still be considered a leaf node.

Children will be generated for tiles larger than this, even if their chunks did not reach the maximumChunkFeatures limit. We want to avoid having huge leaf nodes so we don't have float precision issues

Note
not available in Python bindings
Since
QGIS 4.0

Definition at line 105 of file qgsabstractvectorlayer3drenderer.h.

◆ readXml()

void QgsVectorLayer3DTilingSettings::readXml ( const QDomElement & elem)

Reads content of the object from XML.

Definition at line 35 of file qgsabstractvectorlayer3drenderer.cpp.

◆ setMaximumChunkFeatures()

void QgsVectorLayer3DTilingSettings::setMaximumChunkFeatures ( int value)
inline

Sets the maximum number of features that will be fetched in any chunk.

If more features than the maximum belong to the chunk, further features will become available in child nodes. This is meant as a control for performance - fewer features mean faster load times, but user needs to zoom in more to see everything.

See also
maximumChunkFeatures()
Since
QGIS 4.0

Definition at line 83 of file qgsabstractvectorlayer3drenderer.h.

◆ setShowBoundingBoxes()

void QgsVectorLayer3DTilingSettings::setShowBoundingBoxes ( bool enabled)
inline

Sets whether to display bounding boxes of entity's tiles (for debugging).

Definition at line 63 of file qgsabstractvectorlayer3drenderer.h.

◆ setZoomLevelsCount()

Q_DECL_DEPRECATED void QgsVectorLayer3DTilingSettings::setZoomLevelsCount ( int count)
inline

Sets number of zoom levels.

See zoomLevelsCount() documentation for more details.

Deprecated
QGIS 4.0. Tiling is now done based on maximumScreenError() and maximumChunkFeatures().

Definition at line 60 of file qgsabstractvectorlayer3drenderer.h.

◆ showBoundingBoxes()

bool QgsVectorLayer3DTilingSettings::showBoundingBoxes ( ) const
inline

Returns whether to display bounding boxes of entity's tiles (for debugging).

Definition at line 65 of file qgsabstractvectorlayer3drenderer.h.

◆ tileGeometryErrorRatio()

double QgsVectorLayer3DTilingSettings::tileGeometryErrorRatio ( )
inlinestatic

This is the ratio of tile's largest size to geometry error and is used when setting the root tile's error.

The choice of 1/100 was relatively arbitrary and based on test data.

Note
not available in Python bindings
Since
QGIS 4.0

Definition at line 96 of file qgsabstractvectorlayer3drenderer.h.

◆ writeXml()

void QgsVectorLayer3DTilingSettings::writeXml ( QDomElement & elem) const

Writes content of the object to XML.

Definition at line 24 of file qgsabstractvectorlayer3drenderer.cpp.

◆ zoomLevelsCount()

Q_DECL_DEPRECATED int QgsVectorLayer3DTilingSettings::zoomLevelsCount ( ) const
inline

Returns number of zoom levels.

One zoom level means there will be one tile. Every extra zoom level multiplies number of tiles by four. For example, three zoom levels will produce 16 tiles at the highest zoom level. It is therefore recommended to keep the number of zoom levels low to prevent excessive number of tiles.

Deprecated
QGIS 4.0. Tiling is now done based on maximumScreenError() and maximumChunkFeatures().

Definition at line 54 of file qgsabstractvectorlayer3drenderer.h.


The documentation for this class was generated from the following files: