All Classes Functions Variables Typedefs Enumerations Enumerator Pages
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::null );
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 *p,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &rect ) 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