c3d-utils
UuIcsC3d::C3dFileInfo Class Reference

Class for storing data from the parameter section of a C3d file. More...

#include <uuc3d.hpp>

List of all members.

Public Member Functions

Constructors
 C3dFileInfo ()
 C3dFileInfo (std::string const &filename)
Accessors
bool is_valid () const
int frame_count () const
 The number of frames in this file.
int points_per_frame () const
std::vector< SpacePaddedStringpoint_labels () const
int analog_channels () const
 The number of analog channels.
int analog_samples_per_frame () const
std::auto_ptr< C3dFileopen () const
Mutating operations

These functions set values and are directly related to the accessor

void set_param_blocks (int c)
 used in writing a C3d file.
void set_frame_count (int)
void set_points_per_frame (int)
void set_analog_samples_per_frame (int)
void set_analog_channels (int)
void set_point_labels (std::vector< std::string > const &labels, char pad= ' ')
Access to low level interface
Content const & content () const
FileInfo1 const & fi1 () const

Detailed Description

Class for storing data from the parameter section of a C3d file.

Examples:

count_invalid.cpp.


Constructor & Destructor Documentation

UuIcsC3d::C3dFileInfo::C3dFileInfo ( )

Constructs an object where is_valid() returns false.

UuIcsC3d::C3dFileInfo::C3dFileInfo ( std::string const &  filename)

Initialises the file by reading the parameter section of the named file May throw OpenError if a the file can not be opened for reading. May throw ContentError if the content of the file is not valid.

Parameters:
[in]filenameThe name of the file to be openened.

Member Function Documentation

int UuIcsC3d::C3dFileInfo::analog_samples_per_frame ( ) const [inline]

The rate at which analog data is stored can be higher than the frame rate. E.g., analog data can be sampled at 100Hz while trajectories are sampled at 25 Hz. In that case, this function will return 4.

Content const& UuIcsC3d::C3dFileInfo::content ( ) const [inline]

Get the low level Content structure.

FileInfo1 const& UuIcsC3d::C3dFileInfo::fi1 ( ) const [inline]

Get the low level FileInfo1 structure.

bool UuIcsC3d::C3dFileInfo::is_valid ( ) const

If the parameter section was read succesfully, this will return true. Otherwise, it will return false.

std::auto_ptr<C3dFile> UuIcsC3d::C3dFileInfo::open ( ) const

Reopens the file (using the same name that was supplied at the constructor) and returns an auto_ptr to a file that can be used for reading the frame data. The destructor that will be called automatically when the auto_ptr goes out of scope will close the file.

Examples:
count_invalid.cpp.
std::vector<SpacePaddedString> UuIcsC3d::C3dFileInfo::point_labels ( ) const [inline]

The labels for the points. The number of labels need not be the same as the number of points. label[i] will be a name for point[i] if i is valid for both.

Examples:
count_invalid.cpp.
int UuIcsC3d::C3dFileInfo::points_per_frame ( ) const [inline]

The number of points in each frame. You can also view this as the number of trajectories in the file, as each trajectory will have exactly one point in each frame.

Examples:
count_invalid.cpp.
void UuIcsC3d::C3dFileInfo::set_analog_channels ( int  )

Sets the number of analog channels.

void UuIcsC3d::C3dFileInfo::set_analog_samples_per_frame ( int  )

Sets the total number of analog data per frame.

void UuIcsC3d::C3dFileInfo::set_frame_count ( int  )

Sets the number of frames.

void UuIcsC3d::C3dFileInfo::set_param_blocks ( int  c)

used in writing a C3d file.

functions with a similar name. They can be used if this object is Sets the number of 512 byte parameter blocks (and thus the data start).

void UuIcsC3d::C3dFileInfo::set_point_labels ( std::vector< std::string > const &  labels,
char  pad = ' ' 
)

Sets labels for the marker points. The number of labels need not be the same as the number of marker points. If necessary, the labels will be padded with the pad character, such that all labels have the same length.

void UuIcsC3d::C3dFileInfo::set_points_per_frame ( int  )

Sets the number of marker points.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations