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

A track that keeps an extra data point in the track to make sure it loops. More...

#include <track.h>

+ Inheritance diagram for Mezzanine::TrackLooped< InterpolatorType >:
+ Collaboration diagram for Mezzanine::TrackLooped< InterpolatorType >:

Public Types

typedef std::vector< InterpolatableTypeDataContainerType
 The type of the Container storing the interpolatable data. This is a single point to change all the tracks.
 
typedef DataContainerType::iterator DataIteratorType
 The iterator type for the interpolated data stored in this track.
 
typedef InterpolatorType::InterpolatableType InterpolatableType
 The type this class and the interpolator it uses works with.
 
typedef SmoothTrackIterator< InterpolatableTypeSmoothIteratorType
 An iterator than can take an arbitrary amount of steps by interpolation.
 
- Public Types inherited from Mezzanine::Track< InterpolatorType >
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

 TrackLooped (DataIteratorType Begin, DataIteratorType End)
 Create a Track from a range of data points, and enforce its being a loop. More...
 
 TrackLooped (const DataContainerType &DataSet)
 Create a track from a DataContainerType instance, likely a vector and copy the data from it, and enforce it being a loop. More...
 
 TrackLooped ()
 Create a default empty looped track.
 
virtual ~TrackLooped ()
 Virtual Deconstructor.
 
virtual String DerivedSerializableName () const
 
void EnforceLoop ()
 If this track has more than one datapoint, does the first match the last, if not fix it.
 
virtual void push_back (const InterpolatableType &AddedValue)
 Add another data point, and preserve the track's loopwhile doing so. More...
 
- Public Member Functions inherited from Mezzanine::Track< InterpolatorType >
 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 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 StringGetTrackName ()
 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...
 
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 "TrackLooped". More...
 
- Static Public Member Functions inherited from Mezzanine::Track< InterpolatorType >
static String GetSerializableName ()
 Get the name of this class "Track". More...
 

Protected Types

typedef Track< InterpolatorType > BaseType
 The base most class of this type.
 

Additional Inherited Members

- Protected Attributes inherited from Mezzanine::Track< InterpolatorType >
DataContainerType DataPoints
 The underlying container of Discrete datapoints.
 
String RawName
 Name of the track, primarily for serialization.
 

Detailed Description

template<typename InterpolatorType>
class Mezzanine::TrackLooped< InterpolatorType >

A track that keeps an extra data point in the track to make sure it loops.

when Add or push_back is called and there are 2 or more points the track, this seamlessly adds a copy of the first data point to the end of the track. When Iterating with a Smooth iterator this creates the impression of a loop inside the simulation.

Definition at line 357 of file track.h.

Constructor & Destructor Documentation

template<typename InterpolatorType>
Mezzanine::TrackLooped< InterpolatorType >::TrackLooped ( DataIteratorType  Begin,
DataIteratorType  End 
)
inline

Create a Track from a range of data points, and enforce its being a loop.

Parameters
BeginAn iterator pointing to the beginning of a range to copy.
Endan iterator pointing to one past the rang to copy.

Definition at line 376 of file track.h.

template<typename InterpolatorType>
Mezzanine::TrackLooped< InterpolatorType >::TrackLooped ( const DataContainerType DataSet)
inline

Create a track from a DataContainerType instance, likely a vector and copy the data from it, and enforce it being a loop.

Parameters
DataSetA collection of data points to copy.

if the last item does not match the first this fixes that.

Definition at line 383 of file track.h.

Member Function Documentation

template<typename InterpolatorType>
virtual String Mezzanine::TrackLooped< InterpolatorType >::DerivedSerializableName ( ) const
inlinevirtual

get the classnae at runtime

Returns
A String Containing a class name,likely"Track" or "TrackLooped"

Reimplemented from Mezzanine::Track< InterpolatorType >.

Definition at line 418 of file track.h.

template<typename InterpolatorType>
static String Mezzanine::TrackLooped< InterpolatorType >::GetSerializableName ( )
inlinestatic

Get the name of this class "TrackLooped".

Returns
A string containing "TrackLooped"

Definition at line 423 of file track.h.

template<typename InterpolatorType>
virtual void Mezzanine::TrackLooped< InterpolatorType >::push_back ( const InterpolatableType AddedValue)
inlinevirtual

Add another data point, and preserve the track's loopwhile doing so.

Parameters
AddedValueThe data point to add.

Reimplemented from Mezzanine::Track< InterpolatorType >.

Definition at line 402 of file track.h.


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