Spinning Topp Logo BlackTopp Studios
inc
Public Types | Static Public Member Functions | List of all members
Mezzanine::BezierInterpolator< T > Class Template Reference

A simple functor for interpolating data points in a simple way. More...

#include <interpolator.h>

Public Types

typedef T InterpolatableType
 The type this will interpolate. More...
 
typedef std::vector< InterpolatableTypeStorage
 The storage to use with thison tracks.
 

Static Public Member Functions

static String GetSerializableName ()
 get the name of this class for serialization purposes More...
 
template<typename TIterator >
static T Interpolate (TIterator Begin, TIterator End, Real Location)
 Get a value at a given location between two others. More...
 
static void ProtoDeSerialize (const XML::Node &OneNode)
 This does not create or change the object it deserializes, but it does verify type info. More...
 
static void ProtoSerialize (XML::Node &CurrentRoot)
 Append a node for with enough information to deserialize to the passed node. More...
 

Detailed Description

template<typename T>
class Mezzanine::BezierInterpolator< T >

A simple functor for interpolating data points in a simple way.

This interpolator provides different guarantees different from the linear one:

Definition at line 261 of file interpolator.h.

Member Typedef Documentation

template<typename T>
typedef T Mezzanine::BezierInterpolator< T >::InterpolatableType

The type this will interpolate.

Note
All Interpolators need to declare an InterpolatableType

Definition at line 266 of file interpolator.h.

Member Function Documentation

template<typename T>
static String Mezzanine::BezierInterpolator< T >::GetSerializableName ( )
inlinestatic

get the name of this class for serialization purposes

Returns
A String containing "BezierInterpolator"

Definition at line 359 of file interpolator.h.

template<typename T>
template<typename TIterator >
static T Mezzanine::BezierInterpolator< T >::Interpolate ( TIterator  Begin,
TIterator  End,
Real  Location 
)
inlinestatic

Get a value at a given location between two others.

This uses Linear interpolation recursively to produce a single curve following Bézier's curve algorithm. For example if interpolating the location 0.5 on a set of 3 data points A,B,C and therefor 2 data segments AB and BC, you can imagine this as getting the point halfway down AB and the point halfway down down BC. Then this will get return the halfway between each of those points. This produces smooth curves but could perform slowly. For more details see the wikiedia pages on Bézier curves: http://en.wikipedia.org/wiki/Bézier_curve or http://en.wikipedia.org/wiki/B%C3%A9zier_curve

Parameters
BeginAn Iterator to the begining of the range of the instances of the type to be Interpolated
EndThe end (not one past the end) of the range that Begin started.
LocationA value between 0.0 and 1.0 indicate what point on the bezier spline defined by Begin and End you want.
Returns
A Value equal or near to Begin if 0.0 is passed, equal to or near to End if 1.0 is passed equal to a point exactly in the middle if 0.5 is passed.
Warning
This is implemented as a recursive function with the only termination condition being the end iterator.

Definition at line 290 of file interpolator.h.

template<typename T>
static void Mezzanine::BezierInterpolator< T >::ProtoDeSerialize ( const XML::Node OneNode)
inlinestatic

This does not create or change the object it deserializes, but it does verify type info.

Parameters
OneNodeThe node to read serialized data from.

Definition at line 336 of file interpolator.h.

template<typename T>
static void Mezzanine::BezierInterpolator< T >::ProtoSerialize ( XML::Node CurrentRoot)
inlinestatic

Append a node for with enough information to deserialize to the passed node.

Note
Very little data is actually serialized, most of it is type information that is not easily deserialized.
Parameters
CurrentRootA node to act as the parent for the serialized version of this one.

Definition at line 309 of file interpolator.h.


The documentation for this class was generated from the following file: