qwt_plot_shapeitem.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_SHAPE_ITEM_H
#define QWT_PLOT_SHAPE_ITEM_H
#include "qwt_global.h"
#include "qwt_plot_item.h"
#include <qpainterpath.h>
class QWT_EXPORT QwtPlotShapeItem: public QwtPlotItem
{
public:
enum PaintAttribute
{
ClipPolygons = 0x01,
};
typedef QFlags<PaintAttribute> PaintAttributes;
enum LegendMode
{
LegendShape,
LegendColor
};
explicit QwtPlotShapeItem( const QString &title = QString() );
explicit QwtPlotShapeItem( const QwtText &title );
virtual ~QwtPlotShapeItem();
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
void setLegendMode( LegendMode );
LegendMode legendMode() const;
void setRect( const QRectF & );
void setPolygon( const QPolygonF & );
void setShape( const QPainterPath & );
QPainterPath shape() const;
void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
void setPen( const QPen & );
QPen pen() const;
void setBrush( const QBrush & );
QBrush brush() const;
void setRenderTolerance( double );
double renderTolerance() const;
virtual QRectF boundingRect() const;
virtual void draw( QPainter *,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect ) const;
virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
virtual int rtti() const;
private:
void init();
class PrivateData;
PrivateData *d_data;
};
#endif
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:65
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:120
QwtPlotShapeItem
A plot item, which displays any graphical shape, that can be defined by a QPainterPath.
Definition: qwt_plot_shapeitem.h:32
QwtText
A class representing a text.
Definition: qwt_text.h:52
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
QwtPlotShapeItem::LegendShape
@ LegendShape
Display a scaled down version of the shape.
Definition: qwt_plot_shapeitem.h:61
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:31
QwtPlotShapeItem::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
Definition: qwt_plot_shapeitem.h:55
QwtPlotItem::legendIcon
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Definition: qwt_plot_item.cpp:371
QwtPlotShapeItem::PaintAttribute
PaintAttribute
Definition: qwt_plot_shapeitem.h:41
QwtPlotShapeItem::LegendMode
LegendMode
Mode how to display the item on the legend.
Definition: qwt_plot_shapeitem.h:59
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:537