Classes | Public Types | Public Member Functions | Private Attributes | List of all members
QwtRasterData Class Referenceabstract

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

#include <qwt_raster_data.h>

Inheritance diagram for QwtRasterData:
Inheritance graph
[legend]

Classes

class  ContourPlane
 
class  PrivateData
 

Public Types

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

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...
 
virtual QwtInterval interval (Qt::Axis) const =0
 
virtual QRectF pixelHint (const QRectF &) const
 Pixel hint. More...
 
 QwtRasterData ()
 Constructor. More...
 
void setAttribute (Attribute, bool on=true)
 
bool testAttribute (Attribute) const
 
virtual double value (double x, double y) const =0
 
virtual ~QwtRasterData ()
 Destructor. More...
 

Private Attributes

PrivateDatad_data
 

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.

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.

See also
QwtMatrixRasterData

Definition at line 40 of file qwt_raster_data.h.

Member Typedef Documentation

Raster data Attributes.

Definition at line 73 of file qwt_raster_data.h.

Flags to modify the contour algorithm.

Definition at line 86 of file qwt_raster_data.h.

typedef QMap<double, QPolygonF> QwtRasterData::ContourLines

Contour lines.

Definition at line 44 of file qwt_raster_data.h.

Member Enumeration Documentation

Raster data attributes.

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

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

Note
NaN values indicate an undefined value

Definition at line 52 of file qwt_raster_data.h.

Flags to modify the contour algorithm.

Enumerator
IgnoreAllVerticesOnLevel 

Ignore all vertices on the same level.

IgnoreOutOfRange 

Ignore all values, that are out of range.

Definition at line 76 of file qwt_raster_data.h.

Constructor & Destructor Documentation

QwtRasterData::QwtRasterData ( )

Constructor.

Definition at line 165 of file qwt_raster_data.cpp.

QwtRasterData::~QwtRasterData ( )
virtual

Destructor.

Definition at line 171 of file qwt_raster_data.cpp.

Member Function Documentation

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

Calculate contour lines

Parameters
rectBounding rectangle for the contour lines
rasterNumber of data pixels of the raster data
levelsList of limits, where to insert contour lines
flagsFlags to customize the contouring algorithm
Returns
Calculated contour lines

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

Definition at line 280 of file qwt_raster_data.cpp.

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

Definition at line 231 of file qwt_raster_data.cpp.

void QwtRasterData::initRaster ( const QRectF &  area,
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
areaArea of the raster
rasterNumber of horizontal and vertical pixels
See also
initRaster(), value()

Definition at line 215 of file qwt_raster_data.cpp.

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

Implemented in QwtMatrixRasterData.

QRectF QwtRasterData::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 in QwtMatrixRasterData.

Definition at line 261 of file qwt_raster_data.cpp.

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

Specify an attribute of the data

Parameters
attributeAttribute
onOn/Off /sa Attribute, testAttribute()

Definition at line 183 of file qwt_raster_data.cpp.

bool QwtRasterData::testAttribute ( Attribute  attribute) const
Returns
True, when attribute is enabled
See also
Attribute, setAttribute()

Definition at line 195 of file qwt_raster_data.cpp.

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

Implemented in QwtMatrixRasterData.

Member Data Documentation

PrivateData* QwtRasterData::d_data
private

Definition at line 122 of file qwt_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:19