QHeightMapSurfaceDataProxy Class

Base proxy class for Q3DSurface . 更多...

頭: #include <QHeightMapSurfaceDataProxy>
Since: QtDataVisualization 1.0
實例化: HeightMapSurfaceDataProxy
繼承: QSurfaceDataProxy

特性

公共函數

QHeightMapSurfaceDataProxy (QObject * parent = Q_NULLPTR)
QHeightMapSurfaceDataProxy (const QImage & image , QObject * parent = Q_NULLPTR)
QHeightMapSurfaceDataProxy (const QString & filename , QObject * parent = Q_NULLPTR)
virtual ~QHeightMapSurfaceDataProxy ()
QImage heightMap () const
QString heightMapFile () const
float maxXValue () const
float maxZValue () const
float minXValue () const
float minZValue () const
void setHeightMap (const QImage & image )
void setHeightMapFile (const QString & filename )
void setMaxXValue (float max )
void setMaxZValue (float max )
void setMinXValue (float min )
void setMinZValue (float min )
void setValueRanges (float minX , float maxX , float minZ , float maxZ )

信號

void heightMapChanged (const QImage & image )
void heightMapFileChanged (const QString & filename )
void maxXValueChanged (float value )
void maxZValueChanged (float value )
void minXValueChanged (float value )
void minZValueChanged (float value )

額外繼承成員

詳細描述

Base proxy class for Q3DSurface .

QHeightMapSurfaceDataProxy takes care of surface related height map data handling. It provides a way to give a height map to be visualized as a surface plot.

Since height maps do not contain values for X or Z axes, those values need to be given separately using minXValue , maxXValue , minZValue ,和 maxZValue properties. X-value corresponds to image horizontal direction and Z-value to the vertical. Setting any of these properties triggers asynchronous re-resolving of any existing height map.

另請參閱 QSurfaceDataProxy and Qt Data Visualization 數據處理 .

特性文檔編製

heightMap : QImage

This property holds the height map image to be visualized.

訪問函數:

QImage heightMap () const
void setHeightMap (const QImage & image )

通知程序信號:

void heightMapChanged (const QImage & image )

heightMapFile : QString

This property holds the name of the file with a height map image to be visualized.

訪問函數:

QString heightMapFile () const
void setHeightMapFile (const QString & filename )

通知程序信號:

void heightMapFileChanged (const QString & filename )

maxXValue : float

This property holds the maximum X value for the generated surface points.

默認為 10.0 .

When setting this property the corresponding minimum value is adjusted if necessary, to ensure that the range remains valid.

訪問函數:

float maxXValue () const
void setMaxXValue (float max )

通知程序信號:

void maxXValueChanged (float value )

maxZValue : float

This property holds the maximum Z value for the generated surface points.

默認為 10.0 .

When setting this property the corresponding minimum value is adjusted if necessary, to ensure that the range remains valid.

訪問函數:

float maxZValue () const
void setMaxZValue (float max )

通知程序信號:

void maxZValueChanged (float value )

minXValue : float

This property holds the minimum X value for the generated surface points.

默認為 0.0 .

When setting this property the corresponding maximum value is adjusted if necessary, to ensure that the range remains valid.

訪問函數:

float minXValue () const
void setMinXValue (float min )

通知程序信號:

void minXValueChanged (float value )

minZValue : float

This property holds the minimum Z value for the generated surface points.

默認為 0.0 .

When setting this property the corresponding maximum value is adjusted if necessary, to ensure that the range remains valid.

訪問函數:

float minZValue () const
void setMinZValue (float min )

通知程序信號:

void minZValueChanged (float value )

成員函數文檔編製

QHeightMapSurfaceDataProxy:: QHeightMapSurfaceDataProxy ( QObject * parent = Q_NULLPTR)

構造 QHeightMapSurfaceDataProxy 采用給定 parent .

QHeightMapSurfaceDataProxy:: QHeightMapSurfaceDataProxy (const QImage & image , QObject * parent = Q_NULLPTR)

構造 QHeightMapSurfaceDataProxy 采用給定 image and parent . Height map is set by calling setHeightMap () 采用 image .

另請參閱 heightMap .

QHeightMapSurfaceDataProxy:: QHeightMapSurfaceDataProxy (const QString & filename , QObject * parent = Q_NULLPTR)

構造 QHeightMapSurfaceDataProxy from the given image filename and parent . Height map is set by calling setHeightMapFile () 采用 filename .

另請參閱 heightMapFile .

[虛擬] QHeightMapSurfaceDataProxy:: ~QHeightMapSurfaceDataProxy ()

銷毀 QHeightMapSurfaceDataProxy .

void QHeightMapSurfaceDataProxy:: setHeightMap (const QImage & image )

Replaces current data with the height map data specified by image .

There are several formats the image can be given in, but if it is not in a directly usable format, a conversion is made.

注意: If the result seems wrong, the automatic conversion failed and you should try converting the image yourself before setting it. Preferred format is QImage::Format_RGB32 in grayscale.

The height of the image is read from the red component of the pixels if the image is in grayscale, otherwise it is an average calculated from red, green, and blue components of the pixels. Using grayscale images may improve data conversion speed for large images.

Not recommended formats: all mono formats (for example QImage::Format_Mono ).

The height map is resolved asynchronously. QSurfaceDataProxy::arrayReset () is emitted when the data has been resolved.

注意: setter 函數對於特性 heightMap .

另請參閱 heightMap ().

void QHeightMapSurfaceDataProxy:: setHeightMapFile (const QString & filename )

Replaces current data with height map data from the file specified by filename .

注意: setter 函數對於特性 heightMapFile .

另請參閱 heightMapFile () 和 heightMap .

void QHeightMapSurfaceDataProxy:: setValueRanges ( float minX , float maxX , float minZ , float maxZ )

A convenience function for setting all minimum ( minX and minZ ) and maximum ( maxX and maxZ ) values at the same time. The minimum values must be smaller than the corresponding maximum value. Otherwise the values get adjusted so that they are valid.