MAAsciiFile Class Reference
[IStage]

#include <MoCapFile.h>

Inheritance diagram for MAAsciiFile:

Inheritance graph
[legend]
Collaboration diagram for MAAsciiFile:

Collaboration graph
[legend]
List of all members.

Detailed Description

Interfaces with the Motion Analisys ASCII file format (.trc).

Example
(you can use "using namespace mave;" instead of specifying "mave::" each time)
        mave::MAAsciiFile trc;
        trc.Open("Nicole.trc");
        cout << "Camera rate: " << trc.GetAttribute().Get("CameraRate") << endl;
        for (int i=0; i<trc.GetAttribute().GetInt("NumMarkers"); i++)
                cout << "Marker " << i << " label: " << trc.GetLabel(i) << endl;

        mave::pvector points;
        while(trc.GetNextFrame(points)>=0)
        {
                // print the x coordinate of the first marker
                cout << points[0].x << endl;
                // print all coordinates of the marker labeled LTOE
                cout << points[trc.GetIndex("LTOE")] << endl;
        }


Public Types

enum  MoCapFileType { type_unspecified, type_MAAscii, type_EVaRT }
enum  MoCapOptions { option_sticky = 1, option_labeled }
typedef boost::signal< Signature > default_signal_t

Public Member Functions

virtual MoCapFileType Type ()
bool Open (const char *file_name)
virtual bool Reopen ()
 Reopens the file (returns to the beginning).
bool IsOpen () const
 Returns true if the file is open.
virtual string const & GetName () const
 returns the name of the opened file
virtual void operator() ()
 Reads the next frame of data. Intended for signal_link mechanism.
virtual int GetRecentFrame (MoCapFrame &frame)
 Returns the frame information for the most recently received/read frame.
string const & GetLabel (int i) const
 returns the label of a marker
vector< string > const & GetLabels () const
 returns the vector of labels
int GetIndex (string const &label) const
 returns the index of a marker label (case sensitive)
AttributeVector const & GetAttribute () const
 returns the vector of attributes
virtual int GetMinFrame () const
 returns the minimum frame available
virtual int GetMaxFrame () const
 returns the maximum frame available
virtual int GetNumMarkers () const
 returns the number of labeled markers in model
virtual unsigned DefaultOptions ()
 Default options for the MoCapFile class are sticky=off, labeled=on.
void EnableOptions (unsigned o)
 Enables specified options.
void DisableOptions (unsigned o)
 Disables specified options.
void SetOptionsTo (unsigned o, bool on)
void SetOptions (unsigned o)
 Sets the options to the specified values.
virtual unsigned GetOptions ()
 Returns the current options for the object.
virtual bool GetOption (unsigned o)
 Returns true if all specified options are enabled.
 operator unsigned ()
const default_signal_t & default_signal () const
 Returns the default out signal.
template<typename T>
Descendant & operator>>= (T &link)
 Connects a sequence of components using signals.
template<typename T>
Descendant & operator>>= (slot_selector_t< T, Signature > link)
 Allows slot functions other than operator() to be used in a sequence of components.
template<typename T>
Descendant & operator>= (T &link)
 Allows branching in a component connection sequence.
template<typename T>
Descendant & operator>= (const slot_selector_t< T, Signature > &link)
 Allows slot functions other than operator() to be used with branching.
void disconnect_all_slots ()
 Disconnects all slots connected to the signal_link.

Static Public Member Functions

static unsigned ClassDefaultOptions ()
 Default options for the MoCapFile class are sticky=off, labeled=on.
static MoCapFileLoad (const char *file_name, MoCapFileType file_type=type_unspecified)

Protected Attributes

unsigned options
 options fine-tuning the behavior of the class
default_signal_t out


Member Function Documentation

bool Open ( const char *  file_name  )  [virtual]

Opens the file and prepares for frame reading.

Returns:
true if an error occurs

Implements MoCapFile.

virtual int GetRecentFrame ( MoCapFrame frame  )  [virtual]

Returns the frame information for the most recently received/read frame.

Returns:
the frame number of the frame (negative if an error occured).

Implements MoCapFile.

int GetIndex ( string const &  label  )  const [virtual]

returns the index of a marker label (case sensitive)

Returns:
-1 if the label is not found

Implements MoCapFile.

Descendant& operator>>= ( T &  link  )  [inline, inherited]

Connects a sequence of components using signals.

This operator is identical to signal_link::operator>= (it connects the left component to the right component, and returns a reference to the left component), except it is evaluated right to left. This makes it semantics more suitable for connecting a chain of connections.

Descendant& operator>>= ( slot_selector_t< T, Signature >  link  )  [inline, inherited]

Allows slot functions other than operator() to be used in a sequence of components.

See also:
slot_selector()

Descendant& operator>= ( T &  link  )  [inline, inherited]

Allows branching in a component connection sequence.

This operator is identical to signal_link::operator>>=, (it connects the left component to the right component, and returns a reference to the left component) except it is evaluated left to right. This makes its semantics more suitable for branching connections.

Descendant& operator>= ( const slot_selector_t< T, Signature > &  link  )  [inline, inherited]

Allows slot functions other than operator() to be used with branching.

See also:
slot_selector()


The documentation for this class was generated from the following file:
Generated on Tue Mar 6 17:57:16 2007 for AME Repository by  doxygen 1.5.1-p1