mathglpp::CubicBezierCurve4< T > Class Template Reference

#include <CubicBezierCurve.h>

Collaboration diagram for mathglpp::CubicBezierCurve4< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T>
class mathglpp::CubicBezierCurve4< T >

A specialisation for the Berstein Polynomials to ease the use of cubic interpolation.

Author:
Jacques Gasselin

Definition at line 36 of file CubicBezierCurve.h.

Public Types

enum  { D = 4 }
enum  { D = 4 }
typedef T value_type
typedef GLMatrix< value_typematrix_type
typedef T value_type
typedef GLMatrix< value_typematrix_type

Public Member Functions

 CubicBezierCurve4 (const value_type *cpoints)
 Create and premultiply a basis matrix for later interpolation, cpoints must not be NULL!!!!
 CubicBezierCurve4 (const value_type *c0, const value_type *c1, const value_type *c2, const value_type *c3)
 Create and premultiply a basis matrix for later interpolation.
 CubicBezierCurve4 (const CubicBezierCurve4 &bc)
 ~CubicBezierCurve4 ()
 Destroy the basis matrix.
void interpolate (GLclampf interp, value_type *vertex) const
 interface for vertex generation, interp : [0,1]
 CubicBezierCurve4 (const value_type *cpoints)
 Create and premultiply a basis matrix for later interpolation, cpoints must not be NULL!!!!
 CubicBezierCurve4 (const value_type *c0, const value_type *c1, const value_type *c2, const value_type *c3)
 Create and premultiply a basis matrix for later interpolation.
 CubicBezierCurve4 (const CubicBezierCurve4 &bc)
 ~CubicBezierCurve4 ()
 Destroy the basis matrix.
void interpolate (GLclampf interp, value_type *vertex) const
 interface for vertex generation, interp : [0,1]


Member Enumeration Documentation

template<typename T>
anonymous enum

Enumerator:
D 

Definition at line 39 of file CubicBezierCurve.h.

00039 { D = 4 };

template<typename T>
anonymous enum

Enumerator:
D 

Definition at line 39 of file GLCubicBezierCurve.h.

00039 { D = 4 };


Constructor & Destructor Documentation

template<typename T>
mathglpp::CubicBezierCurve4< T >::CubicBezierCurve4 ( const value_type cpoints  )  [inline]

Create and premultiply a basis matrix for later interpolation, cpoints must not be NULL!!!!

Column major so it seems like it is transposed

Pre multiply

Definition at line 44 of file CubicBezierCurve.h.

References mathglpp::CubicBezierCurve4< T >::D.

00045     :basis(cpoints)
00046     {
00048         static value_type coeffs[D*D] =
00049             {  1, -0,  0, -0,
00050               -3,  3, -0,  0,
00051                3, -6,  3, -0,
00052               -1,  3, -3,  1 };
00053 
00055         basis *= GLMatrix<value_type>(coeffs);
00056     }

template<typename T>
mathglpp::CubicBezierCurve4< T >::CubicBezierCurve4 ( const value_type c0,
const value_type c1,
const value_type c2,
const value_type c3 
) [inline]

Create and premultiply a basis matrix for later interpolation.

Column major so it seems like it is transposed

Pre multiply

Definition at line 59 of file CubicBezierCurve.h.

00060     :basis(c0,c1,c2,c3)
00061     {
00063         static value_type coeffs[16] =
00064             {  1, -0,  0, -0,
00065               -3,  3, -0,  0,
00066                3, -6,  3, -0,
00067               -1,  3, -3,  1 };
00068 
00069 
00071         basis *= GLMatrix<value_type>(coeffs);
00072     }

template<typename T>
mathglpp::CubicBezierCurve4< T >::~CubicBezierCurve4 (  )  [inline]

Destroy the basis matrix.

Definition at line 78 of file CubicBezierCurve.h.

00078 {}

template<typename T>
mathglpp::CubicBezierCurve4< T >::CubicBezierCurve4 ( const value_type cpoints  )  [inline]

Create and premultiply a basis matrix for later interpolation, cpoints must not be NULL!!!!

Column major so it seems like it is transposed

Pre multiply

Definition at line 44 of file GLCubicBezierCurve.h.

References mathglpp::CubicBezierCurve4< T >::D.

00045     :basis(cpoints)
00046     {
00048         static value_type coeffs[D*D] =
00049             {  1, -0,  0, -0,
00050               -3,  3, -0,  0,
00051                3, -6,  3, -0,
00052               -1,  3, -3,  1 };
00053 
00055         basis *= GLMatrix<value_type>(coeffs);
00056     }

template<typename T>
mathglpp::CubicBezierCurve4< T >::CubicBezierCurve4 ( const value_type c0,
const value_type c1,
const value_type c2,
const value_type c3 
) [inline]

Create and premultiply a basis matrix for later interpolation.

Column major so it seems like it is transposed

Pre multiply

Definition at line 59 of file GLCubicBezierCurve.h.

00060     :basis(c0,c1,c2,c3)
00061     {
00063         static value_type coeffs[16] =
00064             {  1, -0,  0, -0,
00065               -3,  3, -0,  0,
00066                3, -6,  3, -0,
00067               -1,  3, -3,  1 };
00068 
00069 
00071         basis *= GLMatrix<value_type>(coeffs);
00072     }

template<typename T>
mathglpp::CubicBezierCurve4< T >::~CubicBezierCurve4 (  )  [inline]

Destroy the basis matrix.

Definition at line 78 of file GLCubicBezierCurve.h.

00078 {}


Member Function Documentation

template<typename T>
void mathglpp::CubicBezierCurve4< T >::interpolate ( GLclampf  interp,
value_type vertex 
) const [inline]

interface for vertex generation, interp : [0,1]

Definition at line 81 of file CubicBezierCurve.h.

References mathglpp::GLMatrix< T >::vdot4().

00082     {
00083         vertex[0] = 1;
00084         vertex[1] = value_type(interp);
00085         vertex[2] = value_type(interp * interp);
00086         vertex[3] = value_type(interp * interp * interp);
00087         basis.vdot4(vertex);
00088     }

Here is the call graph for this function:

template<typename T>
void mathglpp::CubicBezierCurve4< T >::interpolate ( GLclampf  interp,
value_type vertex 
) const [inline]

interface for vertex generation, interp : [0,1]

Definition at line 81 of file GLCubicBezierCurve.h.

References mathglpp::GLMatrix< T >::vdot4().

00082     {
00083         vertex[0] = 1;
00084         vertex[1] = value_type(interp);
00085         vertex[2] = value_type(interp * interp);
00086         vertex[3] = value_type(interp * interp * interp);
00087         basis.vdot4(vertex);
00088     }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Oct 3 12:50:51 2007 for MathGL++ by  doxygen 1.5.2