qwt_plot_rasteritem.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_PLOT_RASTERITEM_H
#define QWT_PLOT_RASTERITEM_H
#include "qwt_global.h"
#include "qwt_plot_item.h"
#include "qwt_interval.h"
#include <qglobal.h>
#include <qstring.h>
#include <qimage.h>
class QWT_EXPORT QwtPlotRasterItem: public QwtPlotItem
{
public:
enum CachePolicy
{
NoCache,
PaintCache
};
enum PaintAttribute
{
PaintInDeviceResolution = 1
};
typedef QFlags<PaintAttribute> PaintAttributes;
explicit QwtPlotRasterItem( const QString& title = QString() );
explicit QwtPlotRasterItem( const QwtText& title );
virtual ~QwtPlotRasterItem();
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
void setAlpha( int alpha );
int alpha() const;
void setCachePolicy( CachePolicy );
CachePolicy cachePolicy() const;
void invalidateCache();
virtual void draw( QPainter *,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect ) const;
virtual QRectF pixelHint( const QRectF & ) const;
virtual QwtInterval interval(Qt::Axis) const;
virtual QRectF boundingRect() const;
protected:
virtual QImage renderImage( const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRectF &area,
const QSize &imageSize ) const = 0;
virtual QwtScaleMap imageMap( Qt::Orientation,
const QwtScaleMap &map, const QRectF &area,
const QSize &imageSize, double pixelSize) const;
private:
QwtPlotRasterItem( const QwtPlotRasterItem & );
QwtPlotRasterItem &operator=( const QwtPlotRasterItem & );
void init();
QImage compose( const QwtScaleMap &, const QwtScaleMap &,
const QRectF &imageArea, const QRectF &paintRect,
const QSize &imageSize, bool doCache) const;
class PrivateData;
PrivateData *d_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
#endif
QwtPlotRasterItem::PaintAttribute
PaintAttribute
Definition: qwt_plot_rasteritem.h:66
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:64
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtPlotRasterItem::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
Definition: qwt_plot_rasteritem.h:84
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:30
QwtPlotRasterItem::NoCache
Definition: qwt_plot_rasteritem.h:49
QwtPlotRasterItem
A class, which displays raster data.
Definition: qwt_plot_rasteritem.h:37
QwtPlotItem::boundingRect
virtual QRectF boundingRect() const
Definition: qwt_plot_item.cpp:537
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:26
QwtPlotRasterItem::CachePolicy
CachePolicy
Cache policy The default policy is NoCache.
Definition: qwt_plot_rasteritem.h:44