00001
00002
00003 #ifndef PLOT2DSURFACE_H
00004 #define PLOT2DSURFACE_H
00005
00006 #include <iostream>
00007 #include "Plot2D.h"
00008
00009 #ifdef HAVE_GL
00010 #include "qwt3d_surfaceplot.h"
00011 #endif
00012
00013 using namespace std;
00014
00016 class Plot2DSurface:public Plot2D {
00017 public:
00018 Plot2DSurface(Worksheet *p);
00019 void saveSurfaceXML(QDomDocument doc, QDomElement plottag);
00020 void openSurfaceXML(QDomElement e);
00021 QStringList Info();
00022 void drawFill(QPainter *, int, int) {}
00023 void drawLegend(QPainter *p, int x, int y);
00024 void drawCurves(QPainter *p,int w, int h);
00025 bool contourEnabled() { return contourenabled; }
00026 void enableContour(bool e=true) { contourenabled = e; }
00027 QColor ContourColor() { return contour_color; }
00028 void setContourColor(QColor c) { contour_color = c; }
00029 void setContourColor(QString c) { contour_color = QColor(c); }
00030 bool ColoredContour() { return colored_contour; }
00031 void setColoredContour(bool c) {colored_contour = c; }
00032 int ContourWidth() { return contour_width; }
00033 void setContourWidth(int w=0) { contour_width=w; }
00034 bool Mesh(){ return mesh; }
00035 void setMesh(bool m) { mesh=m; }
00036 bool Relative() { return relative; }
00037 void setRelative(bool r) { relative=r; }
00038 int Brush(){ return brush; }
00039 void setBrush(int b) { brush=b; }
00040 bool densityEnabled() { return densityenabled; }
00041 void enableDensity(bool e=true) { densityenabled = e; }
00042 int Number() { return number; }
00043 void setNumber(int n) { number = n; }
00044 double Threshold() { return threshold; }
00045 void setThreshold(double t) { threshold = t; }
00046
00047
00048 QColor Color(int value);
00049 #ifdef HAVE_GL
00050 void setColorVector(Qwt3D::ColorVector c) { cv=c; }
00051 Qwt3D::ColorVector getColorVector() { return cv; }
00052 #endif
00053 private:
00054 int graph_segment(QPainter *p,double x1,double y1, double z1, double x2, double y2, double z2,
00055 double x3, double y3, double z3, double level);
00056 bool densityenabled;
00057 bool contourenabled;
00058 QColor contour_color;
00059 bool colored_contour;
00060 int contour_width;
00061 bool mesh;
00062 bool relative;
00063 int brush;
00064 int number;
00065 double threshold;
00066 #ifdef HAVE_GL
00067 Qwt3D::ColorVector cv;
00068 #endif
00069 };
00070
00071 #endif // PLOT2DSURFACE_H