Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_plot_rasteritem.h
1/******************************************************************************
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
16#include <qstring.h>
17
18 class QwtInterval;
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
83 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
84
85 explicit QwtPlotRasterItem( const QString& title = QString() );
86 explicit QwtPlotRasterItem( const QwtText& title );
87 virtual ~QwtPlotRasterItem();
88
89 void setPaintAttribute( PaintAttribute, bool on = true );
90 bool testPaintAttribute( PaintAttribute ) const;
91
92 void setAlpha( int alpha );
93 int alpha() const;
94
95 void setCachePolicy( CachePolicy );
96 CachePolicy cachePolicy() const;
97
98 void invalidateCache();
99
100 virtual void draw( QPainter*,
101 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
102 const QRectF& canvasRect ) const QWT_OVERRIDE;
103
104 virtual QRectF pixelHint( const QRectF& ) const;
105
106 virtual QwtInterval interval(Qt::Axis) const;
107 virtual QRectF boundingRect() const QWT_OVERRIDE;
108
109 protected:
126 virtual QImage renderImage( const QwtScaleMap& xMap,
127 const QwtScaleMap& yMap, const QRectF& area,
128 const QSize& imageSize ) const = 0;
129
130 virtual QwtScaleMap imageMap( Qt::Orientation,
131 const QwtScaleMap& map, const QRectF& area,
132 const QSize& imageSize, double pixelSize) const;
133
134 private:
135 explicit QwtPlotRasterItem( const QwtPlotRasterItem& );
136 QwtPlotRasterItem& operator=( const QwtPlotRasterItem& );
137
138 void init();
139
140 QImage compose( const QwtScaleMap&, const QwtScaleMap&,
141 const QRectF& imageArea, const QRectF& paintRect,
142 const QSize& imageSize, bool doCache) const;
143
144
145 class PrivateData;
146 PrivateData* m_data;
147};
148
149Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
150
151#endif
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPlotItem
Base class for items on the plot canvas.
Definition qwt_plot_item.h:67
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
QwtPlotItem::boundingRect
virtual QRectF boundingRect() const
Definition qwt_plot_item.cpp:568
QwtPlotRasterItem
A class, which displays raster data.
Definition qwt_plot_rasteritem.h:38
QwtPlotRasterItem::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition qwt_plot_rasteritem.h:83
QwtPlotRasterItem::PaintAttribute
PaintAttribute
Definition qwt_plot_rasteritem.h:67
QwtPlotRasterItem::CachePolicy
CachePolicy
Cache policy The default policy is NoCache.
Definition qwt_plot_rasteritem.h:45
QwtPlotRasterItem::NoCache
@ NoCache
Definition qwt_plot_rasteritem.h:49
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtText
A class representing a text.
Definition qwt_text.h:52