summaryrefslogtreecommitdiff
path: root/src/CurveEditor.H
blob: c7f469100cb0e7820f0fb875f9c797172e6016c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// 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;
		double *Y;
		int n;
		int marked_point;
		gsl_interp_accel *acc;
		gsl_spline *spline;

	public:
		CurveEditor(int _x, int _y, int _w, int _h);

		void add_point(double _x, double _y);
		void init();
		void set_point(int i, double _x, double _y);
		void draw();
		int handle(int e);
};

#endif