QSurface3DSeries 類以 3D 錶麵圖錶示數據係列。 更多...
| 頭: |
#include <QSurface3DSeries>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
|
| qmake: |
QT += graphs
|
| 在 QML: | Surface3DSeries |
| 繼承: | QAbstract3DSeries |
| enum | DrawFlag { DrawWireframe, DrawSurface, DrawSurfaceAndWireframe } |
| flags | DrawFlags |
|
|
| QSurface3DSeries (QObject * parent = nullptr) | |
| QSurface3DSeries (QSurfaceDataProxy * dataProxy , QObject * parent = nullptr) | |
| virtual | ~QSurface3DSeries () override |
| void | clearArray () |
| void | clearRow (qsizetype rowIndex ) |
| QSurfaceDataArray | dataArray () && |
| const QSurfaceDataArray & | dataArray () const & |
| QSurfaceDataProxy * | dataProxy () const |
| QSurface3DSeries::DrawFlags | drawMode () const |
| bool | isFlatShadingSupported () const |
| QPoint | selectedPoint () const |
| void | setDataArray (const QSurfaceDataArray & newDataArray ) |
| void | setDataProxy (QSurfaceDataProxy * proxy ) |
| void | setDrawMode (QSurface3DSeries::DrawFlags mode ) |
| void | setSelectedPoint (QPoint position ) |
| void | setShading (const QSurface3DSeries::Shading shading ) |
| void | setTexture (const QImage & texture ) |
| void | setTextureFile (const QString & filename ) |
| void | setWireframeColor (QColor color ) |
| QSurface3DSeries::Shading | shading () const |
| QImage | texture () const |
| QString | textureFile () const |
| QColor | wireframeColor () const |
| void | dataArrayChanged (const QSurfaceDataArray & array ) |
| void | dataProxyChanged (QSurfaceDataProxy * proxy ) |
| void | drawModeChanged (QSurface3DSeries::DrawFlags mode ) |
| void | flatShadingSupportedChanged (bool enabled ) |
| void | selectedPointChanged (QPoint position ) |
| void | shadingChanged (const QSurface3DSeries::Shading shading ) |
| void | textureChanged (const QImage & image ) |
| void | textureFileChanged (const QString & filename ) |
| void | wireframeColorChanged (QColor color ) |
| QPoint | invalidSelectionPosition () |
This class manages the series-specific visual elements, as well as the series data (via a data proxy).
Regarding the proxy-series relationship, it is crucial to highlight a couple of key points. In this context, data is stored in series and users can access the dataset through the series. This series is controlled or represented by a proxy object. Thus, the proxy can be used to manage various operations on the data and update the actual dataset. However, it is necessary to create a series associated with this proxy to edit the dataset.
If no data proxy is set explicitly for the series, the series creates a default proxy. Setting another proxy will destroy the existing proxy and all data added to the series.
The object mesh set via the QAbstract3DSeries::mesh property defines the selection pointer shape in a surface series.
QSurface3DSeries supports the following format tags for QAbstract3DSeries::setItemLabelFormat ():
| @xTitle | Title from x-axis |
| @yTitle | Title from y-axis |
| @zTitle | Title from z-axis |
| @xLabel | Item value formatted using the format of the x-axis. For more information, see QValue3DAxis::labelFormat . |
| @yLabel | Item value formatted using the format of the y-axis. For more information, see QValue3DAxis::labelFormat . |
| @zLabel | Item value formatted using the format of the z-axis. For more information, see QValue3DAxis::labelFormat . |
| @seriesName | Name of the series |
例如:
proxy->setItemLabelFormat(QStringLiteral("@valueTitle for (@rowLabel, @colLabel): %.1f"));
另請參閱 Qt Graphs Data Handling with 3D .
The drawing mode of the surface. Values of this enumeration can be combined with the OR operator.
| 常量 | 值 | 描述 |
|---|---|---|
QSurface3DSeries::DrawWireframe
|
1
|
Only the grid is drawn. |
QSurface3DSeries::DrawSurface
|
2
|
Only the surface is drawn. |
QSurface3DSeries::DrawSurfaceAndWireframe
|
DrawWireframe | DrawSurface
|
Both the surface and grid are drawn. |
The DrawFlags type is a typedef for QFlags <DrawFlag>. It stores an OR combination of DrawFlag values.
Data array for the series.
Holds the reference of the data array.
dataArrayChanged signal is emitted when data array is set, unless newDataArray is identical to the previous one.
注意: Before doing anything regarding the dataArray, a series must be created for the relevant proxy.
訪問函數:
| const QSurfaceDataArray & | dataArray () const & |
| QSurfaceDataArray | dataArray () && |
| void | setDataArray (const QSurfaceDataArray & newDataArray ) |
通知程序信號:
| void | dataArrayChanged (const QSurfaceDataArray & array ) |
另請參閱 clearRow (qsizetype rowIndex) and clearArray ().
This property holds the active data proxy.
The series assumes ownership of any proxy set to it and deletes any previously set proxy when a new one is added. The proxy cannot be null or set to another series.
訪問函數:
| QSurfaceDataProxy * | dataProxy () const |
| void | setDataProxy (QSurfaceDataProxy * proxy ) |
通知程序信號:
| void | dataProxyChanged (QSurfaceDataProxy * proxy ) |
The drawing mode.
Possible values are the values of DrawFlag . Clearing all flags is not allowed.
訪問函數:
| QSurface3DSeries::DrawFlags | drawMode () const |
| void | setDrawMode (QSurface3DSeries::DrawFlags mode ) |
通知程序信號:
| void | drawModeChanged (QSurface3DSeries::DrawFlags mode ) |
[read-only]
flatShadingSupported
: const
bool
This property holds whether surface flat shading is supported by the current system.
Flat shading for surfaces requires at least GLSL version 1.2 with GL_EXT_gpu_shader4 extension. If
true
, flat shading for surfaces is supported.
注意:
This read-only property is set to its correct value after the first render pass. Until then it is always
true
.
訪問函數:
| bool | isFlatShadingSupported () const |
通知程序信號:
| void | flatShadingSupportedChanged (bool enabled ) |
This property holds the surface grid point that is selected in the series.
Selects a surface grid point at the position position in the data array of the series specified by a row and a column.
Only one point can be selected at a time.
To clear the selection from this series, invalidSelectionPosition () is set as position . If this series is added to a graph, the graph can adjust the selection according to user interaction or if it becomes invalid.
Removing rows from or inserting rows into the series before the row of the selected point will adjust the selection so that the same point will stay selected.
訪問函數:
| QPoint | selectedPoint () const |
| void | setSelectedPoint (QPoint position ) |
通知程序信號:
| void | selectedPointChanged (QPoint position ) |
另請參閱 Q3DGraphsWidgetItem::clearSelection ().
This property holds whether surface flat shading is enabled.
Preset to
QSurface3DSeries::Shading::Flat
在默認情況下。
When disabled, the normals on the surface are interpolated making the edges look round. When visible, the normals are kept the same on a triangle making the color of the triangle solid. This makes the data more readable from the model.
注意: Flat shaded surfaces require at least GLSL version 1.2 with GL_EXT_gpu_shader4 extension. The value of the flatShadingSupported property indicates whether flat shading is supported at runtime.
訪問函數:
| QSurface3DSeries::Shading | shading () const |
| void | setShading (const QSurface3DSeries::Shading shading ) |
通知程序信號:
| void | shadingChanged (const QSurface3DSeries::Shading shading ) |
This property holds the texture for the surface as a QImage .
設置空 QImage clears the texture.
訪問函數:
| QImage | texture () const |
| void | setTexture (const QImage & texture ) |
通知程序信號:
| void | textureChanged (const QImage & image ) |
This property holds the texture for the surface as a file.
Setting an empty file name clears the texture.
訪問函數:
| QString | textureFile () const |
| void | setTextureFile (const QString & filename ) |
通知程序信號:
| void | textureFileChanged (const QString & filename ) |
This property holds the color for the surface wireframe.
訪問函數:
| QColor | wireframeColor () const |
| void | setWireframeColor (QColor color ) |
通知程序信號:
| void | wireframeColorChanged (QColor color ) |
[explicit]
QSurface3DSeries::
QSurface3DSeries
(
QObject
*
parent
= nullptr)
Constructs a surface 3D series with the parent parent .
[explicit]
QSurface3DSeries::
QSurface3DSeries
(
QSurfaceDataProxy
*
dataProxy
,
QObject
*
parent
= nullptr)
Constructs a surface 3D series with the data proxy dataProxy and the parent parent .
[override virtual noexcept]
QSurface3DSeries::
~QSurface3DSeries
()
Deletes the surface 3D series.
Clears the existing array.
Clears the existing row in the array according to given rowIndex .
[static]
QPoint
QSurface3DSeries::
invalidSelectionPosition
()
返迴 QPoint signifying an invalid selection position. This is set to the selectedPoint property to clear the selection from this series.
另請參閱 Q3DGraphsWidgetItem::clearSelection ().