ETL
0.04.19
Main Page
Related Pages
Classes
Files
File List
File Members
ETL
_bezier_angle.h
Go to the documentation of this file.
1
25
/* === S T A R T =========================================================== */
26
27
#ifndef __ETL__BEZIER_ANGLE_H
28
#define __ETL__BEZIER_ANGLE_H
29
30
/* === H E A D E R S ======================================================= */
31
32
#include "
_curve_func.h
"
33
#include "angle"
34
35
/* === M A C R O S ========================================================= */
36
37
/* === T Y P E D E F S ===================================================== */
38
39
/* === C L A S S E S & S T R U C T S ======================================= */
40
41
_ETL_BEGIN_NAMESPACE
42
43
/*
44
template <>
45
class bezier_base<angle> : std::unary_function<float,angle>
46
{
47
public:
48
typedef angle value_type;
49
typedef float time_type;
50
private:
51
affine_combo<value_type,time_type> affine_func;
52
value_type a,b,c,d;
53
time_type r,s;
54
55
public:
56
bezier_base():r(0.0),s(1.0) { }
57
bezier_base(
58
const value_type &a, const value_type &b, const value_type &c, const value_type &d,
59
const time_type &r=0.0, const time_type &s=1.0):
60
a(a),b(b),c(c),d(d),r(r),s(s) { sync(); }
61
62
void sync(void)
63
{
64
}
65
66
value_type
67
operator()(time_type t)const
68
{
69
t=(t-r)/(s-r);
70
return
71
affine_func(
72
affine_func(
73
affine_func(a,b,t),
74
affine_func(b,c,t)
75
,t),
76
affine_func(
77
affine_func(b,c,t),
78
affine_func(c,d,t)
79
,t)
80
,t);
81
}
82
83
void set_rs(time_type new_r, time_type new_s) { r=new_r; s=new_s; }
84
void set_r(time_type new_r) { r=new_r; }
85
void set_s(time_type new_s) { s=new_s; }
86
const time_type &get_r(void)const { return r; }
87
const time_type &get_s(void)const { return s; }
88
time_type get_dt(void)const { return s-r; }
89
90
value_type &
91
operator[](int i)
92
{ return (&a)[i]; }
93
94
const value_type &
95
operator[](int i) const
96
{ return (&a)[i]; }
97
};
98
*/
99
100
_ETL_END_NAMESPACE
101
102
/* === E X T E R N S ======================================================= */
103
104
/* === E N D =============================================================== */
105
106
#endif
107
Generated on Mon Nov 16 2015 15:32:01 for ETL by
1.8.1.2