A base type that provides container features for different tracks. More...
#include <track.h>
Public Types | |
typedef InterpolatorType::Storage | DataContainerType |
The type of the internal container storing the interpolatable data. This is a single point to change all the tracks. More... | |
typedef InterpolatorType::InterpolatableType | InterpolatableType |
The type this class and the interpolator it uses works with. | |
typedef SmoothTrackIterator < InterpolatorType > | SmoothIteratorType |
An iterator than can take an arbitrary amount of steps by interpolation. | |
Public Member Functions | |
TrackBase (typename DataContainerType::iterator Begin, typename DataContainerType::iterator End) | |
TrackBase (const DataContainerType &DataSet) | |
virtual void | Add (const InterpolatableType &AddedValue) |
Add another data point to the end of the track. More... | |
virtual SmoothIteratorType | begin (Integer Steps=100) const |
Get an Smooth iterator to the beginning of the track. More... | |
virtual SmoothIteratorType | Begin (Integer Steps=100) const |
Get an Smooth iterator to the beginning of the track. More... | |
void | clear () |
Remove all the points from the track. | |
void | Clear () |
Remove all the points from the track. More... | |
virtual SmoothIteratorType | end (Integer Steps=0) const |
Get an Smooth iterator to the end (not one past) of the track. More... | |
virtual SmoothIteratorType | End (Integer Steps=0) const |
Get an Smooth iterator to the end (not one past) of the track. More... | |
virtual InterpolatableType | GetInterpolated (Real Percentage) const =0 |
Get a value between the beginning and the end. More... | |
virtual void | push_back (const InterpolatableType &AddedValue) |
Add another data point to the end of the track. More... | |
size_t | size () const |
Get the amount of stored DataPoints. More... | |
size_t | Size () const |
Get the amount of stored DataPoints. More... | |
Protected Attributes | |
DataContainerType | DataPoints |
The underlying container of Discrete datapoints. | |
A base type that provides container features for different tracks.
Tracks are containers of a Discrete set of points, that are presented as a continuous range from 0 to 1. Interpolators are used to generate the data between the points as it is needed. For example, lets say there is an interpolator provided for integers and a track contains only two data points 0 and 100, requesting 0.5 might return 50.
This uses std::vector underneath for its performance characteristics.
typedef InterpolatorType::Storage Mezzanine::TrackBase< InterpolatorType >::DataContainerType |
The type of the internal container storing the interpolatable data. This is a single point to change all the tracks.
If an interpolator requires a special container this can be re-implemented to have the TrackBase use that instead. The type must implement at least:
|
inlinevirtual |
Add another data point to the end of the track.
AddedValue | The data point to add to theend of the track. |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
pure virtual |
Get a value between the beginning and the end.
in derived classes this will perform some simple(hopefully fast) calculation to get interpolated value between the beginning and the end fo the track. Depending on algorithm this may or may not respect the nodes.
Percentage | A value from 0 to 1 indicating when between the beginning and end the point should be. |
Implemented in Mezzanine::Track< InterpolatorType >.
|
inlinevirtual |
Add another data point to the end of the track.
AddedValue | The data point to add to theend of the track. |
Reimplemented in Mezzanine::TrackLooped< InterpolatorType >.
|
inline |
|
inline |