Mt2dTrackData Class Reference

#include <lib_motiontracker.h>

Detailed Description

Provides access to 2D Tracking data.

Allows specific tracks to be retrieved based on name, index or unique ID.

Public Member Functions

Int32 GetTrackCount () const
 
Mt2dTrackGetTrackByIndex (Int32 idx) const
 
Mt2dTrackGetTrackByGid (const MtTrkGid *sdkTrkGid) const
 
BaseSelectGetTrackIndices (Bool userTracks=true, Bool autoTracks=false) const
 
Mt2dTrackGetTrackByName (const String &name) const
 

Static Public Member Functions

static Mt2dTrackDataAlloc ()
 
static void Free (Mt2dTrackData *&p)
 

Private Member Functions

 Mt2dTrackData ()
 
 ~Mt2dTrackData ()
 

Constructor & Destructor Documentation

◆ Mt2dTrackData()

Mt2dTrackData ( )
private

◆ ~Mt2dTrackData()

~Mt2dTrackData ( )
private

Member Function Documentation

◆ Alloc()

static Mt2dTrackData* Alloc ( )
static

Internal.

◆ Free()

static void Free ( Mt2dTrackData *&  p)
static

Destructs Mt2dTrackDatas allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]pThe Mt2dTrackData to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetTrackCount()

Int32 GetTrackCount ( ) const

Queries the number of 2D tracks.

Returns
The number of tracks.

◆ GetTrackByIndex()

Mt2dTrack* GetTrackByIndex ( Int32  idx) const

Retrieves a track by index.

Note
Caller is responsible for calling Free() on the returned track when it is no longer needed.
Parameters
[in]idxThe index of desired track: 0 <= idx < GetTrackCount().
Returns
A copy of the track, or nullptr. The caller owns the pointed Mt2dTrack.

◆ GetTrackByGid()

Mt2dTrack* GetTrackByGid ( const MtTrkGid sdkTrkGid) const

Retrieves a track by global identifier.

Warning
Caller is responsible for calling Free() on the returned track when it is no longer needed.
Parameters
[in]sdkTrkGidThe global ID of the desired track. The caller owns the pointed MtTrkGid.
Returns
A copy of the track, or nullptr. The caller owns the pointed Mt2dTrack.

◆ GetTrackIndices()

BaseSelect* GetTrackIndices ( Bool  userTracks = true,
Bool  autoTracks = false 
) const

Retrieves a BaseSelect containing the valid indices for the tracks.

Warning
Caller is responsible for calling Free() on the returned track when it is no longer needed.
Note
If userTracks is true and autoTracks is true then the function returns all indices from 0 to GetTrackCount() - 1.
Parameters
[in]userTrackstrue to include user created tracks, otherwise false.
[in]autoTrackstrue to include automatic tracks, otherwise false.
Returns
A copy of the track, or nullptr. The caller owns the pointed Mt2dTrack.

◆ GetTrackByName()

Mt2dTrack* GetTrackByName ( const String name) const

Retrieves a track by name.

Warning
Caller is responsible for calling Free() on the returned track when it is no longer needed.
Note
The function returns the first track matching name.
Parameters
[in]nameThe name of wanted track.
Returns
A copy of the track, or nullptr. The caller owns the pointed Mt2dTrack.