Skip to content

Class Quick3DTerrainGeometry

ClassList > Quick3DTerrainGeometry

More...

  • #include <quick3dterraingeometry.h>

Inherits the following classes: QQuick3DGeometry

Public Properties

Type Name
property QVector3D boundsMax
Maximum bounds of the geometry.
property QVector3D boundsMin
Minimum bounds of the geometry.
property QML_ELEMENT QSize gridSize
Grid dimensions (width x height) for terrain vertices.
property QVariantList heightData
Height data array for terrain elevation values.
property double offsetScale
Pffset scale from the last generated terrain data.
property QVector3D offsetVector
Offset vector from the generated terrain heights.
property QSizeF size
Width of the terrain mesh in 3D scene units.

Public Signals

Type Name
signal void boundsMinMaxChanged
signal void gridSizeChanged
signal void heightDataChanged
signal void offsetScaleChanged
signal void offsetVectorChanged
signal void sizeChanged

Public Functions

Type Name
Quick3DTerrainGeometry (QQuick3DObject * parent=nullptr)
Creates a new terrain geometry.
Q_INVOKABLE void buildMetagridFromProvider (const Quick3DTerrainProvider * provider)
Builds and stores a 3x3 metagrid from the provider's normalized data.
QSize gridSize () const
Returns the grid dimensions.
QVariantList heightData () const
Returns the height data in a QML-friendly QVariantList.
double offsetScale () const
QVector3D offsetVector () const
Q_INVOKABLE void restoreHeightsFromProvider (const Quick3DTerrainProvider * provider)
Restores the original height data from the provider.
void setGridSize (const QSize & size)
Sets the grid dimensions.
void setHeightData (const QVariantList & data)
Sets the height data array.
void setOffsetScale (double offsetScale)
void setOffsetVector (const QVector3D & offsetVector)
void setSize (const QSizeF & size)
Sets the terrain width.
QSizeF size () const
Returns the width of the terrain mesh in 3D scene units.

Detailed Description

Custom Qt Quick 3D geometry for rendering terrain meshes with height data.

This class generates a triangulated mesh grid with vertex positions, normals, and texture coordinates based on provided elevation data. The geometry is suitable for use with Qt Quick 3D Model items and supports dynamic updates when height data changes.

Note:

QML Type: Quick3DTerrainGeometry

Public Properties Documentation

property boundsMax

Maximum bounds of the geometry.

QVector3D Quick3DTerrainGeometry::boundsMax;

property boundsMin

Minimum bounds of the geometry.

QVector3D Quick3DTerrainGeometry::boundsMin;

property gridSize [1/2]

Grid dimensions (width x height) for terrain vertices.

QML_ELEMENT QSize Quick3DTerrainGeometry::gridSize;

property heightData [1/2]

Height data array for terrain elevation values.

QVariantList Quick3DTerrainGeometry::heightData;

property offsetScale [1/2]

Pffset scale from the last generated terrain data.

double Quick3DTerrainGeometry::offsetScale;

property offsetVector [1/2]

Offset vector from the generated terrain heights.

QVector3D Quick3DTerrainGeometry::offsetVector;

property size [1/2]

Width of the terrain mesh in 3D scene units.

QSizeF Quick3DTerrainGeometry::size;

Public Signals Documentation

signal boundsMinMaxChanged

void Quick3DTerrainGeometry::boundsMinMaxChanged;

signal gridSizeChanged

void Quick3DTerrainGeometry::gridSizeChanged;

signal heightDataChanged

void Quick3DTerrainGeometry::heightDataChanged;

signal offsetScaleChanged

void Quick3DTerrainGeometry::offsetScaleChanged;

signal offsetVectorChanged

void Quick3DTerrainGeometry::offsetVectorChanged;

signal sizeChanged

void Quick3DTerrainGeometry::sizeChanged;

Public Functions Documentation

function Quick3DTerrainGeometry

Creates a new terrain geometry.

explicit Quick3DTerrainGeometry::Quick3DTerrainGeometry (
    QQuick3DObject * parent=nullptr
) 

function buildMetagridFromProvider

Builds and stores a 3x3 metagrid from the provider's normalized data.

Q_INVOKABLE void Quick3DTerrainGeometry::buildMetagridFromProvider (
    const Quick3DTerrainProvider * provider
) 

function gridSize [2/2]

Returns the grid dimensions.

inline QSize Quick3DTerrainGeometry::gridSize () const

function heightData [2/2]

Returns the height data in a QML-friendly QVariantList.

QVariantList Quick3DTerrainGeometry::heightData () const

function offsetScale [2/2]

inline double Quick3DTerrainGeometry::offsetScale () const

function offsetVector [2/2]

inline QVector3D Quick3DTerrainGeometry::offsetVector () const

function restoreHeightsFromProvider

Restores the original height data from the provider.

Q_INVOKABLE void Quick3DTerrainGeometry::restoreHeightsFromProvider (
    const Quick3DTerrainProvider * provider
) 

function setGridSize

Sets the grid dimensions.

void Quick3DTerrainGeometry::setGridSize (
    const QSize & size
) 

function setHeightData

Sets the height data array.

void Quick3DTerrainGeometry::setHeightData (
    const QVariantList & data
) 

function setOffsetScale

void Quick3DTerrainGeometry::setOffsetScale (
    double offsetScale
) 

function setOffsetVector

void Quick3DTerrainGeometry::setOffsetVector (
    const QVector3D & offsetVector
) 

function setSize

Sets the terrain width.

void Quick3DTerrainGeometry::setSize (
    const QSizeF & size
) 

function size [2/2]

Returns the width of the terrain mesh in 3D scene units.

inline QSizeF Quick3DTerrainGeometry::size () const


The documentation for this class was generated from the following file src/core/3d/quick3dterraingeometry.h