IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QHeightMapSurfaceDataProxy Class

Base proxy class for Q3DSurface.

This class was introduced in QtDataVisualization 1.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QHeightMapSurfaceDataProxy Class

  • Header: QHeightMapSurfaceDataProxy

  • Since: QtDataVisualization 1.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS DataVisualization)

    target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)

  • qmake: QT += datavisualization

  • Inherited By:

  • Instantiated By: qml-qtdatavisualization-heightmapsurfacedataproxy.xml

  • Inherits: QSurfaceDataProxy

Detailed Description

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, and 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.

See Also

Property Documentation

 

[since 6.3] autoScaleY : bool

Scale height values to Y-axis.

Defaults to false.

When this property is set to true, the height values are scaled to fit on the Y-axis between minYValue and maxYValue.

This property was introduced in Qt 6.3.

Access functions:

  • bool autoScaleY() const

  • void setAutoScaleY(bool enabled)

Notifier signal:

  • void autoScaleYChanged(bool enabled)

See Also

See also minYValue, maxYValue

heightMap : QImage

This property holds the height map image to be visualized.

Access functions:

Notifier signal:

  • void heightMapChanged(const &image)

heightMapFile : QString

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

Access functions:

Notifier signal:

  • void heightMapFileChanged(const &filename)

maxXValue : float

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

Defaults to 10.0.

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

Access functions:

  • float maxXValue() const

  • void setMaxXValue(float max)

Notifier signal:

  • void maxXValueChanged(float value)

[since 6.3] maxYValue : float

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

Defaults to 10.0.

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

This property was introduced in Qt 6.3.

Access functions:

  • float maxYValue() const

  • void setMaxYValue(float max)

Notifier signal:

  • void maxYValueChanged(float value)

See Also

See also autoScaleY

maxZValue : float

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

Defaults to 10.0.

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

Access functions:

  • float maxZValue() const

  • void setMaxZValue(float max)

Notifier signal:

  • void maxZValueChanged(float value)

minXValue : float

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

Defaults to 0.0.

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

Access functions:

  • float minXValue() const

  • void setMinXValue(float min)

Notifier signal:

  • void minXValueChanged(float value)

[since 6.3] minYValue : float

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

Defaults to 0.0.

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

This property was introduced in Qt 6.3.

Access functions:

  • float minYValue() const

  • void setMinYValue(float min)

Notifier signal:

  • void minYValueChanged(float value)

See Also

See also autoScaleY

minZValue : float

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

Defaults to 0.0.

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

Access functions:

  • float minZValue() const

  • void setMinZValue(float min)

Notifier signal:

  • void minZValueChanged(float value)

Member Function Documentation

 

[explicit] QHeightMapSurfaceDataProxy::QHeightMapSurfaceDataProxy(QObject *parent = nullptr)

Constructs QHeightMapSurfaceDataProxy with the given parent.

[explicit] QHeightMapSurfaceDataProxy::QHeightMapSurfaceDataProxy(const QImage &image, QObject *parent = nullptr)

Constructs QHeightMapSurfaceDataProxy with the given image and parent. Height map is set by calling setHeightMap() with image.

See Also

See also heightMap

[explicit] QHeightMapSurfaceDataProxy::QHeightMapSurfaceDataProxy(const QString &filename, QObject *parent = nullptr)

Constructs QHeightMapSurfaceDataProxy from the given image filename and parent. Height map is set by calling setHeightMapFile() with filename.

See Also

See also heightMapFile

[virtual] 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 function for property heightMap.

See Also

See also heightMap()

void QHeightMapSurfaceDataProxy::setHeightMapFile(const QString &filename)

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

Setter function for property heightMapFile.

See Also

See also 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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+