Qwt User's Guide 6.1.4

qwt_plot_rasteritem.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_PLOT_RASTERITEM_H
11 #define QWT_PLOT_RASTERITEM_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_item.h"
15 #include "qwt_interval.h"
16 #include <qglobal.h>
17 #include <qstring.h>
18 #include <qimage.h>
19
37 class QWT_EXPORT QwtPlotRasterItem: public QwtPlotItem
38 {
39 public:
44 enum CachePolicy
45 {
49 NoCache,
50
59 PaintCache
60 };
61
66 enum PaintAttribute
67 {
80 PaintInDeviceResolution = 1
81 };
82
84 typedef QFlags<PaintAttribute> PaintAttributes;
85
86 explicit QwtPlotRasterItem( const QString& title = QString() );
87 explicit QwtPlotRasterItem( const QwtText& title );
88 virtual ~QwtPlotRasterItem();
89
90 void setPaintAttribute( PaintAttribute, bool on = true );
91 bool testPaintAttribute( PaintAttribute ) const;
92
93 void setAlpha( int alpha );
94 int alpha() const;
95
96 void setCachePolicy( CachePolicy );
97 CachePolicy cachePolicy() const;
98
99 void invalidateCache();
100
101 virtual void draw( QPainter *,
102 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
103 const QRectF &canvasRect ) const;
104
105 virtual QRectF pixelHint( const QRectF & ) const;
106
107 virtual QwtInterval interval(Qt::Axis) const;
108 virtual QRectF boundingRect() const;
109
110 protected:
127 virtual QImage renderImage( const QwtScaleMap &xMap,
128 const QwtScaleMap &yMap, const QRectF &area,
129 const QSize &imageSize ) const = 0;
130
131 virtual QwtScaleMap imageMap( Qt::Orientation,
132 const QwtScaleMap &map, const QRectF &area,
133 const QSize &imageSize, double pixelSize) const;
134
135 private:
136 QwtPlotRasterItem( const QwtPlotRasterItem & );
137 QwtPlotRasterItem &operator=( const QwtPlotRasterItem & );
138
139 void init();
140
141 QImage compose( const QwtScaleMap &, const QwtScaleMap &,
142 const QRectF &imageArea, const QRectF &paintRect,
143 const QSize &imageSize, bool doCache) const;
144
145
146 class PrivateData;
147 PrivateData *d_data;
148 };
149
150 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
151
152 #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