|
QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
|
A class that encapsulates grid data and provides interpolation methods. 更多...
#include <qwt_grid_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 成员函数 | |
| QwtGridRasterData () | |
| Constructor. | |
| void | setResampleMode (ResampleMode mode) |
| Set the resample method. | |
| ResampleMode | resampleMode () const |
| Get the current resample method. | |
| virtual QwtInterval | interval (Qt::Axis axis) const override final |
| Return bounding interval for an axis | |
| void | setValue (const QVector< double > &x, const QVector< double > &y, const QVector< QVector< double > > &v) |
| Set new x-axis, y-axis, and data matrix | |
| virtual double | value (double x, double y) const override |
| Return the value at a raster position | |
| virtual QRectF | pixelHint (const QRectF &) const override |
| Calculate the pixel hint | |
| int | xSize () const |
| Return the size of x-axis. | |
| int | ySize () const |
| Return the size of y-axis. | |
| std::pair< int, int > | valueSize () const |
| Return the size of the value matrix. | |
| double | atValue (int xIndex, int yIndex) const |
| Return the value at specified position in the value matrix. | |
| double | atX (int xIndex) const |
| Return the x-axis value at specified index. | |
| double | atY (int yIndex) const |
| Return the y-axis value at specified index. | |
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 that encapsulates grid data and provides interpolation methods.
This class inherits from QwtRasterData and is used to represent 2D grid data. It supports various interpolation methods such as nearest neighbor and bilinear interpolation.
Resampling algorithm
The default setting is NearestNeighbour.
| QwtGridRasterData::QwtGridRasterData | ( | ) |
Constructor.
Destructor
| double QwtGridRasterData::atValue | ( | int | xIndex, |
| int | yIndex | ||
| ) | const |
Return the value at specified position in the value matrix.
| [in] | xIndex | X index. |
| [in] | yIndex | Y index. |
| double QwtGridRasterData::atX | ( | int | xIndex | ) | const |
Return the x-axis value at specified index.
| [in] | xIndex | X index. |
| double QwtGridRasterData::atY | ( | int | yIndex | ) | const |
Return the y-axis value at specified index.
| [in] | yIndex | Y index. |
|
finaloverridevirtual |
Return bounding interval for an axis
| [in] | axis | Axis to query (X, Y, or Z) |
实现了 QwtRasterData.
|
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 representing the data. For NearestNeighbour mode, returns the surrounding pixel. For other modes, returns an empty rectangle.
| [in] | area | Requested area (ignored) |
重载 QwtRasterData .
| QwtGridRasterData::ResampleMode QwtGridRasterData::resampleMode | ( | ) | const |
| void QwtGridRasterData::setResampleMode | ( | QwtGridRasterData::ResampleMode | mode | ) |
Set the resample method.
Sets the resample method to be used when querying values.
| [in] | mode | The resample method to use. |
| void QwtGridRasterData::setValue | ( | const QVector< double > & | x, |
| const QVector< double > & | y, | ||
| const QVector< QVector< double > > & | v | ||
| ) |
Set new x-axis, y-axis, and data matrix
The data matrix layout:
| [in] | x | The x-axis values |
| [in] | y | The y-axis values |
| [in] | v | The 2D data matrix |
|
overridevirtual |
Return the value at a raster position
| [in] | x | X value in plot coordinates |
| [in] | y | Y value in plot coordinates |
实现了 QwtRasterData.
| std::pair< int, int > QwtGridRasterData::valueSize | ( | ) | const |
Return the size of the value matrix.
| int QwtGridRasterData::xSize | ( | ) | const |
Return the size of x-axis.
| int QwtGridRasterData::ySize | ( | ) | const |
Return the size of y-axis.