QPBarPlot.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 #ifndef QPBARPLOT_H_
00028 #define QPBARPLOT_H_
00029
00030 #ifdef AIPS_HAS_QWT
00031
00032 #include <graphics/GenericPlotter/Plot.h>
00033 #include <casaqt/QwtPlotter/QPPlotItem.qo.h>
00034
00035 #include <casaqt/QwtPlotter/QPData.h>
00036 #include <casaqt/QwtPlotter/QPOptions.h>
00037
00038 namespace casa {
00039
00040
00041 class QPBarPlot : public QPPlotItem, public BarPlot {
00042 public:
00043
00044
00045
00046 static const String CLASS_NAME;
00047
00048
00049
00050
00051
00052 QPBarPlot(PlotPointDataPtr data, const String& title = "Qwt Bar Plot");
00053
00054
00055 QPBarPlot(const BarPlot& copy);
00056
00057
00058 ~QPBarPlot();
00059
00060
00061
00062 using Plot::setLine;
00063 using BarPlot::setAreaFill;
00064
00065
00066
00067
00068
00069 bool isValid() const;
00070
00071
00072
00073
00074
00075 QwtDoubleRect boundingRect() const;
00076
00077 #if QWT_VERSION < 0x060000
00078
00079 QWidget* legendItem() const;
00080 #endif
00081
00082
00083
00084
00085
00086 void dataChanged() { itemChanged(); }
00087
00088
00089 bool linesShown() const;
00090
00091
00092 void setLinesShown(bool linesShown = true);
00093
00094
00095 PlotLinePtr line() const;
00096
00097
00098 void setLine(const PlotLine& line);
00099
00100
00101
00102
00103
00104 PlotPointDataPtr pointData() const;
00105
00106
00107 bool areaIsFilled() const;
00108
00109
00110 void setAreaFilled(bool fill = true);
00111
00112
00113 PlotAreaFillPtr areaFill() const;
00114
00115
00116 void setAreaFill(const PlotAreaFill& areaFill);
00117
00118 protected:
00119
00120 const String& className() const { return CLASS_NAME; }
00121
00122
00123 #if QWT_VERSION >= 0x060000
00124 void draw_(QPainter* painter, const QwtScaleMap& xMap,
00125 const QwtScaleMap& yMap, const QRectF& canvasRect,
00126 unsigned int drawIndex, unsigned int drawCount) const;
00127 #else
00128 void draw_(QPainter* painter, const QwtScaleMap& xMap,
00129 const QwtScaleMap& yMap, const QRect& canvasRect,
00130 unsigned int drawIndex, unsigned int drawCount) const;
00131 #endif
00132
00133 private:
00134 QPPointData m_data;
00135 double m_barWidth;
00136 QPLine m_line;
00137 QPAreaFill m_areaFill;
00138
00139
00140
00141
00142 void calculateBarWidth();
00143 };
00144
00145 }
00146
00147 #endif
00148
00149 #endif