setigraph.h
Go to the documentation of this file.00001
00014 #ifndef SETIGRAPH_H
00015 #define SETIGRAPH_H
00016
00017 #include <qwidget.h>
00018 #include <qarray.h>
00019
00020 class KPopupMenu;
00021 class QPopupMenu;
00022 class SetiLoc;
00023
00031 class SetiGraph : public QWidget
00032 {
00033 Q_OBJECT
00034
00035 public:
00054 SetiGraph(SetiLoc* loc, bool shwPop, bool allowModes, QWidget *parent=0,
00055 const char *name=0);
00057 ~SetiGraph();
00065 void setInfoText(const QString& info);
00070 void setCurve(const QArray<double>& dat);
00079 void setCurve(const double* dat, int len);
00084 void setTextPosition(int pos);
00090 void setPlotMode(int mode);
00091 void setMargin(int left, int right, int top, int bottom);
00092 int leftMargin() {return(m_leftMargin);}
00093 int rightMargin() {return(m_rightMargin);}
00094 int topMargin() {return(m_topMargin);}
00095 int bottomMargin() {return(m_bottomMargin);}
00102 void setName(const QString& wun);
00104 QString name() const;
00106 double maximumValue();
00107 double xRange() {return(m_xRange);}
00108 double yRange() {return(m_yRange);}
00110 int arraySize() {return(m_yData.size());}
00115 void showInfoText(bool show);
00120 bool isInfoTextShown() {return m_showInfo;}
00122 QPixmap createPixmap();
00129 enum modeIds {Bars, Lines, Markers, MarkersAndLines};
00131 enum TextPosIds {TopLeft, TopRight};
00132
00133 public slots:
00139 void slotSaveGraph();
00140
00141 protected:
00146 virtual void paintEvent(QPaintEvent*);
00154 virtual void paintWidget(QPaintDevice* pd);
00163 void drawCurve(const QArray<double>& d,
00164 int mode, const QColor& c, QPainter* p);
00171 virtual void mousePressEvent(QMouseEvent* e);
00177 void printInfo(const QString& info, QPainter* p);
00184 double maxValue(const QArray<double>& array) const;
00191 double minValue(const QArray<double>& array) const;
00192
00193 protected slots:
00199 void handlePopupCommand(int id);
00205 void checkPopupStatus();
00211 void handleInfoPos(int id);
00218 void handleMarkerLines(int id);
00219
00220 protected:
00222 enum PopupIds {BarChart, ScatterChart, Style, ShowInfo, TextPosition, SaveGraph};
00223 SetiLoc* m_location;
00224 bool m_showPopup;
00225 bool m_allowModeSel;
00226 KPopupMenu* m_gpOptions;
00227 QPopupMenu* m_infoPos;
00228 QPopupMenu* m_markerLines;
00229 int m_plotMode;
00230 bool m_showInfo;
00231 bool m_marker;
00232 bool m_lines;
00233 int m_textPos;
00234 double m_xMin;
00235 double m_xMax;
00236 double m_xRange;
00237 QArray<double> m_yData;
00238 double m_yMin;
00239 double m_yMax;
00240 double m_yRange;
00241 int m_leftMargin;
00242 int m_rightMargin;
00243 int m_topMargin;
00244 int m_bottomMargin;
00245 QString m_infoText;
00246 QString m_wuName;
00247 };
00248
00249 #endif
This file is part of the documentation for Ksetiwatch API Version 2.6.1.