00001
00002
00003 #ifndef GRAPH_H
00004 #define GRAPH_H
00005
00006 #include <qstring.h>
00007 #include <qstringlist.h>
00008 #include <qpainter.h>
00009 #include <klocale.h>
00010 #include "LRange.h"
00011 #include "Label.h"
00012 #include "Style.h"
00013 #include "Symbol.h"
00014 #include "AnnotateValues.h"
00015 #include "plottypes.h"
00016 #include "source.h"
00017
00018 class Graph
00019 {
00020 public:
00021 Graph(QString n="", QString label="", LSource src=SFUNCTION, PType t=P2D, Style *st=0,
00022 Symbol *sy=0,int nr=0, bool s=true);
00023 virtual ~Graph() {}
00024 void openGraph(QTextStream *t,int version);
00025 void saveGraph(QTextStream *t);
00026 virtual void saveXML(QDomDocument doc, QDomElement graphtag) = 0;
00027 QDomElement saveGraphXML(QDomDocument doc, int gtype);
00028 virtual void openXML(QDomNode node) = 0;
00029 void openGraphXML(QDomElement e);
00030 QString Name() { return name; }
00031 Label* getLabel() { return label; }
00032 void setLabel(Label* l) { label=l; }
00033 LSource Source() { return source; }
00034 void setSource(LSource s) { source=s; }
00035 int ReadAs() { return readas; }
00036 void setReadAs(int r) { readas = r; }
00037 PType Type() { return type; }
00038 Style *getStyle() { return style; }
00039 void setStyle(Style *s) { style = s; }
00040 Symbol *getSymbol() { return symbol; }
00041 void setSymbol(Symbol *s) { symbol = s; }
00042 int Number() { return number; }
00043 void setNumber(int n) { number = n; }
00044 bool isShown() { return shown; }
00045 void setShown(bool b) { shown = b; }
00046 AnnotateValues getAnnotateValues() { return av; }
00047 void setAnnotateValues(AnnotateValues a) { av=a;}
00048 QString FitFunction() { return fitfunction; }
00049 void setFitFunction(QString f) { fitfunction=f; }
00050 void drawStyle(QPainter *p, int x, int y);
00051 protected:
00052 QString name;
00053 int number;
00054 PType type;
00055 Label* label;
00056 LSource source;
00057 int readas;
00058 Style* style;
00059 Symbol* symbol;
00060 bool shown;
00061 AnnotateValues av;
00062 QString fitfunction;
00063 };
00064
00065 #endif // GRAPH_H