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