summaryrefslogtreecommitdiffstats
path: root/lib/tqwtplot3d/examples/autoswitch/autoswitch.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tqwtplot3d/examples/autoswitch/autoswitch.h')
-rw-r--r--lib/tqwtplot3d/examples/autoswitch/autoswitch.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/tqwtplot3d/examples/autoswitch/autoswitch.h b/lib/tqwtplot3d/examples/autoswitch/autoswitch.h
new file mode 100644
index 0000000..f4a6745
--- /dev/null
+++ b/lib/tqwtplot3d/examples/autoswitch/autoswitch.h
@@ -0,0 +1,58 @@
+#ifndef AUTOSWITCH_H__
+#define AUTOSWITCH_H__
+
+#include <qtimer.h>
+#include "qwt3d_surfaceplot.h"
+#include "qwt3d_function.h"
+
+typedef Qwt3D::SurfacePlot SurfacePlot; // VC6/moc issue
+typedef Qwt3D::Function Function; // VC6/moc issue
+
+class Saddle : public Function
+{
+public:
+ Saddle(SurfacePlot& pw)
+ :Function(pw)
+ {
+ setDomain(-2.5,2.5,-2.5,2.5);
+ setMaxZ(1.5);
+ setMinZ(-1.5);
+ setMesh(31,31);
+ }
+
+ double operator()(double x, double y)
+ {
+ return x*y;
+ }
+};
+
+class Hat : public Function
+{
+public:
+
+ Hat(SurfacePlot& pw)
+ :Function(pw)
+ {
+ setDomain(-1.5,1.5,-1.5,1.5);
+ setMesh(41,41);
+ }
+
+ double operator()(double x, double y)
+ {
+ return 1.0 / (x*x+y*y+0.3);
+ }
+};
+
+class Plot : public SurfacePlot
+{
+ Q_OBJECT
+
+public:
+ Plot(QWidget* pw, int updateinterval);
+
+public slots:
+ void rotate();
+
+};
+
+#endif