QWT 7.0.1
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
QwtGridRasterData Class Reference

A class that encapsulates grid data and provides interpolation methods. More...

#include <qwt_grid_raster_data.h>

Inheritance diagram for QwtGridRasterData:
QwtRasterData

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.
 

Detailed Description

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,用于表示二维网格数据。 它支持多种插值方法,例如最近邻插值和双线性插值。

Member Enumeration Documentation

◆ ResampleMode

Resampling algorithm The default setting is NearestNeighbour;.

Enumerator
NearestNeighbour 

Return the value from the matrix, that is nearest to the 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.

Member Function Documentation

◆ atValue()

double QwtGridRasterData::atValue ( int  xIndex,
int  yIndex 
) const

value值对应的内容

Parameters
ix
Returns

◆ atX()

double QwtGridRasterData::atX ( int  xIndex) const

Get the x-axis values.

获取 x 轴值。

Returns
The x-axis values. / x 轴值。

◆ atY()

double QwtGridRasterData::atY ( int  yIndex) const

Get the y-axis values.

获取 y 轴值。

Returns
The y-axis values. / y 轴值。

◆ interval()

QwtInterval QwtGridRasterData::interval ( Qt::Axis  ) const
virtual
Returns
Bounding interval for an axis
See also
setInterval

Implements QwtRasterData.

◆ pixelHint()

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

Parameters
areaIn most implementations the resolution of the data doesn't depend on the requested area.
Returns
Bounding rectangle of a pixel

Reimplemented from QwtRasterData.

◆ resampleMode()

QwtGridRasterData::ResampleMode QwtGridRasterData::resampleMode ( ) const

Get the current resample method.

Returns the currently active resample method.

返回当前激活的插值方法。

Returns
The current resample method. 当前插值方法。
See also
setResampleMode(), value()

◆ setResampleMode()

void QwtGridRasterData::setResampleMode ( QwtGridRasterData::ResampleMode  mode)

Set the resample method.

Sets the resample method to be used when querying values.

设置查询值时使用的插值方法。

Parameters
methodThe resample method to use. 要使用的插值方法。
See also
resampleMode(), value()

◆ setValue()

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

Parameters
xAxisThe x-axis values. / x 轴值。
yAxisThe y-axis values. / y 轴值。
dataThe 2D data matrix. / 二维数据矩阵。

◆ value()

double QwtGridRasterData::value ( double  x,
double  y 
) const
virtual
Returns
the value at a raster position
Parameters
xX value in plot coordinates
yY value in plot coordinates

Implements QwtRasterData.

◆ valueSize()

std::pair< int, int > QwtGridRasterData::valueSize ( ) const

y值对应的内容

Parameters
ix
Returns

◆ xSize()

int QwtGridRasterData::xSize ( ) const

x 值对应的内容

Parameters
ix
Returns

◆ ySize()

int QwtGridRasterData::ySize ( ) const

y值对应的内容

Parameters
ix
Returns

The documentation for this class was generated from the following files: