Class Qf3DTerrainGeometry
ClassList > Qf3DTerrainGeometry
#include <qf3dterraingeometry.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 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 |
|---|---|
| Qf3DTerrainGeometry (QQuick3DObject * parent=nullptr) Creates a new terrain geometry. |
|
| Q_INVOKABLE void | buildMetagridFromProvider (const Qf3DTerrainProvider * 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 Qf3DTerrainProvider * 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: Qf3DTerrainGeometry
Public Properties Documentation
property boundsMax
Maximum bounds of the geometry.
QVector3D Qf3DTerrainGeometry::boundsMax;
property boundsMin
Minimum bounds of the geometry.
QVector3D Qf3DTerrainGeometry::boundsMin;
property gridSize [1/2]
Grid dimensions (width x height) for terrain vertices.
QSize Qf3DTerrainGeometry::gridSize;
property heightData [1/2]
Height data array for terrain elevation values.
QVariantList Qf3DTerrainGeometry::heightData;
property offsetScale [1/2]
Pffset scale from the last generated terrain data.
double Qf3DTerrainGeometry::offsetScale;
property offsetVector [1/2]
Offset vector from the generated terrain heights.
QVector3D Qf3DTerrainGeometry::offsetVector;
property size [1/2]
Width of the terrain mesh in 3D scene units.
QSizeF Qf3DTerrainGeometry::size;
Public Signals Documentation
signal boundsMinMaxChanged
void Qf3DTerrainGeometry::boundsMinMaxChanged;
signal gridSizeChanged
void Qf3DTerrainGeometry::gridSizeChanged;
signal heightDataChanged
void Qf3DTerrainGeometry::heightDataChanged;
signal offsetScaleChanged
void Qf3DTerrainGeometry::offsetScaleChanged;
signal offsetVectorChanged
void Qf3DTerrainGeometry::offsetVectorChanged;
signal sizeChanged
void Qf3DTerrainGeometry::sizeChanged;
Public Functions Documentation
function Qf3DTerrainGeometry
Creates a new terrain geometry.
explicit Qf3DTerrainGeometry::Qf3DTerrainGeometry (
QQuick3DObject * parent=nullptr
)
function buildMetagridFromProvider
Builds and stores a 3x3 metagrid from the provider's normalized data.
Q_INVOKABLE void Qf3DTerrainGeometry::buildMetagridFromProvider (
const Qf3DTerrainProvider * provider
)
function gridSize [2/2]
Returns the grid dimensions.
inline QSize Qf3DTerrainGeometry::gridSize () const
function heightData [2/2]
Returns the height data in a QML-friendly QVariantList.
QVariantList Qf3DTerrainGeometry::heightData () const
function offsetScale [2/2]
inline double Qf3DTerrainGeometry::offsetScale () const
function offsetVector [2/2]
inline QVector3D Qf3DTerrainGeometry::offsetVector () const
function restoreHeightsFromProvider
Restores the original height data from the provider.
Q_INVOKABLE void Qf3DTerrainGeometry::restoreHeightsFromProvider (
const Qf3DTerrainProvider * provider
)
function setGridSize
Sets the grid dimensions.
void Qf3DTerrainGeometry::setGridSize (
const QSize & size
)
function setHeightData
Sets the height data array.
void Qf3DTerrainGeometry::setHeightData (
const QVariantList & data
)
function setOffsetScale
void Qf3DTerrainGeometry::setOffsetScale (
double offsetScale
)
function setOffsetVector
void Qf3DTerrainGeometry::setOffsetVector (
const QVector3D & offsetVector
)
function setSize
Sets the terrain width.
void Qf3DTerrainGeometry::setSize (
const QSizeF & size
)
function size [2/2]
Returns the width of the terrain mesh in 3D scene units.
inline QSizeF Qf3DTerrainGeometry::size () const
The documentation for this class was generated from the following file src/3d/qf3dterraingeometry.h