1 /*! ========================================================================
2 ** Extended Template Library
3 ** Bezier Template Class Implementation (Angle Specialization)
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ** General Public License for more details.
18 ** === N O T E S ===========================================================
20 ** This is an internal header file, included by other ETL headers.
21 ** You should not attempt to use it directly.
23 ** ========================================================================= */
25 /* === S T A R T =========================================================== */
27 #ifndef __ETL__BEZIER_ANGLE_H
28 #define __ETL__BEZIER_ANGLE_H
30 /* === H E A D E R S ======================================================= */
32 #include "_curve_func.h"
35 /* === M A C R O S ========================================================= */
37 /* === T Y P E D E F S ===================================================== */
39 /* === C L A S S E S & S T R U C T S ======================================= */
45 class bezier_base<angle> : std::unary_function<float,angle>
48 typedef angle value_type;
49 typedef float time_type;
51 affine_combo<value_type,time_type> affine_func;
56 bezier_base():r(0.0),s(1.0) { }
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(); }
67 operator()(time_type t)const
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; }
95 operator[](int i) const
102 /* === E X T E R N S ======================================================= */
104 /* === E N D =============================================================== */