Qwt User's Guide 6.3.0
|
A class representing a matrix of values as raster data. More...
#include <qwt_matrix_raster_data.h>
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. | |
typedef QFlags< Attribute > | Attributes |
typedef QFlags< ConrecFlag > | ConrecFlags |
Public Member Functions | |
QwtMatrixRasterData () | |
Constructor. | |
virtual | ~QwtMatrixRasterData () |
Destructor. | |
void | setResampleMode (ResampleMode mode) |
Set the resampling algorithm. | |
ResampleMode | resampleMode () const |
void | setInterval (Qt::Axis, const QwtInterval &) |
Assign the bounding interval for an axis. | |
virtual QwtInterval | interval (Qt::Axis axis) const override final |
void | setValueMatrix (const QVector< double > &values, int numColumns) |
Assign a value matrix. | |
const QVector< double > | valueMatrix () const |
void | setValue (int row, int col, double value) |
Change a single value in the matrix. | |
int | numColumns () const |
int | numRows () const |
virtual QRectF | pixelHint (const QRectF &) const override |
Calculate the pixel hint. | |
virtual double | value (double x, double y) const override |
Public Member Functions inherited from QwtRasterData | |
QwtRasterData () | |
Constructor. | |
virtual | ~QwtRasterData () |
Destructor. | |
void | setAttribute (Attribute, bool on=true) |
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 |
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.
Definition at line 28 of file qwt_matrix_raster_data.h.
Resampling algorithm The default setting is NearestNeighbour;.
Definition at line 35 of file qwt_matrix_raster_data.h.
QwtMatrixRasterData::QwtMatrixRasterData | ( | ) |
Constructor.
Definition at line 72 of file qwt_matrix_raster_data.cpp.
|
virtual |
Destructor.
Definition at line 79 of file qwt_matrix_raster_data.cpp.
|
finaloverridevirtual |
Implements QwtRasterData.
Definition at line 134 of file qwt_matrix_raster_data.cpp.
int QwtMatrixRasterData::numColumns | ( | ) | const |
Definition at line 195 of file qwt_matrix_raster_data.cpp.
int QwtMatrixRasterData::numRows | ( | ) | const |
Definition at line 204 of file qwt_matrix_raster_data.cpp.
|
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.
area | Requested area, ignored |
Reimplemented from QwtRasterData.
Definition at line 229 of file qwt_matrix_raster_data.cpp.
QwtMatrixRasterData::ResampleMode QwtMatrixRasterData::resampleMode | ( | ) | const |
Definition at line 99 of file qwt_matrix_raster_data.cpp.
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 )
axis | X, Y or Z axis |
interval | Interval |
Definition at line 120 of file qwt_matrix_raster_data.cpp.
void QwtMatrixRasterData::setResampleMode | ( | ResampleMode | mode | ) |
Set the resampling algorithm.
mode | Resampling mode |
Definition at line 90 of file qwt_matrix_raster_data.cpp.
void QwtMatrixRasterData::setValue | ( | int | row, |
int | col, | ||
double | value ) |
Change a single value in the matrix.
row | Row index |
col | Column index |
value | New value |
Definition at line 181 of file qwt_matrix_raster_data.cpp.
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.
values | Vector of values |
numColumns | Number of columns |
Definition at line 155 of file qwt_matrix_raster_data.cpp.
|
overridevirtual |
x | X value in plot coordinates |
y | Y value in plot coordinates |
Implements QwtRasterData.
Definition at line 256 of file qwt_matrix_raster_data.cpp.
const QVector< double > QwtMatrixRasterData::valueMatrix | ( | ) | const |
Definition at line 167 of file qwt_matrix_raster_data.cpp.