summaryrefslogtreecommitdiff
path: root/src/CurveEditor.H
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-09-07 17:26:28 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-09-07 17:26:28 +0200
commit7be4bae40736f364d65cfb56067203451da053a0 (patch)
treeabd21d91cfcaa3fa5cc1621b2467502e3806f6e5 /src/CurveEditor.H
parent23efce14f047a27f99aa05b8c3596e198d972c19 (diff)
finish pnmcurvedit
Diffstat (limited to 'src/CurveEditor.H')
-rw-r--r--src/CurveEditor.H38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/CurveEditor.H b/src/CurveEditor.H
new file mode 100644
index 0000000..bebadd0
--- /dev/null
+++ b/src/CurveEditor.H
@@ -0,0 +1,38 @@
+//
+// Copyright 2008 Johannes Hofmann <Johannes.Hofmann@gmx.de>
+//
+// This software may be used and distributed according to the terms
+// of the GNU General Public License, incorporated herein by reference.
+
+#ifndef CurveEditor_H
+#define CurveEditor_H
+
+#include <FL/Fl_Widget.H>
+#include <gsl/gsl_spline.h>
+
+class CurveEditor : public Fl_Widget {
+ private:
+ double *X, *Y;
+ int n;
+ int marked_point;
+ Fl_Callback *cb;
+ void *cb_data;
+ gsl_interp_accel *acc;
+ gsl_spline *spline;
+
+ public:
+ CurveEditor(int _x, int _y, int _w, int _h);
+
+ int add_point(double _x, double _y);
+ void init();
+ void clear();
+ void move_point(int i, double _x, double _y);
+ int get_n() {return n;};
+ void get_point(int i, double *_x, double *_y);
+ void remove_point(int i);
+ void draw();
+ int handle(int e);
+ void callback(Fl_Callback *_cb, void *d) {cb = _cb; cb_data = d;};
+};
+
+#endif