BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Friends
btk::Event Class Reference

Label a specific time/frame during an acquisition. More...

#include <btkEvent.h>

Inheritance diagram for btk::Event:
Inheritance graph
[legend]

Public Types

typedef btkSharedPtr< const EventConstPointer
 
enum  DetectionFlag { Unknown = 0x00, Manual = 0x02, Automatic = 0x04, FromForcePlatform = 0x08 }
 
typedef btkNullPtr< EventNullPointer
 
typedef btkSharedPtr< EventPointer
 
- Public Types inherited from btk::DataObjectLabeled
typedef btkSharedPtr< const
DataObjectLabeled
ConstPointer
 
typedef btkSharedPtr
< DataObjectLabeled
Pointer
 
- Public Types inherited from btk::DataObject
typedef btkSharedPtr< const
DataObject
ConstPointer
 
typedef btkNullPtr< DataObjectNullPointer
 
typedef btkSharedPtr< DataObjectPointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

Pointer Clone () const
 
const std::string & GetContext () const
 
int GetDetectionFlags () const
 
int GetFrame () const
 
int GetId () const
 
const std::string & GetSubject () const
 
double GetTime () const
 
bool HasDetectionFlag (DetectionFlag flag)
 
void SetContext (const std::string &context)
 
void SetDetectionFlags (int flags)
 
void SetFrame (int f)
 
void SetId (int id)
 
void SetSubject (const std::string &subject)
 
void SetTime (double t)
 
- Public Member Functions inherited from btk::DataObjectLabeled
const std::string & GetDescription () const
 
const std::string & GetLabel () const
 
virtual void SetDescription (const std::string &description)
 
virtual void SetLabel (const std::string &label)
 
- Public Member Functions inherited from btk::DataObject
DataObjectGetParent () const
 
bool HasParent () const
 
void Modified ()
 
void SetParent (DataObject *parent)
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New ()
 
static Pointer New (const std::string &label, double t, const std::string &context="", int detectionFlags=Unknown, const std::string &subject="", const std::string &desc="", int id=0)
 
static Pointer New (const std::string &label, int f, const std::string &context="", int detectionFlags=Unknown, const std::string &subject="", const std::string &desc="", int id=0)
 
static Pointer New (const std::string &label, double t, int f, const std::string &context="", int detectionFlags=Unknown, const std::string &subject="", const std::string &desc="", int id=0)
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Friends

bool operator!= (const Event &rLHS, const Event &rRHS)
 
bool operator== (const Event &rLHS, const Event &rRHS)
 

Additional Inherited Members

- Protected Member Functions inherited from btk::DataObjectLabeled
 DataObjectLabeled (const std::string &label="", const std::string &description="")
 
 DataObjectLabeled (const DataObjectLabeled &toCopy)
 
- Protected Member Functions inherited from btk::DataObject
 DataObject ()
 
 DataObject (const DataObject &toCopy)
 
virtual ~DataObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 
- Protected Attributes inherited from btk::DataObjectLabeled
std::string m_Description
 
std::string m_Label
 
- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Label a specific time/frame during an acquisition.

An event is defined as:

The ID is not used as a unique identifier but more to determine the type of the event. Even if there is no rule for the id value, these 3 next values are used in Vicon Workstation and Nexus to distinguish events' type:

For example, a heel strike event on the left leg or the subject John Doe at frame 143 can be set by

* btk::Event::Pointer evt = btk::Event::New('FootStrike', 143, 'Left', btk.btkEvent.Manual, 'John Doe', 'Heel strike event', 2)";
*

Member Typedef Documentation

Smart pointer associated with a const Event object.

Special null pointer associated with a Event object. This type should be used only internally to test the nullity of a smart pointer. See the static method Null() instead.

Smart pointer associated with an Event object.

Member Enumeration Documentation

Enums used to determine the method(s) used to detect the event.

Enumerator
Unknown 

Unknown method.

Manual 

Manual method.

Automatic 

Automatic method.

FromForcePlatform 

Method based on force platform data.

Member Function Documentation

Pointer btk::Event::Clone ( ) const
inline

Clones the object and return it as new smart pointer.

const std::string & btk::Event::GetContext ( ) const
inline

Returns event's context.

int btk::Event::GetDetectionFlags ( ) const
inline

Returns the method(s) which generate the event.

int btk::Event::GetFrame ( ) const
inline

Returns event's frame index.

int btk::Event::GetId ( ) const
inline

Returns the event's ID. Can be used by software (as Vicon Workstation) to indicate event (independently of the label).

const std::string & btk::Event::GetSubject ( ) const
inline

Returns the subject associated with the event.

double btk::Event::GetTime ( ) const
inline

Returns event's time.

bool btk::Event::HasDetectionFlag ( DetectionFlag  flag)

Checks if the given detection flag is contained in the event.

Pointer btk::Event::New ( )
inlinestatic

Creates a smart pointer associated with an Event object.

Pointer btk::Event::New ( const std::string &  label,
double  t,
const std::string &  context = "",
int  detectionFlags = Unknown,
const std::string &  subject = "",
const std::string &  desc = "",
int  id = 0 
)
inlinestatic

Creates a smart pointer associated with an Event object.

Pointer btk::Event::New ( const std::string &  label,
int  f,
const std::string &  context = "",
int  detectionFlags = Unknown,
const std::string &  subject = "",
const std::string &  desc = "",
int  id = 0 
)
inlinestatic

Creates a smart pointer associated with an Event object.

Pointer btk::Event::New ( const std::string &  label,
double  t,
int  f,
const std::string &  context = "",
int  detectionFlags = Unknown,
const std::string &  subject = "",
const std::string &  desc = "",
int  id = 0 
)
inlinestatic

Creates a smart pointer associated with an Event object.

static NullPointer btk::Event::Null ( )
inlinestatic

Static function to return a null pointer.

Note
This static method should be used only to test if a shared ponter is null or not. It is advised to call the method without parenthesis as special (in)equality operator are implemented to use a function pointer. See the description of the class NullPtr for an example.
void btk::Event::SetContext ( const std::string &  context)

Sets event's context.

void btk::Event::SetDetectionFlags ( int  flags)

Sets the event's detection. Use the enumeration Event::DetectionFlag to set the method(s) of detection.

void btk::Event::SetFrame ( int  f)

Sets event's frame index.

void btk::Event::SetId ( int  id)

Sets the event's ID.

void btk::Event::SetSubject ( const std::string &  subject)

Sets the subject associated with the event.

void btk::Event::SetTime ( double  t)

Sets event's time.

Friends And Related Function Documentation

bool operator!= ( const Event rLHS,
const Event rRHS 
)
friend

Inequality operator.

bool operator== ( const Event rLHS,
const Event rRHS 
)
friend

Equality operator.