JK2eA
 All Classes Functions Variables
Classes | Public Member Functions | Protected Attributes
CCurveGraph< T > Class Template Reference

#include <CurveGraph.h>

Inheritance diagram for CCurveGraph< T >:
Inheritance graph
[legend]

List of all members.

Classes

struct  GRAPH_NODE

Public Member Functions

 CCurveGraph ()
virtual ~CCurveGraph ()
T * GetValue (const size_t index)
float * GetTime (const size_t index)
virtual size_t AddNode (const float t, const T &value)
size_t AddNode (const size_t index, const float t, const T &value)
void DelNode (const size_t index)
void Clear ()
size_t GetNodeCount () const
virtual T Interpolate (float time)
void Load (FileManager *f)
void Save (FileManager *f)
bool IsEnd (const float t)
float GetTotalTime ()

Protected Attributes

std::vector< GRAPH_NODEm_nodes
 seznam nod grafu
size_t m_currIndex

Detailed Description

template<class T>
class CCurveGraph< T >

Base class pro "grafy".
Narozdil od CurvePath je CurveGraph urcen tak, ze t urcuje "cas" kdy se ma "castice"
pohybujici se po grafu nachazet v uzlovem bodu.

Nody jsou serazene podle casu.


Constructor & Destructor Documentation

template<class T >
CCurveGraph< T >::CCurveGraph ( )

Konstruktor

template<class T >
CCurveGraph< T >::~CCurveGraph ( ) [virtual]

Destruktor


Member Function Documentation

template<class T>
size_t CCurveGraph< T >::AddNode ( const float  t,
const T &  value 
) [virtual]

Vlozi node na misto v seznamu, ktere odpovida zadanemu casu => razeni nod podle casu.

Parameters:
tcas nody
valuehodnota nody
Returns:
index, na ktery byla noda vlozena (vlozena je vzdy, zadny error code)

Node se vlozi na spravne misto podle zadaneho t v node

Reimplemented in CCurveGraphBezier3< T >.

template<class T>
size_t CCurveGraph< T >::AddNode ( const size_t  index,
const float  t,
const T &  value 
)

Node se vlozi na index (slouzi k primemu vkladani)

Parameters:
tcas nody
valuehodnota nody
indexindex kam se ma noda vlozit
Returns:
index na ktery byla noda vlozena (je to parametr index)

Node se vlozi na index (slouzi k primemu vkladani)

template<class T >
void CCurveGraph< T >::Clear ( )

Znici vsechny nody

Znici vsechny nody, zustanou pouze default

template<class T >
void CCurveGraph< T >::DelNode ( const size_t  index)

Odebere node na urcene pozici

Parameters:
indexindex node k odebrani

Odebere node na urcene pozici

template<class T >
size_t CCurveGraph< T >::GetNodeCount ( ) const

Ziskani poctu node

Returns:
pocet node
template<class T >
float * CCurveGraph< T >::GetTime ( const size_t  index)

Ziskani casu node (i pro primou zmenu)

Parameters:
indexindex node, od ktere chceme dostat cas
Returns:
ukazatel na cas, pokud je zadane id mimo rozsah tak NULL
template<class T>
float CCurveGraph< T >::GetTotalTime ( ) [inline]

Ziskani celkoveho casu grafu (= cas posledni node)

Returns:
celkovy cas
template<class T >
T * CCurveGraph< T >::GetValue ( const size_t  index)

Ziskani hodnoty node (i pro primou zmenu)

Parameters:
indexindex node, od ktere chceme dostat hodnotu
Returns:
ukazatel na hodnotu, pokud je zadane id mimo rozsah tak NULL

Vraci hodnotu, cas na pozici, pokud je mimo rozsah vraci NULL

template<class T>
virtual T CCurveGraph< T >::Interpolate ( float  time) [virtual]

Interpolace zadanym grafem

Parameters:
timeaktualni cas pro ktery chceme ziskat bod
Returns:
bod ktery odpovida zadanemu casu

Reimplemented in CCurveGraphCatmullRom< T >, CCurveGraphLinear< T >, CCurveGraphPolynom< T >, CCurveGraphLinear< vec >, CCurveGraphBezier3< T >, and CCurveGraphSlerp.

template<class T>
bool CCurveGraph< T >::IsEnd ( const float  t) [inline]

Zjisteni zda je cas mimo rozsah grafu

Parameters:
tcas pro, ktery chceme zjistit
Returns:
true pokud je t mimo rozsah grafu
template<class T >
void CCurveGraph< T >::Load ( FileManager *  f)

Nacte graph - byte snapshot

Parameters:
ffile mananager nastaven jako READ

Nacte graph

template<class T >
void CCurveGraph< T >::Save ( FileManager *  f)

Ulozi graf - byte snapshot

Parameters:
ffile mananager nastaven jako WRITE

Ulozi graf


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