EZC3D
|
#include <Header.h>
Public Member Functions | |
Header () | |
Create a valid header with minimal informations. | |
Header (c3d &c3d, std::fstream &file) | |
Read and store the header of an opened C3D file. More... | |
void | print () const |
Print the header. | |
void | write (std::fstream &f, std::streampos &dataStartPosition) const |
Write the header to an opened file. More... | |
void | read (c3d &c3d, std::fstream &file) |
Read and store a header from an opened C3D file. More... | |
size_t | nbOfZerosBeforeHeader () const |
Get the number of zeros before the header starts in the file. More... | |
size_t | parametersAddress () const |
Get the byte at which the parameters start in the file. More... | |
size_t | checksum () const |
Get the checksum of the header. More... | |
size_t | nb3dPoints () const |
Get the number 3D points. More... | |
void | nb3dPoints (size_t numberOfPoints) |
Set the number 3D points. More... | |
size_t | nbAnalogs () const |
Get the number of analogs. More... | |
void | nbAnalogs (size_t nbOfAnalogs) |
Set the number of analogs. More... | |
size_t | nbAnalogsMeasurement () const |
Get the number of recorded analogs. More... | |
size_t | nbFrames () const |
Get the number of frames. More... | |
size_t | firstFrame () const |
Get the first frame. More... | |
void | firstFrame (size_t frame) |
Set the first frame. More... | |
size_t | lastFrame () const |
Get the last frame. More... | |
void | lastFrame (size_t frame) |
Set the last frame. More... | |
size_t | nbMaxInterpGap () const |
Get the maximal gap used for interpolation. More... | |
float | scaleFactor () const |
Get the scaling factor to convert the 3D point. More... | |
size_t | dataStart () const |
Get the number of 256-byte blocks to get to the points and analogous data in the file. More... | |
size_t | nbAnalogByFrame () const |
Get the number of analog by frame. More... | |
void | nbAnalogByFrame (size_t nbOfAnalogsByFrame) |
Set the number of analog by frame. More... | |
float | frameRate () const |
Get the points frame rate in Hz. More... | |
void | frameRate (float pointFrameRate) |
Set the points frame rate in Hz. More... | |
int | emptyBlock1 () const |
Get the empty block 1. More... | |
int | emptyBlock2 () const |
Get the empty block 2. More... | |
int | emptyBlock3 () const |
Get the empty block 3. More... | |
int | emptyBlock4 () const |
Get the empty block 4. More... | |
size_t | keyLabelPresent () const |
Get the present label flag. More... | |
size_t | firstBlockKeyLabel () const |
Get the first block of key labels (if present) More... | |
size_t | fourCharPresent () const |
fourCharPresent More... | |
size_t | nbEvents () const |
Get the number of defined time events (0 to 18) More... | |
const std::vector< float > & | eventsTime () const |
Get the event times in seconds. More... | |
float | eventsTime (size_t idx) const |
Get a particular event time of index idx in seconds. More... | |
std::vector< size_t > | eventsDisplay () const |
Get the display flags. More... | |
size_t | eventsDisplay (size_t idx) const |
Get a particular display flag of index idx. More... | |
const std::vector< std::string > & | eventsLabel () const |
Get the event labels. More... | |
const std::string & | eventsLabel (size_t idx) const |
Get a particular event label of index idx. More... | |
Protected Member Functions | |
PROCESSOR_TYPE | readProcessorType (c3d &c3d, std::fstream &file) |
Reads the processor type in the parameter section, returns the file pointer where it was at the beggining of the function. More... | |
Protected Attributes | |
size_t | _nbOfZerosBeforeHeader |
size_t | _parametersAddress |
size_t | _checksum |
size_t | _nb3dPoints |
size_t | _nbAnalogsMeasurement |
size_t | _firstFrame |
size_t | _lastFrame |
size_t | _nbMaxInterpGap |
float | _scaleFactor |
size_t | _dataStart |
size_t | _nbAnalogByFrame |
float | _frameRate |
int | _emptyBlock1 |
int | _emptyBlock2 |
int | _emptyBlock3 |
int | _emptyBlock4 |
size_t | _keyLabelPresent |
size_t | _firstBlockKeyLabel |
size_t | _fourCharPresent |
size_t | _nbEvents |
std::vector< float > | _eventsTime |
std::vector< size_t > | _eventsDisplay |
std::vector< std::string > | _eventsLabel |
ezc3d::Header::Header | ( | ezc3d::c3d & | c3d, |
std::fstream & | file | ||
) |
Read and store the header of an opened C3D file.
c3d | C3D reference to copy the data in |
file | Already opened fstream file with read access |
Definition at line 40 of file Header.cpp.
size_t ezc3d::Header::checksum | ( | ) | const |
Get the checksum of the header.
The checksum of the header should be equals to 0x50 for a valid a c3d
Definition at line 241 of file Header.cpp.
size_t ezc3d::Header::dataStart | ( | ) | const |
Get the number of 256-byte blocks to get to the points and analogous data in the file.
Definition at line 312 of file Header.cpp.
int ezc3d::Header::emptyBlock1 | ( | ) | const |
int ezc3d::Header::emptyBlock2 | ( | ) | const |
int ezc3d::Header::emptyBlock3 | ( | ) | const |
int ezc3d::Header::emptyBlock4 | ( | ) | const |
std::vector< size_t > ezc3d::Header::eventsDisplay | ( | ) | const |
Get the display flags.
If it is 0x00, then it is ON. If it is 0x01, then it is OFF.
Definition at line 396 of file Header.cpp.
size_t ezc3d::Header::eventsDisplay | ( | size_t | idx | ) | const |
Get a particular display flag of index idx.
idx | The index of the event |
If it is 0x00, then it is ON. If it is 0x01, then it is OFF.
Throw a std::out_of_range exception if idx is larger than the number of events
Definition at line 401 of file Header.cpp.
const std::vector< std::string > & ezc3d::Header::eventsLabel | ( | ) | const |
const std::string & ezc3d::Header::eventsLabel | ( | size_t | idx | ) | const |
Get a particular event label of index idx.
idx | The index of the event |
Throw a std::out_of_range exception if idx is larger than the number of events
Definition at line 417 of file Header.cpp.
const std::vector< float > & ezc3d::Header::eventsTime | ( | ) | const |
Get the event times in seconds.
Definition at line 379 of file Header.cpp.
float ezc3d::Header::eventsTime | ( | size_t | idx | ) | const |
Get a particular event time of index idx in seconds.
idx | The index of the event |
Throw a std::out_of_range exception if idx is larger than the number of events
Definition at line 384 of file Header.cpp.
size_t ezc3d::Header::firstBlockKeyLabel | ( | ) | const |
Get the first block of key labels (if present)
Definition at line 364 of file Header.cpp.
size_t ezc3d::Header::firstFrame | ( | ) | const |
void ezc3d::Header::firstFrame | ( | size_t | frame | ) |
size_t ezc3d::Header::fourCharPresent | ( | ) | const |
float ezc3d::Header::frameRate | ( | ) | const |
Get the points frame rate in Hz.
Definition at line 329 of file Header.cpp.
void ezc3d::Header::frameRate | ( | float | pointFrameRate | ) |
Set the points frame rate in Hz.
pointFrameRate | The points frame rate in Hz |
Definition at line 334 of file Header.cpp.
size_t ezc3d::Header::keyLabelPresent | ( | ) | const |
Get the present label flag.
The present label flag. If it is equal to 12345, then label and range are present.
Definition at line 359 of file Header.cpp.
size_t ezc3d::Header::lastFrame | ( | ) | const |
void ezc3d::Header::lastFrame | ( | size_t | frame | ) |
size_t ezc3d::Header::nb3dPoints | ( | ) | const |
Get the number 3D points.
Definition at line 246 of file Header.cpp.
void ezc3d::Header::nb3dPoints | ( | size_t | numberOfPoints | ) |
Set the number 3D points.
numberOfPoints | The number of points |
Definition at line 251 of file Header.cpp.
size_t ezc3d::Header::nbAnalogByFrame | ( | ) | const |
Get the number of analog by frame.
Definition at line 317 of file Header.cpp.
void ezc3d::Header::nbAnalogByFrame | ( | size_t | nbOfAnalogsByFrame | ) |
Set the number of analog by frame.
nbOfAnalogsByFrame | The number of analog by frame |
Definition at line 322 of file Header.cpp.
size_t ezc3d::Header::nbAnalogs | ( | ) | const |
void ezc3d::Header::nbAnalogs | ( | size_t | nbOfAnalogs | ) |
Set the number of analogs.
nbOfAnalogs | The number of analogs |
Definition at line 264 of file Header.cpp.
size_t ezc3d::Header::nbAnalogsMeasurement | ( | ) | const |
Get the number of recorded analogs.
Definition at line 269 of file Header.cpp.
size_t ezc3d::Header::nbEvents | ( | ) | const |
Get the number of defined time events (0 to 18)
Definition at line 374 of file Header.cpp.
size_t ezc3d::Header::nbFrames | ( | ) | const |
size_t ezc3d::Header::nbMaxInterpGap | ( | ) | const |
Get the maximal gap used for interpolation.
Definition at line 302 of file Header.cpp.
size_t ezc3d::Header::nbOfZerosBeforeHeader | ( | ) | const |
Get the number of zeros before the header starts in the file.
Definition at line 209 of file Header.cpp.
size_t ezc3d::Header::parametersAddress | ( | ) | const |
Get the byte at which the parameters start in the file.
Definition at line 214 of file Header.cpp.
void ezc3d::Header::read | ( | ezc3d::c3d & | c3d, |
std::fstream & | file | ||
) |
Read and store a header from an opened C3D file.
c3d | C3D reference to copy the data in |
file | The file stream already opened with read access |
Definition at line 148 of file Header.cpp.
|
protected |
Reads the processor type in the parameter section, returns the file pointer where it was at the beggining of the function.
c3d | C3D reference to copy the data in |
file | opened file stream to be read |
Definition at line 219 of file Header.cpp.
float ezc3d::Header::scaleFactor | ( | ) | const |
Get the scaling factor to convert the 3D point.
If the points are floats, then the scaling factor is if negative. Otherwise it is a integer
Definition at line 307 of file Header.cpp.
void ezc3d::Header::write | ( | std::fstream & | f, |
std::streampos & | dataStartPosition | ||
) | const |
Write the header to an opened file.
f | Already opened fstream file with write access |
dataStartPosition | Returns the byte where to put the data start parameter |
Definition at line 94 of file Header.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |