bezier_base< V, T > Class Template Reference

Cubic Bezier Curve Base Class. More...

#include <_bezier.h>

Inheritance diagram for bezier_base< V, T >:

bezier< V, T > hermite< V, T > List of all members.

Public Types

typedef V value_type
typedef T time_type

Public Member Functions

 bezier_base ()
 bezier_base (const value_type &a, const value_type &b, const value_type &c, const value_type &d, const time_type &r=0.0, const time_type &s=1.0)
void sync ()
value_type operator() (time_type t) const
void set_rs (time_type new_r, time_type new_s)
void set_r (time_type new_r)
void set_s (time_type new_s)
const time_typeget_r () const
const time_typeget_s () const
time_type get_dt () const
bool intersect_hull (const bezier_base< value_type, time_type > &x) const
time_type intersect (const bezier_base< value_type, time_type > &x, time_type near=0.0) const
 Bezier curve intersection function.
value_typeoperator[] (int i)
const value_typeoperator[] (int i) const

Protected Attributes

affine_combo< value_type,
time_type
affine_func

Private Attributes

value_type a
value_type b
value_type c
value_type d
time_type r
time_type s

Detailed Description

template<typename V, typename T = float>
class bezier_base< V, T >

Cubic Bezier Curve Base Class.

Definition at line 49 of file _bezier.h.


Member Typedef Documentation

template<typename V, typename T = float>
typedef V bezier_base< V, T >::value_type
 

Reimplemented in bezier< V, T >, and hermite< V, T >.

Definition at line 52 of file _bezier.h.

template<typename V, typename T = float>
typedef T bezier_base< V, T >::time_type
 

Reimplemented in bezier< V, T >, and hermite< V, T >.

Definition at line 53 of file _bezier.h.


Constructor & Destructor Documentation

template<typename V, typename T = float>
bezier_base< V, T >::bezier_base  )  [inline]
 

Definition at line 63 of file _bezier.h.

template<typename V, typename T = float>
bezier_base< V, T >::bezier_base const value_type a,
const value_type b,
const value_type c,
const value_type d,
const time_type r = 0.0,
const time_type s = 1.0
[inline]
 

Definition at line 64 of file _bezier.h.

References bezier_base< V, T >::sync().


Member Function Documentation

template<typename V, typename T = float>
void bezier_base< V, T >::sync  )  [inline]
 

Reimplemented in hermite< V, T >.

Definition at line 69 of file _bezier.h.

Referenced by bezier_base< double, float >::bezier_base(), bezier_base< float, float >::bezier_base(), bezier_base< V, T >::bezier_base(), bezier< V, T >::subdivide(), and hermite< V, T >::sync().

template<typename V, typename T = float>
value_type bezier_base< V, T >::operator() time_type  t  )  const [inline]
 

Definition at line 74 of file _bezier.h.

References bezier_base< V, T >::a, bezier_base< V, T >::affine_func, bezier_base< V, T >::b, bezier_base< V, T >::c, bezier_base< V, T >::d, bezier_base< V, T >::r, and bezier_base< V, T >::s.

template<typename V, typename T = float>
void bezier_base< V, T >::set_rs time_type  new_r,
time_type  new_s
[inline]
 

Definition at line 109 of file _bezier.h.

References bezier_base< V, T >::r, and bezier_base< V, T >::s.

template<typename V, typename T = float>
void bezier_base< V, T >::set_r time_type  new_r  )  [inline]
 

Definition at line 110 of file _bezier.h.

References bezier_base< V, T >::r.

Referenced by bezier< V, T >::subdivide().

template<typename V, typename T = float>
void bezier_base< V, T >::set_s time_type  new_s  )  [inline]
 

Definition at line 111 of file _bezier.h.

References bezier_base< V, T >::s.

Referenced by bezier< V, T >::subdivide().

template<typename V, typename T = float>
const time_type& bezier_base< V, T >::get_r  )  const [inline]
 

Definition at line 112 of file _bezier.h.

References bezier_base< V, T >::r.

template<typename V, typename T = float>
const time_type& bezier_base< V, T >::get_s  )  const [inline]
 

Definition at line 113 of file _bezier.h.

References bezier_base< V, T >::s.

template<typename V, typename T = float>
time_type bezier_base< V, T >::get_dt  )  const [inline]
 

Definition at line 114 of file _bezier.h.

References bezier_base< V, T >::r, and bezier_base< V, T >::s.

template<typename V, typename T = float>
bool bezier_base< V, T >::intersect_hull const bezier_base< value_type, time_type > &  x  )  const [inline]
 

Definition at line 116 of file _bezier.h.

template<typename V, typename T = float>
time_type bezier_base< V, T >::intersect const bezier_base< value_type, time_type > &  x,
time_type  near = 0.0
const [inline]
 

Bezier curve intersection function.

Calculates the time of intersection for the calling curve.

I still have not figured out a good generic method of doing this for a bi-infinite cubic bezier curve calculated with the DeCasteljau algorithm.

One method, although it does not work for the entire bi-infinite curve, is to iteratively intersect the hulls. However, we would only detect intersections that occur between R and S.

It is entirely possible that a new construct similar to the affine combination function will be necessary for this to work properly.

For now, this function is BROKEN. (although it works for the floating-point specializations, using newton's method)

Definition at line 142 of file _bezier.h.

template<typename V, typename T = float>
value_type& bezier_base< V, T >::operator[] int  i  )  [inline]
 

Definition at line 193 of file _bezier.h.

References bezier_base< V, T >::a.

Referenced by hermite< V, T >::sync().

template<typename V, typename T = float>
const value_type& bezier_base< V, T >::operator[] int  i  )  const [inline]
 

Definition at line 197 of file _bezier.h.

References bezier_base< V, T >::a.


Member Data Documentation

template<typename V, typename T = float>
value_type bezier_base< V, T >::a [private]
 

Definition at line 56 of file _bezier.h.

Referenced by bezier_base< V, T >::operator()(), bezier_base< double, float >::operator[](), bezier_base< float, float >::operator[](), bezier_base< V, T >::operator[](), bezier_base< double, float >::sync(), and bezier_base< float, float >::sync().

template<typename V, typename T = float>
value_type bezier_base< V, T >::b [private]
 

Definition at line 56 of file _bezier.h.

Referenced by bezier_base< V, T >::operator()(), bezier_base< double, float >::sync(), and bezier_base< float, float >::sync().

template<typename V, typename T = float>
value_type bezier_base< V, T >::c [private]
 

Definition at line 56 of file _bezier.h.

Referenced by bezier_base< V, T >::operator()(), bezier_base< double, float >::sync(), and bezier_base< float, float >::sync().

template<typename V, typename T = float>
value_type bezier_base< V, T >::d [private]
 

Definition at line 56 of file _bezier.h.

Referenced by bezier_base< V, T >::operator()(), bezier_base< double, float >::sync(), and bezier_base< float, float >::sync().

template<typename V, typename T = float>
time_type bezier_base< V, T >::r [private]
 

Definition at line 57 of file _bezier.h.

Referenced by bezier< V, T >::find_closest(), bezier_base< double, float >::get_dt(), bezier_base< float, float >::get_dt(), bezier_base< V, T >::get_dt(), bezier_base< double, float >::get_r(), bezier_base< float, float >::get_r(), bezier_base< V, T >::get_r(), bezier_base< double, float >::intersect(), bezier_base< float, float >::intersect(), bezier_base< double, float >::operator()(), bezier_base< float, float >::operator()(), bezier_base< V, T >::operator()(), bezier_base< double, float >::set_r(), bezier_base< float, float >::set_r(), bezier_base< V, T >::set_r(), bezier_base< double, float >::set_rs(), bezier_base< float, float >::set_rs(), bezier_base< V, T >::set_rs(), bezier_base< double, float >::set_s(), and bezier_base< float, float >::set_s().

template<typename V, typename T = float>
time_type bezier_base< V, T >::s [private]
 

Definition at line 57 of file _bezier.h.

Referenced by bezier< V, T >::find_closest(), bezier_base< double, float >::get_dt(), bezier_base< float, float >::get_dt(), bezier_base< V, T >::get_dt(), bezier_base< double, float >::get_s(), bezier_base< float, float >::get_s(), bezier_base< V, T >::get_s(), bezier_base< double, float >::intersect(), bezier_base< float, float >::intersect(), bezier_base< V, T >::operator()(), bezier_base< double, float >::set_r(), bezier_base< float, float >::set_r(), bezier_base< double, float >::set_rs(), bezier_base< float, float >::set_rs(), bezier_base< V, T >::set_rs(), bezier_base< double, float >::set_s(), bezier_base< float, float >::set_s(), and bezier_base< V, T >::set_s().

template<typename V, typename T = float>
affine_combo<value_type,time_type> bezier_base< V, T >::affine_func [protected]
 

Definition at line 60 of file _bezier.h.

Referenced by bezier_base< V, T >::operator()().


The documentation for this class was generated from the following file:
Generated on Thu Jan 12 03:51:42 2006 for ETL by  doxygen 1.4.6