|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
A class representing a matrix of values as raster data. 更多...
#include <qwt_matrix_raster_data.h>
类 | |
| class | PrivateData |
Public 类型 | |
| enum | ResampleMode { NearestNeighbour , BilinearInterpolation , BicubicInterpolation } |
| Resampling algorithm 更多... | |
Public 类型 继承自 QwtRasterData | |
| enum | Attribute { WithoutGaps = 0x01 } |
| Raster data attributes 更多... | |
| enum | ConrecFlag { IgnoreAllVerticesOnLevel = 0x01 , IgnoreOutOfRange = 0x02 } |
| Flags to modify the contour algorithm 更多... | |
| using | ContourLines = QMap< double, QPolygonF > |
| Contour lines | |
Public 成员函数 | |
| QwtMatrixRasterData () | |
| Constructor. | |
| void | setResampleMode (ResampleMode mode) |
| Set the resampling algorithm. | |
| ResampleMode | resampleMode () const |
| Return the resampling algorithm. | |
| void | setInterval (Qt::Axis, const QwtInterval &) |
| Assign the bounding interval for an axis. | |
| virtual QwtInterval | interval (Qt::Axis axis) const override final |
| Return bounding interval for an axis. | |
| void | setValueMatrix (const QVector< double > &values, int numColumns) |
| Assign a value matrix. | |
| const QVector< double > | valueMatrix () const |
| Return value matrix. | |
| void | setValue (int row, int col, double value) |
| Change a single value in the matrix. | |
| int | numColumns () const |
| Return number of columns of the value matrix. | |
| int | numRows () const |
| Return number of rows of the value matrix. | |
| virtual QRectF | pixelHint (const QRectF &) const override |
| Calculate the pixel hint. | |
| virtual double | value (double x, double y) const override |
| Return the value at a raster position. | |
Public 成员函数 继承自 QwtRasterData | |
| QwtRasterData () | |
| Constructor | |
| virtual | ~QwtRasterData () |
| Destructor | |
| void | setAttribute (Attribute, bool on=true) |
| Set an attribute | |
| bool | testAttribute (Attribute) const |
| Test an attribute | |
| virtual void | initRaster (const QRectF &, const QSize &raster) |
| Initialize the raster | |
| virtual void | discardRaster () |
| Discard the raster | |
| virtual ContourLines | contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const |
| Calculate contour lines | |
A class representing a matrix of values as raster data.
QwtMatrixRasterData implements an interface for a matrix of equidistant values, that can be used by a QwtPlotRasterItem. It implements a couple of resampling algorithms, to provide values for positions, that or not on the value matrix.
Resampling algorithm
The default setting is NearestNeighbour.
| QwtMatrixRasterData::QwtMatrixRasterData | ( | ) |
Constructor.
Destructor
|
finaloverridevirtual |
Return bounding interval for an axis.
| [in] | axis | Axis to query. |
实现了 QwtRasterData.
| int QwtMatrixRasterData::numColumns | ( | ) | const |
Return number of columns of the value matrix.
| int QwtMatrixRasterData::numRows | ( | ) | const |
Return number of rows of the value matrix.
|
overridevirtual |
Calculate the pixel hint.
pixelHint() returns the geometry of a pixel, that can be used to calculate the resolution and alignment of the plot item, that is representing the data.
| [in] | area | Requested area, ignored. |
重载 QwtRasterData .
| QwtMatrixRasterData::ResampleMode QwtMatrixRasterData::resampleMode | ( | ) | const |
| void QwtMatrixRasterData::setInterval | ( | Qt::Axis | axis, |
| const QwtInterval & | interval | ||
| ) |
Assign the bounding interval for an axis.
Setting the bounding intervals for the X/Y axis is mandatory to define the positions for the values of the value matrix. The interval in Z direction defines the possible range for the values in the matrix, what is f.e used by QwtPlotSpectrogram to map values to colors. The Z-interval might be the bounding interval of the values in the matrix, but usually it isn't. (f.e a interval of 0.0-100.0 for values in percentage).
| [in] | axis | X, Y or Z axis. |
| [in] | interval | Interval. |
| void QwtMatrixRasterData::setResampleMode | ( | ResampleMode | mode | ) |
| void QwtMatrixRasterData::setValue | ( | int | row, |
| int | col, | ||
| double | value | ||
| ) |
Change a single value in the matrix.
| [in] | row | Row index. |
| [in] | col | Column index. |
| [in] | value | New value. |
| void QwtMatrixRasterData::setValueMatrix | ( | const QVector< double > & | values, |
| int | numColumns | ||
| ) |
Assign a value matrix.
The positions of the values are calculated by dividing the bounding rectangle of the X/Y intervals into equidistant rectangles (pixels). Each value corresponds to the center of a pixel.
| [in] | values | Vector of values. |
| [in] | numColumns | Number of columns. |
|
overridevirtual |
Return the value at a raster position.
| [in] | x | X value in plot coordinates. |
| [in] | y | Y value in plot coordinates. |
实现了 QwtRasterData.
| const QVector< double > QwtMatrixRasterData::valueMatrix | ( | ) | const |