00001
00002
00003 #ifndef PLOT2D_H
00004 #define PLOT2D_H
00005
00006 #include <iostream>
00007 #include "Plot.h"
00008
00009 using namespace std;
00010
00011 class Plot2D:public Plot {
00012 public:
00013 Plot2D(Worksheet *p);
00014 ~Plot2D() {}
00015 void saveAxes(QTextStream *t);
00016 void openAxes(QTextStream *t,int version);
00017 Axis *getAxis(int i) { return &axis[i]; }
00018 void setRanges(LRange* r) {range[0]=r[0];range[1]=r[1];}
00019 void setActRanges(LRange* r);
00020 void enableGrid(int index,bool b) { gridenabled[index] = b; }
00021 bool gridEnabled(int index) { return gridenabled[index]; }
00022 void enableBorder(int index,bool b) { borderenabled[index] = b; }
00023 bool borderEnabled(int index) { return borderenabled[index]; }
00024 void draw(QPainter *p, int w, int h);
00025 void drawAxes(QPainter *p, int w, int h);
00026 void drawBorder(QPainter *p, int w, int h);
00027 virtual void drawCurves(QPainter *p, int w, int h) = 0;
00028 void setBorder(int item, bool on);
00029 protected:
00030 Axis axis[4];
00031 private:
00032 bool borderenabled[4];
00033 bool gridenabled[8];
00034 };
00035
00036 #endif // PLOT2D_H