EVaRT Class Reference
[IStage]

#include <MoCap_EVaRT.h>

Inheritance diagram for EVaRT:

Inheritance graph
[legend]
Collaboration diagram for EVaRT:

Collaboration graph
[legend]
List of all members.

Detailed Description

Connects to the EVaRT real-time MoCap data stream.

Example
class EVaRT_client : public boost::signals::trackable
{
public:
        void operator()(const MoCapFrame &mocap)
        {
                cout << "Frame of data with " << mocap.frame.size() << " labeled markers received!" << endl;
                for (pvector::const_iterator it=mocap.frame.begin(); it!=mocap.frame.end(); it++)
                        cout << "Marker " << it - mocap.frame.begin() << " is at position " << *it << endl;
        }
};

int main()
{
        EVaRT evart;
        EVaRT_client client;

        evart >>= client; // client will receive the data at every frame
        evart.Open("129.219.202.15");
        
        // we can also ask for a frame of information;
        MoCapFrame mocap;
        evart.GetRecentFrame(mocap);
        cout << "Got frame of data with " << mocap.frame.size() << " labeled markers!" << endl;
        for (pvector::iterator it=mocap.frame.begin(); it!=mocap.frame.end(); it++)
                        cout << "Marker " << it - mocap.frame.begin() << " is at position " << *it << endl;

        for (;;) {} // loop forever so the client keeps getting the data.
}
See also:
MoCapFrame for a description of the frame information structure.


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 void operator() ()
 Reads the next frame of data. Intended for signal_link mechanism.
virtual MoCapFileType Type ()
virtual bool Open (const char *file_name)
virtual bool Reopen ()
 Reopens the file (returns to the beginning).
virtual bool IsOpen () const
 Returns true if the file is open.
virtual string const & GetName () const
 returns the name of the opened file
virtual int GetRecentFrame (MoCapFrame &frame)
 Returns the frame information for the most recently received/read frame.
virtual int GetNumMarkers () const
 returns the number of labeled markers in model
virtual string const & GetLabel (int i) const
 returns the label of a marker
virtual vector< string > const & GetLabels () const
 returns the vector of labels
virtual int GetIndex (string const &lab) const
 returns the index of a marker label (case sensitive)
virtual int GetMinFrame () const
 returns the minimum frame available
virtual int GetMaxFrame () const
 returns the maximum frame available
void WaitForData ()
 Waits for a new frame to be received by the MoCap system.
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

virtual 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.

virtual int GetIndex ( string const &  lab  )  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