Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QwtMatrixRasterData Class Reference

A class representing a matrix of values as raster data. More...

#include <qwt_matrix_raster_data.h>

Inheritance diagram for QwtMatrixRasterData:
Inheritance graph
[legend]

Classes

class  PrivateData
 

Public Types

enum  ResampleMode { NearestNeighbour, BilinearInterpolation }
 Resampling algorithm The default setting is NearestNeighbour;. More...
 
- Public Types inherited from QwtRasterData
enum  Attribute { WithoutGaps = 0x01 }
 Raster data attributes. More...
 
typedef QFlags< AttributeAttributes
 Raster data Attributes. More...
 
enum  ConrecFlag { IgnoreAllVerticesOnLevel = 0x01, IgnoreOutOfRange = 0x02 }
 Flags to modify the contour algorithm. More...
 
typedef QFlags< ConrecFlagConrecFlags
 Flags to modify the contour algorithm. More...
 
typedef QMap< double, QPolygonF > ContourLines
 Contour lines. More...
 

Public Member Functions

QwtInterval interval (Qt::Axis axis) const
 
int numColumns () const
 
int numRows () const
 
virtual QRectF pixelHint (const QRectF &) const
 Calculate the pixel hint. More...
 
 QwtMatrixRasterData ()
 Constructor. More...
 
ResampleMode resampleMode () const
 
void setInterval (Qt::Axis, const QwtInterval &)
 Assign the bounding interval for an axis. More...
 
void setResampleMode (ResampleMode mode)
 Set the resampling algorithm. More...
 
void setValue (int row, int col, double value)
 Change a single value in the matrix. More...
 
void setValueMatrix (const QVector< double > &values, int numColumns)
 Assign a value matrix. More...
 
virtual double value (double x, double y) const
 
const QVector< double > valueMatrix () const
 
virtual ~QwtMatrixRasterData ()
 Destructor. More...
 
- Public Member Functions inherited from QwtRasterData
virtual ContourLines contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const
 
virtual void discardRaster ()
 Discard a raster. More...
 
virtual void initRaster (const QRectF &, const QSize &raster)
 Initialize a raster. More...
 
 QwtRasterData ()
 Constructor. More...
 
void setAttribute (Attribute, bool on=true)
 
bool testAttribute (Attribute) const
 
virtual ~QwtRasterData ()
 Destructor. More...
 

Private Member Functions

void update ()
 

Private Attributes

PrivateDatad_data
 

Detailed Description

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 25 of file qwt_matrix_raster_data.h.

Member Enumeration Documentation

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,

Definition at line 32 of file qwt_matrix_raster_data.h.

Constructor & Destructor Documentation

QwtMatrixRasterData::QwtMatrixRasterData ( )

Constructor.

Definition at line 40 of file qwt_matrix_raster_data.cpp.

QwtMatrixRasterData::~QwtMatrixRasterData ( )
virtual

Destructor.

Definition at line 47 of file qwt_matrix_raster_data.cpp.

Member Function Documentation

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

Implements QwtRasterData.

Definition at line 102 of file qwt_matrix_raster_data.cpp.

int QwtMatrixRasterData::numColumns ( ) const
Returns
Number of columns of the value matrix
See also
valueMatrix(), numRows(), setValueMatrix()

Definition at line 163 of file qwt_matrix_raster_data.cpp.

int QwtMatrixRasterData::numRows ( ) const
Returns
Number of rows of the value matrix
See also
valueMatrix(), numColumns(), setValueMatrix()

Definition at line 172 of file qwt_matrix_raster_data.cpp.

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

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 ( f.e. screen ) resolution.
Parameters
areaRequested area, ignored
Returns
Calculated hint
See also
ResampleMode, setMatrix(), setInterval()

Reimplemented from QwtRasterData.

Definition at line 197 of file qwt_matrix_raster_data.cpp.

QwtMatrixRasterData::ResampleMode QwtMatrixRasterData::resampleMode ( ) const
Returns
resampling algorithm
See also
setResampleMode(), value()

Definition at line 67 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 )

Parameters
axisX, Y or Z axis
intervalInterval
See also
QwtRasterData::interval(), setValueMatrix()

Definition at line 88 of file qwt_matrix_raster_data.cpp.

void QwtMatrixRasterData::setResampleMode ( ResampleMode  mode)

Set the resampling algorithm.

Parameters
modeResampling mode
See also
resampleMode(), value()

Definition at line 58 of file qwt_matrix_raster_data.cpp.

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

Change a single value in the matrix.

Parameters
rowRow index
colColumn index
valueNew value
See also
value(), setValueMatrix()

Definition at line 149 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.

Parameters
valuesVector of values
numColumnsNumber of columns
See also
valueMatrix(), numColumns(), numRows(), setInterval()()

Definition at line 123 of file qwt_matrix_raster_data.cpp.

void QwtMatrixRasterData::update ( )
private

Definition at line 297 of file qwt_matrix_raster_data.cpp.

double QwtMatrixRasterData::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
See also
ResampleMode

Implements QwtRasterData.

Definition at line 224 of file qwt_matrix_raster_data.cpp.

const QVector< double > QwtMatrixRasterData::valueMatrix ( ) const
Returns
Value matrix
See also
setValueMatrix(), numColumns(), numRows(), setInterval()

Definition at line 135 of file qwt_matrix_raster_data.cpp.

Member Data Documentation

PrivateData* QwtMatrixRasterData::d_data
private

Definition at line 71 of file qwt_matrix_raster_data.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18