00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_ITEM_H
00011 #define QWT_PLOT_ITEM_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_double_rect.h"
00015
00016 class QRect;
00017 class QPainter;
00018 class QWidget;
00019 class QwtPlot;
00020 class QwtLegend;
00021 class QwtScaleMap;
00022 class QwtScaleDiv;
00023
00028 class QWT_EXPORT QwtPlotItem
00029 {
00030 public:
00031 enum RttiValues
00032 {
00033 Rtti_PlotItem = 0,
00034
00035 Rtti_PlotGrid,
00036 Rtti_PlotMarker,
00037 Rtti_PlotCurve,
00038 Rtti_PlotHistogram,
00039
00040 Rtti_PlotUserItem = 1000
00041 };
00042
00043 enum ItemAttribute
00044 {
00045 Legend = 1,
00046 AutoScale = 2
00047 };
00048
00049 #if QT_VERSION >= 0x040000
00050 enum RenderHint
00051 {
00052 RenderAntialiased = 1
00053 };
00054 #endif
00055
00056 explicit QwtPlotItem();
00057 virtual ~QwtPlotItem();
00058
00059 void attach(QwtPlot *plot);
00060 void detach() { attach(NULL); }
00061
00062 QwtPlot *plot() const;
00063
00064 virtual int rtti() const;
00065
00066 void setItemAttribute(ItemAttribute, bool on = true);
00067 bool testItemAttribute(ItemAttribute) const;
00068
00069 #if QT_VERSION >= 0x040000
00070 void setRenderHint(RenderHint, bool on = true);
00071 bool testRenderHint(RenderHint) const;
00072 #endif
00073
00074 double z() const;
00075 void setZ(double z);
00076
00077 void show();
00078 void hide();
00079 virtual void setVisible(bool);
00080 bool isVisible () const;
00081
00082 void setAxis(int xAxis, int yAxis);
00083
00084 void setXAxis(int axis);
00085 int xAxis() const;
00086
00087 void setYAxis(int axis);
00088 int yAxis() const;
00089
00090 virtual void itemChanged();
00091
00092 virtual void draw(QPainter *p,
00093 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00094 const QRect &rect) const = 0;
00095
00096 virtual QwtDoubleRect boundingRect() const;
00097
00098 virtual void updateLegend(QwtLegend *) const;
00099 virtual void updateScaleDiv(const QwtScaleDiv&,
00100 const QwtScaleDiv&);
00101
00102 virtual QWidget *legendItem() const;
00103
00104 private:
00105 class PrivateData;
00106 PrivateData *d_data;
00107 };
00108
00109 #endif