00001 00025 /* === S T A R T =========================================================== */ 00026 00027 #ifndef __ETL_BEZIER_ANGLE_H 00028 #define __ETL_BEZIER_ANGLE_H 00029 00030 /* === H E A D E R S ======================================================= */ 00031 00032 #include "_curve_func.h" 00033 #include "angle" 00034 00035 /* === M A C R O S ========================================================= */ 00036 00037 /* === T Y P E D E F S ===================================================== */ 00038 00039 /* === C L A S S E S & S T R U C T S ======================================= */ 00040 00041 _ETL_BEGIN_NAMESPACE 00042 00043 /* 00044 template <> 00045 class bezier_base<angle> : std::unary_function<float,angle> 00046 { 00047 public: 00048 typedef angle value_type; 00049 typedef float time_type; 00050 private: 00051 affine_combo<value_type,time_type> affine_func; 00052 value_type a,b,c,d; 00053 time_type r,s; 00054 00055 public: 00056 bezier_base():r(0.0),s(1.0) { } 00057 bezier_base( 00058 const value_type &a, const value_type &b, const value_type &c, const value_type &d, 00059 const time_type &r=0.0, const time_type &s=1.0): 00060 a(a),b(b),c(c),d(d),r(r),s(s) { sync(); } 00061 00062 void sync(void) 00063 { 00064 } 00065 00066 value_type 00067 operator()(time_type t)const 00068 { 00069 t=(t-r)/(s-r); 00070 return 00071 affine_func( 00072 affine_func( 00073 affine_func(a,b,t), 00074 affine_func(b,c,t) 00075 ,t), 00076 affine_func( 00077 affine_func(b,c,t), 00078 affine_func(c,d,t) 00079 ,t) 00080 ,t); 00081 } 00082 00083 void set_rs(time_type new_r, time_type new_s) { r=new_r; s=new_s; } 00084 void set_r(time_type new_r) { r=new_r; } 00085 void set_s(time_type new_s) { s=new_s; } 00086 const time_type &get_r(void)const { return r; } 00087 const time_type &get_s(void)const { return s; } 00088 time_type get_dt(void)const { return s-r; } 00089 00090 value_type & 00091 operator[](int i) 00092 { return (&a)[i]; } 00093 00094 const value_type & 00095 operator[](int i) const 00096 { return (&a)[i]; } 00097 }; 00098 */ 00099 00100 _ETL_END_NAMESPACE 00101 00102 /* === E X T E R N S ======================================================= */ 00103 00104 /* === E N D =============================================================== */ 00105 00106 #endif 00107