glviewvol

view src/curve.h @ 15:2a67ea257ac0

makefile fixes for macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 06 Feb 2015 23:47:28 +0200
parents 04330eb80b36
children
line source
1 /*
2 glviewvol is an OpenGL 3D volume data viewer
3 Copyright (C) 2014 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef CURVE_H_
19 #define CURVE_H_
21 #include <vector>
22 #include <inttypes.h>
24 struct CurvePoint {
25 uint16_t t_int; // save time as an integer to allow exact lookup and change
26 float value;
27 };
29 class Curve {
30 private:
31 std::vector<CurvePoint> cp;
33 public:
34 void set_point(float t, float val);
35 void set_point_int(uint16_t ti, float val);
37 bool delete_point(uint16_t ti);
39 CurvePoint *get_point(int idx);
40 const CurvePoint *get_point(int idx) const;
41 int get_num_points() const;
43 CurvePoint *get_point_at(uint16_t ti);
44 const CurvePoint *get_point_at(uint16_t ti) const;
46 float value(float t) const;
47 float value_int(uint16_t ti) const;
48 };
50 #endif // CURVE_H_