QWT 7.0.1
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_RASTERITEM_H
28#define QWT_PLOT_RASTERITEM_H
29
30#include "qwt_global.h"
31#include "qwt_plot_item.h"
32
33#include <qstring.h>
34
35class QwtInterval;
36
54class QWT_EXPORT QwtPlotRasterItem : public QwtPlotItem
55{
56 public:
62 {
67
76 PaintCache
77 };
78
84 {
97 PaintInDeviceResolution = 1
98 };
99
100 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
101
102 explicit QwtPlotRasterItem( const QString& title = QString() );
103 explicit QwtPlotRasterItem( const QwtText& title );
104 virtual ~QwtPlotRasterItem();
105
106 void setPaintAttribute( PaintAttribute, bool on = true );
107 bool testPaintAttribute( PaintAttribute ) const;
108
109 void setAlpha( int alpha );
110 int alpha() const;
111
112 void setCachePolicy( CachePolicy );
113 CachePolicy cachePolicy() const;
114
115 void invalidateCache();
116
117 virtual void draw( QPainter*,
118 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
119 const QRectF& canvasRect ) const QWT_OVERRIDE;
120
121 virtual QRectF pixelHint( const QRectF& ) const;
122
123 virtual QwtInterval interval(Qt::Axis) const;
124 virtual QRectF boundingRect() const QWT_OVERRIDE;
125
126 protected:
143 virtual QImage renderImage( const QwtScaleMap& xMap,
144 const QwtScaleMap& yMap, const QRectF& area,
145 const QSize& imageSize ) const = 0;
146
147 virtual QwtScaleMap imageMap( Qt::Orientation,
148 const QwtScaleMap& map, const QRectF& area,
149 const QSize& imageSize, double pixelSize) const;
150
151 private:
152 explicit QwtPlotRasterItem( const QwtPlotRasterItem& );
153 QwtPlotRasterItem& operator=( const QwtPlotRasterItem& );
154
155 void init();
156
157 QImage compose( const QwtScaleMap&, const QwtScaleMap&,
158 const QRectF& imageArea, const QRectF& paintRect,
159 const QSize& imageSize, bool doCache) const;
160
161
162 class PrivateData;
163 PrivateData* m_data;
164};
165
166Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
167
168#endif
A class representing an interval.
Definition qwt_interval.h:40
Base class for items on the plot canvas.
Definition qwt_plot_item.h:85
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
virtual QRectF boundingRect() const
Definition qwt_plot_item.cpp:585
A class, which displays raster data.
Definition qwt_plot_rasteritem.h:55
PaintAttribute
Attributes to modify the drawing algorithm.
Definition qwt_plot_rasteritem.h:84
CachePolicy
Cache policy The default policy is NoCache.
Definition qwt_plot_rasteritem.h:62
@ NoCache
renderImage() is called each time the item has to be repainted
Definition qwt_plot_rasteritem.h:66
A scale map.
Definition qwt_scale_map.h:44
A class representing a text.
Definition qwt_text.h:69