QtPlotHistogram.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef QTPLOTHISTOGRAM_H_
00030 #define QTPLOTHISTOGRAM_H_
00031
00032 #include <qglobal.h>
00033 #include <qcolor.h>
00034 #include <qwt_plot_item.h>
00035 #include <casaqt/QwtConfig.h>
00036
00037 class QtPlotHistogram: public QwtPlotItem {
00038 public:
00039 explicit QtPlotHistogram( const QString &label = QString::null );
00040 explicit QtPlotHistogram( const QwtText &title );
00041 ~QtPlotHistogram( ) { }
00042
00043 void setData( const qwt_interval_t &data );
00044 const qwt_interval_t &data( ) const { return data_; }
00045
00046 QwtDoubleRect boundingRect( ) const;
00047 int rtti( ) const { return QwtPlotItem::Rtti_PlotHistogram; }
00048
00049 #if QWT_VERSION >= 0x060000
00050 void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF & ) const;
00051 #else
00052 void draw( QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect & ) const;
00053 #endif
00054
00055 void setBaseline(double reference);
00056 double baseline() const { return reference_; }
00057
00058 void setColor(const QColor &c);
00059 QColor color() const { return color_; }
00060
00061
00062 private:
00063 virtual void draw_bar( QPainter *, Qt::Orientation orientation, const QRect & ) const;
00064 qwt_interval_t data_;
00065 double reference_;
00066 QColor color_;
00067 };
00068
00069 #endif