00001
00002
00003 #ifndef PLOTQWT3D_H
00004 #define PLOTQWT3D_H
00005
00006 #ifdef HAVE_GL
00007 #include "qwt3d_surfaceplot.h"
00008 #endif
00009 #include "Plot.h"
00010
00011 class PlotQWT3D : public Plot
00012 #ifdef HAVE_GL
00013 , public Qwt3D::SurfacePlot
00014 #endif
00015 {
00016 public:
00017 PlotQWT3D(Worksheet *p);
00018 QStringList Info();
00019 void mouseDoubleClickEvent(QMouseEvent *e);
00020
00021 void Export(QPainter *p, QString fn,QString format, int w, int h);
00022 void draw(QPainter *p, int w, int h);
00023 void drawCurves(QPainter *p, int w, int h);
00024 #ifdef HAVE_GL
00025 void setPlotStyle(Qwt3D::PLOTSTYLE p) { plotstyle = p; }
00026 Qwt3D::PLOTSTYLE PlotStyle() { return plotstyle; }
00027 void setCoordinateStyle(Qwt3D::COORDSTYLE c) { coordinatestyle = c; }
00028 Qwt3D::COORDSTYLE CoordinateStyle() { return coordinatestyle; }
00029 void setFloorStyle( Qwt3D::FLOORSTYLE f) { floorstyle = f; }
00030 Qwt3D::FLOORSTYLE FloorStyle() { return floorstyle; }
00031 void setColorVector(Qwt3D::ColorVector c) { cv=c; }
00032 Qwt3D::ColorVector getColorVector() { return cv; }
00033 #endif
00034
00035 void saveAxes(QTextStream *) {}
00036 void openAxes(QTextStream *,int) {}
00037 Axis *getAxis(int i) { return &axis[i]; }
00038 void setRange(LRange* r ,int i) {range[i] = *r; }
00039 void setActRange(LRange* r,int i) {actrange[i] = *r; }
00040 void setRanges(LRange* r) {range[0]=r[0];range[1]=r[1];range[2]=r[2]; }
00041 void setActRanges(LRange* r) {actrange[0]=r[0];actrange[1]=r[1];actrange[2]=r[2]; }
00042 void enableGrid(int index,bool b=true) { gridenabled[index] = b; }
00043 bool gridEnabled(int index) { return gridenabled[index]; }
00044 void enableBorder(int index,bool b=true) { borderenabled[index] = b; }
00045 bool borderEnabled(int index) { return borderenabled[index]; }
00046 void setBorder(int item, bool on) { kdDebug()<<"PlotQWT3D::setBorder() : "<<item<<' '<<on<<endl; }
00047 int aspectRatio() { return aspect_ratio; }
00048 void setAspectRatio(int a) { aspect_ratio=a; }
00049 bool mouseDisabled() { return mouse_disabled; }
00050 void disableMouse(bool m) { mouse_disabled=m; }
00051 double majorTicLength(int i) { return major_length[i]; }
00052 void setMajorTicLength(int i, double v) {major_length[i]=v; }
00053 double minorTicLength(int i) { return minor_length[i]; }
00054 void setMinorTicLength(int i, double v) {minor_length[i]=v; }
00055 int Resolution() { return resolution; }
00056 void setDataResolution(int res) { resolution=res; }
00057 private:
00058 void draw();
00059 #ifdef HAVE_GL
00060 Qwt3D::PLOTSTYLE plotstyle;
00061 Qwt3D::COORDSTYLE coordinatestyle;
00062 Qwt3D::FLOORSTYLE floorstyle;
00063 Qwt3D::ColorVector cv;
00064 #endif
00065 Axis axis[12];
00066 bool borderenabled[4];
00067 bool gridenabled[24];
00068
00069
00070 int aspect_ratio;
00071 bool mouse_disabled;
00072 double major_length[12];
00073 double minor_length[12];
00074 int resolution;
00075 };
00076
00077 #endif //PLOTQWT3D_H