// // Copyright 2008 Johannes Hofmann // // 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 #include 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