QwtRasterData Class Reference

QwtRasterData defines an interface to any type of raster data. More...

#include <qwt_raster_data.h>

Inheritance diagram for QwtRasterData:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ConrecAttribute {
  IgnoreAllVerticesOnLevel = 1,
  IgnoreOutOfRange = 2
}
typedef QMap< double, QPolygonF > ContourLines

Public Member Functions

 QwtRasterData ()
virtual ~QwtRasterData ()
virtual void setInterval (Qt::Axis, const QwtInterval &)
const QwtIntervalinterval (Qt::Axis) const
virtual QRectF pixelHint (const QRectF &) const
virtual void initRaster (const QRectF &, const QSize &raster)
virtual void discardRaster ()
virtual double value (double x, double y) const =0
virtual ContourLines contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, int flags) const

Detailed Description

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.

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 ).


Member Enumeration Documentation

Attribute to modify the contour algorithm.


Constructor & Destructor Documentation

QwtRasterData::QwtRasterData (  ) 

Constructor.

QwtRasterData::~QwtRasterData (  )  [virtual]

Destructor.


Member Function Documentation

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

Calculate contour lines

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

void QwtRasterData::discardRaster (  )  [virtual]

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 deleted now.

See also:
initRaster(), value()
void QwtRasterData::initRaster ( const QRectF &  ,
const QSize &  raster 
) [virtual]

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.

Parameters:
rect Area of the raster
raster Number of horizontal and vertical pixels
See also:
initRaster(), value()
const QwtInterval & QwtRasterData::interval ( Qt::Axis  axis  )  const [inline]
Returns:
Bounding interval for a axis
See also:
setInterval
QRectF QwtRasterData::pixelHint ( const QRectF &   )  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 neighboured 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:
area In most implementations the resolution of the data doesn't depend on the requested area.
Returns:
Bounding rectangle of a pixel

Reimplemented in QwtMatrixRasterData.

void QwtRasterData::setInterval ( Qt::Axis  axis,
const QwtInterval interval 
) [virtual]

Set the bounding interval for the x, y or z coordinates.

Parameters:
axis Axis
interval Bounding interval
See also:
interval()

Reimplemented in QwtMatrixRasterData.

virtual double QwtRasterData::value ( double  x,
double  y 
) const [pure virtual]
Returns:
the value at a raster position
Parameters:
x X value in plot coordinates
y Y value in plot coordinates

Implemented in QwtMatrixRasterData.

Generated on Sun Nov 21 12:01:48 2010 for Qwt User's Guide by  doxygen 1.6.3