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

QwtRasterData defines an interface to any type of raster data. 更多...

#include <qwt_raster_data.h>

类 QwtRasterData 继承关系图:
QwtGridRasterData QwtMatrixRasterData

class  ContourPlane
 
class  PrivateData
 

Public 类型

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 成员函数

 QwtRasterData ()
 Constructor
 
virtual ~QwtRasterData ()
 Destructor
 
void setAttribute (Attribute, bool on=true)
 Set an attribute
 
bool testAttribute (Attribute) const
 Test an attribute
 
virtual QwtInterval interval (Qt::Axis) const =0
 
virtual QRectF pixelHint (const QRectF &) const
 Return a hint for the raster item, about how to align the pixels
 
virtual void initRaster (const QRectF &, const QSize &raster)
 Initialize the raster
 
virtual void discardRaster ()
 Discard the raster
 
virtual double value (double x, double y) const =0
 
virtual ContourLines contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const
 Calculate contour lines
 

详细描述

QwtRasterData defines an interface to any type of raster data.

QwtRasterData is an abstract interface, that is used by QwtPlotRasterItem to find the values at the pixels of its raster.

Gaps inside the bounding rectangle of the data can be indicated by NaN values ( when WithoutGaps is disabled ).

Often a raster item is used to display values from a matrix. Then the derived raster data class needs to implement some sort of resampling, that maps the raster of the matrix into the requested raster of the raster item ( depending on resolution and scales of the canvas ).

QwtMatrixRasterData implements raster data, that returns values from a given 2D matrix.

参见
QwtMatrixRasterData

成员枚举类型说明

◆ Attribute

Raster data attributes

Additional information that is used to improve processing of the data.

枚举值
WithoutGaps 

The bounding rectangle of the data is spanned by the interval(Qt::XAxis) and interval(Qt::YAxis).

WithoutGaps indicates, that the data has no gaps ( unknown values ) in this area and the result of value() does not need to be checked for NaN values.

Enabling this flag will have an positive effect on the performance of rendering a QwtPlotSpectrogram.

The default setting is false.

注解
NaN values indicate an undefined value

◆ ConrecFlag

Flags to modify the contour algorithm

枚举值
IgnoreAllVerticesOnLevel 

Ignore all vertices on the same level

IgnoreOutOfRange 

Ignore all values, that are out of range

构造及析构函数说明

◆ QwtRasterData()

QwtRasterData::QwtRasterData ( )

Constructor

Creates a QwtRasterData object with default attributes.

Destructor

成员函数说明

◆ contourLines()

QwtRasterData::ContourLines QwtRasterData::contourLines ( const QRectF &  rect,
const QSize &  raster,
const QList< double > &  levels,
ConrecFlags  flags 
) const
virtual

Calculate contour lines

An adaption of CONREC, a simple contouring algorithm. http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/

参数
[in]rectBounding rectangle for the contour lines
[in]rasterNumber of data pixels of the raster data
[in]levelsList of limits, where to insert contour lines
[in]flagsFlags to customize the contouring algorithm
返回
Calculated contour lines

◆ discardRaster()

void QwtRasterData::discardRaster ( )
virtual

Discard the raster

Discard a raster

After the composition of an image QwtPlotSpectrogram calls discardRaster().

     The default implementation does nothing, but if data has been loaded
     in initRaster(), it could be deleted now.
参见
initRaster(), value()

◆ initRaster()

void QwtRasterData::initRaster ( const QRectF &  area,
const QSize &  raster 
)
virtual

Initialize the raster

Initialize a raster

Before the composition of an image QwtPlotSpectrogram calls initRaster(), announcing the area and its resolution that will be requested.

The default implementation does nothing, but for data sets that are stored in files, it might be good idea to reimplement initRaster(), where the data is resampled and loaded into memory.

参数
[in]areaArea of the raster
[in]rasterNumber of horizontal and vertical pixels
参见
discardRaster(), value()

◆ interval()

virtual QwtInterval QwtRasterData::interval ( Qt::Axis  ) const
pure virtual

QwtGridRasterData , 以及 QwtMatrixRasterData 内被实现.

◆ pixelHint()

QRectF QwtRasterData::pixelHint ( const QRectF &  area) const
virtual

Return a hint for the raster item, about how to align the pixels

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.

参数
[in]areaIn most implementations the resolution of the data doesn't depend on the requested area.
返回
Bounding rectangle of a pixel

QwtGridRasterData , 以及 QwtMatrixRasterData 重载.

◆ setAttribute()

void QwtRasterData::setAttribute ( Attribute  attribute,
bool  on = true 
)

Set an attribute

Specify an attribute of the data

参数
[in]attributeAttribute to set
[in]onOn/Off state
参见
Attribute, testAttribute()

◆ testAttribute()

bool QwtRasterData::testAttribute ( Attribute  attribute) const

Test an attribute

Test if an attribute is enabled

参数
[in]attributeAttribute to test
返回
True when attribute is enabled
参见
Attribute, setAttribute()

◆ value()

virtual double QwtRasterData::value ( double  x,
double  y 
) const
pure virtual

QwtGridRasterData , 以及 QwtMatrixRasterData 内被实现.


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