Loading...
Searching...
No Matches
qwt_plot_rasteritem.h
/******************************************************************************
* 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 <qstring.h>
class QwtInterval;
class QWT_EXPORT QwtPlotRasterItem : public QwtPlotItem
{
public:
enum CachePolicy
{
NoCache,
PaintCache
};
enum PaintAttribute
{
PaintInDeviceResolution = 1
};
Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
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 QWT_OVERRIDE;
virtual QRectF pixelHint( const QRectF& ) const;
virtual QwtInterval interval(Qt::Axis) const;
virtual QRectF boundingRect() const QWT_OVERRIDE;
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:
explicit 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* m_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
#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