Class: QgsMesh3DDataBlock

A block of 3d stacked mesh data related N faces defined on base mesh frame.

Data are implicitly shared, so the class can be quickly copied std.numeric_limits<double>.quiet_NaN() represents NODATA value

Note

The API is considered EXPERIMENTAL and can be changed without a notice

Note

In QGIS 3.34 this class was renamed from QgsMesh3dDataBlock to QgsMesh3DDataBlock. The old QgsMesh3dDataBlock name remains available in PyQGIS for compatibility.

Added in version 3.12.

Methods

count

Number of 2d faces for which the volume data is stored in the block

faceToVolumeIndex

Returns the indexing between faces and volumes

firstVolumeIndex

Index of the first volume stored in the buffer (absolute)

isValid

Whether the block is valid

isVector

Whether we store vector values

lastVolumeIndex

Index of the last volume stored in the buffer (absolute)

setFaceToVolumeIndex

Sets the indexing between faces and volumes

setValid

Sets block validity

setValues

Sets the values at volume centers

setVerticalLevels

Sets the vertical levels height

setVerticalLevelsCount

Sets the vertical level counts

value

Returns the value at volume centers

values

Returns the values at volume centers

verticalLevels

Returns the vertical levels height

verticalLevelsCount

Returns number of vertical level above 2d faces

volumesCount

Returns number of volumes stored in the buffer

class qgis.core.QgsMesh3DDataBlock[source]

Bases: object

__init__()

Constructs an invalid block

__init__(count: int, isVector: bool)

Constructs a new block for count faces

Parameters:
  • count (int)

  • isVector (bool)

__init__(a0: QgsMesh3DDataBlock)
Parameters:

a0 (QgsMesh3DDataBlock)

count(self) int[source]

Number of 2d faces for which the volume data is stored in the block

Return type:

int

faceToVolumeIndex(self) List[int]

Returns the indexing between faces and volumes

Return type:

List[int]

firstVolumeIndex(self) int[source]

Index of the first volume stored in the buffer (absolute)

Return type:

int

isValid(self) bool[source]

Whether the block is valid

Return type:

bool

isVector(self) bool[source]

Whether we store vector values

Return type:

bool

lastVolumeIndex(self) int[source]

Index of the last volume stored in the buffer (absolute)

Return type:

int

setFaceToVolumeIndex(self, faceToVolumeIndex: Iterable[int])[source]

Sets the indexing between faces and volumes

Parameters:

faceToVolumeIndex (Iterable[int])

setValid(self, valid: bool)[source]

Sets block validity

Parameters:

valid (bool)

setValues(self, doubleBuffer: Iterable[float])[source]

Sets the values at volume centers

For vector datasets the number of values is doubled (x1, y1, x2, y2, … )

Parameters:

doubleBuffer (Iterable[float])

setVerticalLevels(self, verticalLevels: Iterable[float])[source]

Sets the vertical levels height

Parameters:

verticalLevels (Iterable[float])

setVerticalLevelsCount(self, verticalLevelsCount: Iterable[int])[source]

Sets the vertical level counts

Parameters:

verticalLevelsCount (Iterable[int])

value(self, volumeIndex: int) QgsMeshDatasetValue[source]

Returns the value at volume centers

Parameters:

volumeIndex (int) – volume index relative to firstVolumeIndex()

Return type:

QgsMeshDatasetValue

Returns:

value (scalar or vector)

values(self) List[float]

Returns the values at volume centers

For vector datasets the number of values is doubled (x1, y1, x2, y2, … )

Return type:

List[float]

verticalLevels(self) List[float]

Returns the vertical levels height

Return type:

List[float]

verticalLevelsCount(self) List[int]

Returns number of vertical level above 2d faces

Return type:

List[int]

volumesCount(self) int[source]

Returns number of volumes stored in the buffer

Return type:

int