QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | 所有成员列表
QwtMatrixRasterData类 参考

A class representing a matrix of values as raster data. 更多...

#include <qwt_matrix_raster_data.h>

类 QwtMatrixRasterData 继承关系图:
QwtRasterData

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.

成员枚举类型说明

◆ ResampleMode

Resampling algorithm

The default setting is NearestNeighbour.

枚举值
NearestNeighbour 

Return the value from the matrix that is nearest to the requested position.

BilinearInterpolation 

Interpolate the value from the distances and values of the 4 surrounding values in the matrix.

BicubicInterpolation 

Interpolate the value from the 16 surrounding values in the matrix using hermite bicubic interpolation.

构造及析构函数说明

◆ QwtMatrixRasterData()

QwtMatrixRasterData::QwtMatrixRasterData ( )

Constructor.

Destructor

成员函数说明

◆ interval()

QwtInterval QwtMatrixRasterData::interval ( Qt::Axis  axis) const
finaloverridevirtual

Return bounding interval for an axis.

参数
[in]axisAxis to query.
返回
Bounding interval for the axis.
参见
setInterval()

实现了 QwtRasterData.

◆ numColumns()

int QwtMatrixRasterData::numColumns ( ) const

Return number of columns of the value matrix.

返回
Number of columns.
参见
valueMatrix(), numRows(), setValueMatrix()

◆ numRows()

int QwtMatrixRasterData::numRows ( ) const

Return number of rows of the value matrix.

返回
Number of rows.
参见
valueMatrix(), numColumns(), setValueMatrix()

◆ pixelHint()

QRectF QwtMatrixRasterData::pixelHint ( const QRectF &  area) const
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.

  • NearestNeighbour: pixelHint() returns the surrounding pixel of the top left value in the matrix.
  • BilinearInterpolation: Returns an empty rectangle recommending to render in target device resolution.
    参数
    [in]areaRequested area, ignored.
    返回
    Calculated hint.
    参见
    ResampleMode, setMatrix(), setInterval()

重载 QwtRasterData .

◆ resampleMode()

QwtMatrixRasterData::ResampleMode QwtMatrixRasterData::resampleMode ( ) const

Return the resampling algorithm.

返回
Resampling algorithm.
参见
setResampleMode(), value()

◆ setInterval()

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]axisX, Y or Z axis.
[in]intervalInterval.
参见
QwtRasterData::interval(), setValueMatrix()

◆ setResampleMode()

void QwtMatrixRasterData::setResampleMode ( ResampleMode  mode)

Set the resampling algorithm.

参数
[in]modeResampling mode.
参见
resampleMode(), value()

◆ setValue()

void QwtMatrixRasterData::setValue ( int  row,
int  col,
double  value 
)

Change a single value in the matrix.

参数
[in]rowRow index.
[in]colColumn index.
[in]valueNew value.
参见
value(), setValueMatrix()

◆ setValueMatrix()

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]valuesVector of values.
[in]numColumnsNumber of columns.
参见
valueMatrix(), numColumns(), numRows(), setInterval()

◆ value()

double QwtMatrixRasterData::value ( double  x,
double  y 
) const
overridevirtual

Return the value at a raster position.

参数
[in]xX value in plot coordinates.
[in]yY value in plot coordinates.
返回
Value at the position.
参见
ResampleMode

实现了 QwtRasterData.

◆ valueMatrix()

const QVector< double > QwtMatrixRasterData::valueMatrix ( ) const

Return value matrix.

返回
Value matrix.
参见
setValueMatrix(), numColumns(), numRows(), setInterval()

该类的文档由以下文件生成: