QCustom3DVolume

The QCustom3DVolume class adds a volume rendered object to a graph. More

Inheritance diagram of PySide6.QtDataVisualization.QCustom3DVolume

Synopsis

Functions

Detailed Description

A volume rendered object is a box with a 3D texture. Three slice planes are supported for the volume, one along each main axis of the volume.

Rendering volume objects is very performance intensive, especially when the volume is largely transparent, as the contents of the volume are ray-traced. The performance scales nearly linearly with the amount of pixels that the volume occupies on the screen, so showing the volume in a smaller view or limiting the zoom level of the graph are easy ways to improve performance. Similarly, the volume texture dimensions have a large impact on performance. If the frame rate is more important than pixel-perfect rendering of the volume contents, consider turning the high definition shader off by setting the useHighDefShader property to false.

Note

Volumetric objects are only supported with orthographic projection.

Note

Volumetric objects utilize 3D textures, which are not supported in OpenGL ES2 environments.

See also

addCustomItem() orthoProjection useHighDefShader

class PySide6.QtDataVisualization.QCustom3DVolume([parent=None])

PySide6.QtDataVisualization.QCustom3DVolume(position, scaling, rotation, textureWidth, textureHeight, textureDepth, textureData, textureFormat, colorTable[, parent=None])

Parameters

Constructs a custom 3D volume with the given parent.

Constructs a custom 3D volume with the given position, scaling, rotation, textureWidth, textureHeight, textureDepth, textureData, textureFormat, colorTable, and optional parent.

PySide6.QtDataVisualization.QCustom3DVolume.alphaMultiplier()
Return type

float

PySide6.QtDataVisualization.QCustom3DVolume.alphaMultiplierChanged(mult)
Parameters

mult – float

PySide6.QtDataVisualization.QCustom3DVolume.colorTable()
Return type

See also

setColorTable()

PySide6.QtDataVisualization.QCustom3DVolume.colorTableChanged()
PySide6.QtDataVisualization.QCustom3DVolume.createTextureData(images)
Parameters

images

Return type

QList

Creates a new texture data array from an array of images and sets it as textureData for this volume object. The texture dimensions are also set according to image and array dimensions. All of the images in the array must be the same size. If the images are not all in the Format_Indexed8 format, all texture data will be converted into the Format_ARGB32 format. If the images are in the Format_Indexed8 format, the colorTable value for the entire volume will be taken from the first image.

Returns a pointer to the newly created array.

PySide6.QtDataVisualization.QCustom3DVolume.drawSliceFrames()
Return type

bool

PySide6.QtDataVisualization.QCustom3DVolume.drawSliceFramesChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QCustom3DVolume.drawSlices()
Return type

bool

See also

setDrawSlices()

PySide6.QtDataVisualization.QCustom3DVolume.drawSlicesChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QCustom3DVolume.preserveOpacity()
Return type

bool

PySide6.QtDataVisualization.QCustom3DVolume.preserveOpacityChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.QCustom3DVolume.renderSlice(axis, index)
Parameters
  • axisAxis

  • index – int

Return type

PySide6.QtGui.QImage

Renders the slice specified by index along the axis specified by axis into an image. The texture format of this object is used.

Returns the rendered image of the slice, or a null image if an invalid index is specified.

PySide6.QtDataVisualization.QCustom3DVolume.setAlphaMultiplier(mult)
Parameters

mult – float

PySide6.QtDataVisualization.QCustom3DVolume.setColorTable(colors)
Parameters

colors

See also

colorTable()

PySide6.QtDataVisualization.QCustom3DVolume.setDrawSliceFrames(enable)
Parameters

enable – bool

PySide6.QtDataVisualization.QCustom3DVolume.setDrawSlices(enable)
Parameters

enable – bool

See also

drawSlices()

PySide6.QtDataVisualization.QCustom3DVolume.setPreserveOpacity(enable)
Parameters

enable – bool

PySide6.QtDataVisualization.QCustom3DVolume.setSliceFrameColor(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.QCustom3DVolume.setSliceFrameGaps(values)
Parameters

valuesPySide6.QtGui.QVector3D

See also

sliceFrameGaps()

PySide6.QtDataVisualization.QCustom3DVolume.setSliceFrameThicknesses(values)
Parameters

valuesPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.setSliceFrameWidths(values)
Parameters

valuesPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.setSliceIndexX(value)
Parameters

value – int

See also

sliceIndexX()

PySide6.QtDataVisualization.QCustom3DVolume.setSliceIndexY(value)
Parameters

value – int

See also

sliceIndexY()

PySide6.QtDataVisualization.QCustom3DVolume.setSliceIndexZ(value)
Parameters

value – int

See also

sliceIndexZ()

PySide6.QtDataVisualization.QCustom3DVolume.setSliceIndices(x, y, z)
Parameters
  • x – int

  • y – int

  • z – int

A convenience function for setting all three slice indices (x, y, and z) at once.

See also

textureData

PySide6.QtDataVisualization.QCustom3DVolume.setSubTextureData(axis, index, image)
Parameters
PySide6.QtDataVisualization.QCustom3DVolume.setSubTextureData(axis, index, data)
Parameters
  • axisAxis

  • index – int

  • data – str

Sets a single 2D subtexture of the 3D texture along the specified axis of the volume. The index parameter specifies the subtexture to set. The texture data must be in the format specified by the textureFormat property and have the size of the cross-section of the volume texture along the specified axis multiplied by the texture format color depth in bytes. The data is expected to be ordered similarly to the data in images produced by the renderSlice() method along the same axis.

Note

Each x-dimension line of the data needs to be 32-bit aligned when targeting the y-axis or z-axis. If textureFormat is Format_Indexed8 and the textureWidth value is not divisible by four, padding bytes might need to be added to each x-dimension line of the data to properly align it. The padding bytes should indicate a fully transparent color to avoid rendering artifacts.

PySide6.QtDataVisualization.QCustom3DVolume.setTextureData(arg__1)
Parameters

arg__1

PySide6.QtDataVisualization.QCustom3DVolume.setTextureDepth(value)
Parameters

value – int

See also

textureDepth()

PySide6.QtDataVisualization.QCustom3DVolume.setTextureDimensions(width, height, depth)
Parameters
  • width – int

  • height – int

  • depth – int

A convenience function for setting all three texture dimensions (width, height, and depth) at once.

See also

textureData

PySide6.QtDataVisualization.QCustom3DVolume.setTextureFormat(format)
Parameters

formatFormat

Sets the format of the textureData property to format. Only two formats are supported currently: Format_Indexed8 and Format_ARGB32 . If an indexed format is specified, colorTable must also be set. Defaults to Format_ARGB32 .

PySide6.QtDataVisualization.QCustom3DVolume.setTextureHeight(value)
Parameters

value – int

See also

textureHeight()

PySide6.QtDataVisualization.QCustom3DVolume.setTextureWidth(value)
Parameters

value – int

See also

textureWidth()

PySide6.QtDataVisualization.QCustom3DVolume.setUseHighDefShader(enable)
Parameters

enable – bool

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameGaps()
Return type

PySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameGapsChanged(values)
Parameters

valuesPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameThicknesses()
Return type

PySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameThicknessesChanged(values)
Parameters

valuesPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameWidths()
Return type

PySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceFrameWidthsChanged(values)
Parameters

valuesPySide6.QtGui.QVector3D

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexX()
Return type

int

See also

setSliceIndexX()

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexXChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexY()
Return type

int

See also

setSliceIndexY()

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexYChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexZ()
Return type

int

See also

setSliceIndexZ()

PySide6.QtDataVisualization.QCustom3DVolume.sliceIndexZChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.textureData()
Return type

QList

See also

setTextureData()

PySide6.QtDataVisualization.QCustom3DVolume.textureDataChanged(data)
Parameters

dataQList

PySide6.QtDataVisualization.QCustom3DVolume.textureDataWidth()
Return type

int

Returns the actual texture data width. When the texture format is Format_Indexed8 , this value equals textureWidth aligned to a 32-bit boundary. Otherwise, this value equals four times textureWidth .

PySide6.QtDataVisualization.QCustom3DVolume.textureDepth()
Return type

int

PySide6.QtDataVisualization.QCustom3DVolume.textureDepthChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.textureFormat()
Return type

Format

Returns the format of the textureData property value.

PySide6.QtDataVisualization.QCustom3DVolume.textureFormatChanged(format)
Parameters

formatFormat

PySide6.QtDataVisualization.QCustom3DVolume.textureHeight()
Return type

int

PySide6.QtDataVisualization.QCustom3DVolume.textureHeightChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.textureWidth()
Return type

int

PySide6.QtDataVisualization.QCustom3DVolume.textureWidthChanged(value)
Parameters

value – int

PySide6.QtDataVisualization.QCustom3DVolume.useHighDefShader()
Return type

bool

PySide6.QtDataVisualization.QCustom3DVolume.useHighDefShaderChanged(enabled)
Parameters

enabled – bool