glviewvol

annotate src/curve.h @ 9:931a6b35f1cd

added lighting and openmp normal calculation
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 30 Dec 2014 21:20:57 +0200
parents
children 773f89037a35
rev   line source
nuclear@4 1 #ifndef CURVE_H_
nuclear@4 2 #define CURVE_H_
nuclear@4 3
nuclear@4 4 #include <vector>
nuclear@4 5 #include <inttypes.h>
nuclear@4 6
nuclear@4 7 struct CurvePoint {
nuclear@4 8 uint16_t t_int; // save time as an integer to allow exact lookup and change
nuclear@4 9 float value;
nuclear@4 10 };
nuclear@4 11
nuclear@4 12 class Curve {
nuclear@4 13 private:
nuclear@4 14 std::vector<CurvePoint> cp;
nuclear@4 15
nuclear@4 16 public:
nuclear@4 17 void set_point(float t, float val);
nuclear@4 18 void set_point_int(uint16_t ti, float val);
nuclear@4 19
nuclear@4 20 bool delete_point(uint16_t ti);
nuclear@4 21
nuclear@4 22 CurvePoint *get_point(int idx);
nuclear@4 23 const CurvePoint *get_point(int idx) const;
nuclear@4 24 int get_num_points() const;
nuclear@4 25
nuclear@4 26 CurvePoint *get_point_at(uint16_t ti);
nuclear@4 27 const CurvePoint *get_point_at(uint16_t ti) const;
nuclear@4 28
nuclear@4 29 float value(float t) const;
nuclear@4 30 float value_int(uint16_t ti) const;
nuclear@4 31 };
nuclear@4 32
nuclear@4 33 #endif // CURVE_H_