|
QWT 7.0.1
|
A class that encapsulates grid data and provides interpolation methods. More...
#include <qwt_grid_raster_data.h>
Classes | |
| class | PrivateData |
Public Types | |
| enum | ResampleMode { NearestNeighbour , BilinearInterpolation , BicubicInterpolation } |
| Resampling algorithm The default setting is NearestNeighbour;. More... | |
Public Types inherited from QwtRasterData | |
| enum | Attribute { WithoutGaps = 0x01 } |
| Raster data attributes. More... | |
| enum | ConrecFlag { IgnoreAllVerticesOnLevel = 0x01 , IgnoreOutOfRange = 0x02 } |
| Flags to modify the contour algorithm. More... | |
| typedef QMap< double, QPolygonF > | ContourLines |
| Contour lines. | |
Public Member Functions | |
| void | setResampleMode (ResampleMode mode) |
| Set the resample method. | |
| ResampleMode | resampleMode () const |
| Get the current resample method. | |
| virtual QwtInterval | interval (Qt::Axis axis) const QWT_OVERRIDE QWT_FINAL |
| 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 QWT_OVERRIDE |
| virtual QRectF | pixelHint (const QRectF &) const QWT_OVERRIDE |
| Pixel hint. | |
| int | xSize () const |
| x 值对应的内容 | |
| int | ySize () const |
| y值对应的内容 | |
| std::pair< int, int > | valueSize () const |
| y值对应的内容 | |
| double | atValue (int xIndex, int yIndex) const |
| value值对应的内容 | |
| double | atX (int xIndex) const |
| Get the x-axis values. | |
| double | atY (int yIndex) const |
| Get the y-axis values. | |
Public Member Functions inherited from QwtRasterData | |
| QwtRasterData () | |
| Constructor. | |
| virtual | ~QwtRasterData () |
| Destructor. | |
| void | setAttribute (Attribute, bool on=true) |
| Specify an attribute of the data. | |
| bool | testAttribute (Attribute) const |
| virtual void | initRaster (const QRectF &, const QSize &raster) |
| Initialize a raster. | |
| virtual void | discardRaster () |
| Discard a 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.
此类继承自 QwtRasterData,用于表示二维网格数据。 它支持多种插值方法,例如最近邻插值和双线性插值。
Resampling algorithm The default setting is NearestNeighbour;.
| double QwtGridRasterData::atValue | ( | int | xIndex, |
| int | yIndex | ||
| ) | const |
value值对应的内容
| ix |
| double QwtGridRasterData::atX | ( | int | xIndex | ) | const |
Get the x-axis values.
获取 x 轴值。
| double QwtGridRasterData::atY | ( | int | yIndex | ) | const |
Get the y-axis values.
获取 y 轴值。
|
virtual |
|
virtual |
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.
Width and height of the hint need to be the horizontal and vertical distances between 2 neighbored points. The center of the hint has to be the position of any point ( it doesn't matter which one ).
An empty hint indicates, that there are values for any detail level.
Limiting the resolution of the image might significantly improve the performance and heavily reduce the amount of memory when rendering a QImage from the raster data.
The default implementation returns an empty rectangle recommending to render in target device ( f.e. screen ) resolution.
| area | In most implementations the resolution of the data doesn't depend on the requested area. |
Reimplemented from QwtRasterData.
| QwtGridRasterData::ResampleMode QwtGridRasterData::resampleMode | ( | ) | const |
Get the current resample method.
Returns the currently active resample method.
返回当前激活的插值方法。
| void QwtGridRasterData::setResampleMode | ( | QwtGridRasterData::ResampleMode | mode | ) |
Set the resample method.
Sets the resample method to be used when querying values.
设置查询值时使用的插值方法。
| method | 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.
data matrix is look like that:
|column[0]|column[1]| ... |column[m]| +------—+------—+--—+------—+ | [x0,yn] | [x1,yn] | ... | [xm,yn] | → yAxis[n] 对应行 +------—+------—+--—+------—+ | ... | ... | ... | ... | +------—+------—+--—+------—+ | [x0,y1] | [x1,y1] | ... | [xm,y1] | → yAxis[1] 对应行 +------—+------—+--—+------—+ | [x0,y0] | [x1,y0] | ... | [xm,y0] | → yAxis[0] 对应行 +------—+------—+--—+------—+ ↑ ↑ ↑ ↑ xAxis[0] xAxis[1] ... xAxis[m]
so (data matrix).size = xAxis.size,(data matrix).at(n).size = yAxis.szie
设置新的 x 轴、y 轴和数据矩阵。 数据矩阵是一个vector<vector> ,数据矩阵.size = xAxis.size,数据矩阵.at(n).size = yAxis.size
| xAxis | The x-axis values. / x 轴值。 |
| yAxis | The y-axis values. / y 轴值。 |
| data | The 2D data matrix. / 二维数据矩阵。 |
|
virtual |
| x | X value in plot coordinates |
| y | Y value in plot coordinates |
Implements QwtRasterData.
| std::pair< int, int > QwtGridRasterData::valueSize | ( | ) | const |
y值对应的内容
| ix |
| int QwtGridRasterData::xSize | ( | ) | const |
x 值对应的内容
| ix |
| int QwtGridRasterData::ySize | ( | ) | const |
y值对应的内容
| ix |