Loading...
Searching...
No Matches
qwt_plot_item.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_ITEM_H
#define QWT_PLOT_ITEM_H
#include "qwt_global.h"
#include "qwt_axis_id.h"
#include <qmetatype.h>
class QwtScaleMap;
class QwtScaleDiv;
class QwtPlot;
class QwtText;
class QwtGraphic;
class QwtLegendData;
class QRectF;
class QPainter;
class QString;
template< typename T > class QList;
class QWT_EXPORT QwtPlotItem
{
public:
enum RttiValues
{
Rtti_PlotItem = 0,
Rtti_PlotGrid,
Rtti_PlotScale,
Rtti_PlotLegend,
Rtti_PlotMarker,
Rtti_PlotCurve,
Rtti_PlotSpectroCurve,
Rtti_PlotIntervalCurve,
Rtti_PlotHistogram,
Rtti_PlotSpectrogram,
Rtti_PlotGraphic,
Rtti_PlotTradingCurve,
Rtti_PlotBarChart,
Rtti_PlotMultiBarChart,
Rtti_PlotShape,
Rtti_PlotTextLabel,
Rtti_PlotZone,
Rtti_PlotVectorField,
Rtti_PlotUserItem = 1000
};
enum ItemAttribute
{
Legend = 0x01,
AutoScale = 0x02,
Margins = 0x04
};
Q_DECLARE_FLAGS( ItemAttributes, ItemAttribute )
enum ItemInterest
{
ScaleInterest = 0x01,
LegendInterest = 0x02
};
Q_DECLARE_FLAGS( ItemInterests, ItemInterest )
enum RenderHint
{
RenderAntialiased = 0x1
};
Q_DECLARE_FLAGS( RenderHints, RenderHint )
explicit QwtPlotItem();
explicit QwtPlotItem( const QString& title );
explicit QwtPlotItem( const QwtText& title );
virtual ~QwtPlotItem();
void attach( QwtPlot* plot );
void detach();
QwtPlot* plot() const;
void setTitle( const QString& title );
void setTitle( const QwtText& title );
const QwtText& title() const;
virtual int rtti() const;
void setItemAttribute( ItemAttribute, bool on = true );
bool testItemAttribute( ItemAttribute ) const;
void setItemInterest( ItemInterest, bool on = true );
bool testItemInterest( ItemInterest ) const;
void setRenderHint( RenderHint, bool on = true );
bool testRenderHint( RenderHint ) const;
void setRenderThreadCount( uint numThreads );
uint renderThreadCount() const;
void setLegendIconSize( const QSize& );
QSize legendIconSize() const;
double z() const;
void setZ( double z );
void show();
void hide();
virtual void setVisible( bool );
bool isVisible () const;
void setAxes( QwtAxisId xAxis, QwtAxisId yAxis );
void setXAxis( QwtAxisId );
QwtAxisId xAxis() const;
void setYAxis( QwtAxisId );
QwtAxisId yAxis() const;
virtual void itemChanged();
virtual void legendChanged();
virtual void draw( QPainter* painter,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect ) const = 0;
virtual QRectF boundingRect() const;
virtual void getCanvasMarginHint(
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect,
double& left, double& top, double& right, double& bottom) const;
virtual void updateScaleDiv(
const QwtScaleDiv&, const QwtScaleDiv& );
virtual void updateLegend( const QwtPlotItem*,
const QList< QwtLegendData >& );
QRectF scaleRect( const QwtScaleMap&, const QwtScaleMap& ) const;
QRectF paintRect( const QwtScaleMap&, const QwtScaleMap& ) const;
virtual QList< QwtLegendData > legendData() const;
virtual QwtGraphic legendIcon( int index, const QSizeF& ) const;
protected:
QwtGraphic defaultIcon( const QBrush&, const QSizeF& ) const;
private:
Q_DISABLE_COPY(QwtPlotItem)
class PrivateData;
PrivateData* m_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemAttributes )
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemInterests )
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints )
Q_DECLARE_METATYPE( QwtPlotItem* )
#endif
QList
Definition qwt_abstract_legend.h:17
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtLegendData
Attributes of an entry on a legend.
Definition qwt_legend_data.h:37
QwtPlot
A 2-D plotting widget.
Definition qwt_plot.h:79
QwtPlotItem
Base class for items on the plot canvas.
Definition qwt_plot_item.h:67
QwtPlotItem::ItemInterests
QFlags< ItemInterest > ItemInterests
Definition qwt_plot_item.h:200
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
QwtPlotItem::RenderHints
QFlags< RenderHint > RenderHints
Definition qwt_plot_item.h:209
QwtPlotItem::ItemAttributes
QFlags< ItemAttribute > ItemAttributes
Definition qwt_plot_item.h:167
QwtPlotItem::RttiValues
RttiValues
Runtime type information.
Definition qwt_plot_item.h:76
QwtPlotItem::Rtti_PlotVectorField
@ Rtti_PlotVectorField
For QwtPlotVectorField.
Definition qwt_plot_item.h:129
QwtPlotItem::Rtti_PlotLegend
@ Rtti_PlotLegend
For QwtPlotLegendItem.
Definition qwt_plot_item.h:87
QwtPlotItem::Rtti_PlotMarker
@ Rtti_PlotMarker
For QwtPlotMarker.
Definition qwt_plot_item.h:90
QwtPlotItem::Rtti_PlotSpectroCurve
@ Rtti_PlotSpectroCurve
For QwtPlotSpectroCurve.
Definition qwt_plot_item.h:96
QwtPlotItem::Rtti_PlotScale
@ Rtti_PlotScale
For QwtPlotScaleItem.
Definition qwt_plot_item.h:84
QwtPlotItem::Rtti_PlotHistogram
@ Rtti_PlotHistogram
For QwtPlotHistogram.
Definition qwt_plot_item.h:102
QwtPlotItem::Rtti_PlotZone
@ Rtti_PlotZone
For QwtPlotZoneItem.
Definition qwt_plot_item.h:126
QwtPlotItem::Rtti_PlotIntervalCurve
@ Rtti_PlotIntervalCurve
For QwtPlotIntervalCurve.
Definition qwt_plot_item.h:99
QwtPlotItem::Rtti_PlotMultiBarChart
@ Rtti_PlotMultiBarChart
For QwtPlotMultiBarChart.
Definition qwt_plot_item.h:117
QwtPlotItem::Rtti_PlotBarChart
@ Rtti_PlotBarChart
For QwtPlotBarChart.
Definition qwt_plot_item.h:114
QwtPlotItem::Rtti_PlotTradingCurve
@ Rtti_PlotTradingCurve
For QwtPlotTradingCurve.
Definition qwt_plot_item.h:111
QwtPlotItem::Rtti_PlotSpectrogram
@ Rtti_PlotSpectrogram
For QwtPlotSpectrogram.
Definition qwt_plot_item.h:105
QwtPlotItem::Rtti_PlotTextLabel
@ Rtti_PlotTextLabel
For QwtPlotTextLabel.
Definition qwt_plot_item.h:123
QwtPlotItem::Rtti_PlotShape
@ Rtti_PlotShape
For QwtPlotShapeItem.
Definition qwt_plot_item.h:120
QwtPlotItem::Rtti_PlotGrid
@ Rtti_PlotGrid
For QwtPlotGrid.
Definition qwt_plot_item.h:81
QwtPlotItem::Rtti_PlotCurve
@ Rtti_PlotCurve
For QwtPlotCurve.
Definition qwt_plot_item.h:93
QwtPlotItem::Rtti_PlotGraphic
@ Rtti_PlotGraphic
For QwtPlotGraphicItem, QwtPlotSvgItem.
Definition qwt_plot_item.h:108
QwtPlotItem::RenderHint
RenderHint
Render hints.
Definition qwt_plot_item.h:204
QwtPlotItem::ItemAttribute
ItemAttribute
Plot Item Attributes.
Definition qwt_plot_item.h:148
QwtPlotItem::ItemInterest
ItemInterest
Plot Item Interests.
Definition qwt_plot_item.h:180
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtText
A class representing a text.
Definition qwt_text.h:52