A base type that provides container features for different tracks. More...
#include <track.h>
Public Types | |
typedef DataContainerType::const_iterator | ConstDataIteratorType |
A const iterator type for the elements stored and interpolated within this track. | |
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 DataContainerType::iterator | DataIteratorType |
An iterator type for the elements stored and interpolated within this track. | |
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 | |
Track (DataIteratorType Begin, DataIteratorType End) | |
Create a Track from a range of data points. More... | |
Track (const DataContainerType &DataSet) | |
Create a track from a DataContainerType instance, likely a vector and copthe data from it. More... | |
Track () | |
Create a default empty track. | |
virtual | ~Track () |
Virtual Deconstructor. | |
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 String | DerivedSerializableName () const |
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 |
Get a value from somewhere on the track with 0.0 being the beginning and 1.0 being the end. More... | |
virtual InterpolatableType | GetInterpolated (size_t Index, Real Percentage) const |
Get a value between two points on the track with 0.0 being a specified datapoint and 1.0 being the next datapoint. More... | |
String | GetTrackName () const |
Get the given name or generate a default name. More... | |
const String & | GetTrackName () |
This is just like the const version of the function but it will set the name if unset and retrieve it. More... | |
virtual void | ProtoDeSerialize (const XML::Node &OneNode) |
Convert a node on an XML into a track. More... | |
virtual void | ProtoSerialize (XML::Node &CurrentRoot) const |
Convert this to a node on an XML graph. More... | |
virtual void | push_back (const InterpolatableType &AddedValue) |
Add another data point to the end of the track. More... | |
void | SetTrackName (String Name) |
Set the name for serialization. More... | |
String | SetTrackNameUnique (String Name="") |
Set the name to something that serialization definitely will not duplicate. More... | |
size_t | size () const |
Get the amount of stored DataPoints. More... | |
size_t | Size () const |
Get the amount of stored DataPoints. More... | |
Static Public Member Functions | |
static String | GetSerializableName () |
Get the name of this class "Track". More... | |
Protected Attributes | |
DataContainerType | DataPoints |
The underlying container of Discrete datapoints. | |
String | RawName |
Name of the track, primarily for serialization. | |
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::Track< 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:
|
inline |
|
inline |
|
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 |
get the classnae at runtime
Reimplemented in Mezzanine::TrackLooped< InterpolatorType >.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Get a value from somewhere on the track with 0.0 being the beginning and 1.0 being the end.
Percentage | A Value between 0 and 1 that the interpolator will use to pick a point on or between the datapoints. |
|
inlinevirtual |
Get a value between two points on the track with 0.0 being a specified datapoint and 1.0 being the next datapoint.
Index | The Nth datapoint which will define the start of the range to interpolate. Max allowed value is: size - 2. |
Percentage | A Value between 0 and 1 that the interpolator will use to pick a point on or between the datapoints. |
|
inlinestatic |
|
inline |
Get the given name or generate a default name.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
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 |
Set the name to something that serialization definitely will not duplicate.
Because serialization of racks must have a name unique numbers are assigned when a nameisnot present. This function will set the name either to the pased value if serialzation will never touch it, or to some value that serialization cannot clobber.
Name | The name you would like if it is compatible. |
|
inline |
|
inline |