EZC3D
Header.h
Go to the documentation of this file.
1 #ifndef HEADER_H
2 #define HEADER_H
3 
11 #include <ezc3d.h>
12 
16 class EZC3D_API ezc3d::Header{
17  //---- CONSTRUCTORS ----//
18 public:
22  Header();
23 
29  Header(c3d &c3d,
30  std::fstream &file);
31 
32 
33  //---- STREAM ----//
34 public:
38  void print() const;
39 
45  void write(std::fstream &f, std::streampos &dataStartPosition) const;
46 
52  void read(c3d &c3d,
53  std::fstream &file);
54 
55 
56  //---- HEADER ----//
57 protected:
59 
62 
65 public:
70  size_t nbOfZerosBeforeHeader() const;
71 
76  size_t parametersAddress() const;
77 
78 protected:
85  PROCESSOR_TYPE readProcessorType(c3d &c3d, std::fstream &file);
86 
87 protected:
88  size_t _checksum;
89 
92 public:
99  size_t checksum() const;
100 
101 protected:
102  size_t _nb3dPoints;
103 
106 public:
111  size_t nb3dPoints() const;
112 
117  void nb3dPoints(size_t numberOfPoints);
118 
119 protected:
121 
124 public:
129  size_t nbAnalogs() const;
130 
135  void nbAnalogs(size_t nbOfAnalogs);
136 
141  size_t nbAnalogsMeasurement() const;
142 
143 protected:
144  size_t _firstFrame;
145  size_t _lastFrame;
150 
155 public:
160  size_t nbFrames() const;
161 
166  size_t firstFrame() const;
167 
172  void firstFrame(size_t frame);
173 
178  size_t lastFrame() const;
179 
184  void lastFrame(size_t frame);
185 
186 protected:
188 
191 public:
196  size_t nbMaxInterpGap() const;
197 
198 protected:
199  float _scaleFactor;
200 
204 public:
211  float scaleFactor() const;
212 
213 protected:
214  size_t _dataStart;
215 
218 public:
223  size_t dataStart() const;
224 
225 protected:
227 public:
234  size_t nbAnalogByFrame() const;
235 
240  void nbAnalogByFrame(size_t nbOfAnalogsByFrame);
241 
242 protected:
243  float _frameRate;
244 
247 public:
252  float frameRate() const;
253 
258  void frameRate(float pointFrameRate);
259 
260 protected:
262 
266 
270 
274 
277 public:
282  int emptyBlock1() const;
283 
288  int emptyBlock2() const;
289 
294  int emptyBlock3() const;
295 
300  int emptyBlock4() const;
301 
302 protected:
304 
308 public:
316  size_t keyLabelPresent() const;
317 
318 protected:
320  size_t _fourCharPresent;
323 
327  size_t _nbEvents;
328 
331  std::vector<float> _eventsTime;
332 
335  std::vector<size_t> _eventsDisplay;
336 
340  std::vector<std::string> _eventsLabel;
341 
344 public:
349  size_t firstBlockKeyLabel() const;
350 
355  size_t fourCharPresent() const;
356 
361  size_t nbEvents() const;
362 
367  const std::vector<float>& eventsTime() const;
368 
376  float eventsTime(size_t idx) const;
377 
385  std::vector<size_t> eventsDisplay() const;
386 
397  size_t eventsDisplay(size_t idx) const;
398 
403  const std::vector<std::string>& eventsLabel() const;
404 
412  const std::string& eventsLabel(size_t idx) const;
413 
414 };
415 
416 #endif
int emptyBlock3() const
Get the empty block 3.
Definition: Header.cpp:349
int _emptyBlock1
Definition: Header.h:261
std::vector< size_t > _eventsDisplay
Definition: Header.h:335
size_t _nb3dPoints
Definition: Header.h:102
int emptyBlock4() const
Get the empty block 4.
Definition: Header.cpp:354
void write(std::fstream &f, std::streampos &dataStartPosition) const
Write the header to an opened file.
Definition: Header.cpp:94
size_t nbFrames() const
Get the number of frames.
Definition: Header.cpp:274
size_t _checksum
Definition: Header.h:88
size_t _nbEvents
Definition: Header.h:327
size_t nbMaxInterpGap() const
Get the maximal gap used for interpolation.
Definition: Header.cpp:302
float frameRate() const
Get the points frame rate in Hz.
Definition: Header.cpp:329
PROCESSOR_TYPE
The type of processor used to store the data.
Definition: ezc3d.h:85
size_t _parametersAddress
Definition: Header.h:61
int emptyBlock1() const
Get the empty block 1.
Definition: Header.cpp:339
size_t checksum() const
Get the checksum of the header.
Definition: Header.cpp:241
size_t keyLabelPresent() const
Get the present label flag.
Definition: Header.cpp:359
Header of a C3D file.
Definition: Header.h:16
std::vector< float > _eventsTime
Definition: Header.h:331
size_t lastFrame() const
Get the last frame.
Definition: Header.cpp:292
size_t _dataStart
Definition: Header.h:214
int _emptyBlock2
Definition: Header.h:265
size_t _nbOfZerosBeforeHeader
Definition: Header.h:58
float scaleFactor() const
Get the scaling factor to convert the 3D point.
Definition: Header.cpp:307
Namespace ezc3d.
Definition: ezc3d.h:68
int _emptyBlock3
Definition: Header.h:269
float _scaleFactor
Definition: Header.h:199
int _emptyBlock4
Definition: Header.h:273
size_t firstBlockKeyLabel() const
Get the first block of key labels (if present)
Definition: Header.cpp:364
size_t nbEvents() const
Get the number of defined time events (0 to 18)
Definition: Header.cpp:374
std::vector< std::string > _eventsLabel
Definition: Header.h:340
std::vector< size_t > eventsDisplay() const
Get the display flags.
Definition: Header.cpp:396
size_t fourCharPresent() const
fourCharPresent
Definition: Header.cpp:369
Main class for C3D holder.
Definition: ezc3d.h:154
size_t parametersAddress() const
Get the byte at which the parameters start in the file.
Definition: Header.cpp:214
size_t nbAnalogByFrame() const
Get the number of analog by frame.
Definition: Header.cpp:317
size_t _firstFrame
Definition: Header.h:144
int emptyBlock2() const
Get the empty block 2.
Definition: Header.cpp:344
void read(c3d &c3d, std::fstream &file)
Read and store a header from an opened C3D file.
Definition: Header.cpp:148
size_t nbOfZerosBeforeHeader() const
Get the number of zeros before the header starts in the file.
Definition: Header.cpp:209
size_t firstFrame() const
Get the first frame.
Definition: Header.cpp:282
size_t _lastFrame
Definition: Header.h:149
size_t dataStart() const
Get the number of 256-byte blocks to get to the points and analogous data in the file.
Definition: Header.cpp:312
size_t _nbMaxInterpGap
Definition: Header.h:187
const std::vector< float > & eventsTime() const
Get the event times in seconds.
Definition: Header.cpp:379
size_t nbAnalogsMeasurement() const
Get the number of recorded analogs.
Definition: Header.cpp:269
Declaration of ezc3d class.
size_t _nbAnalogsMeasurement
Definition: Header.h:120
size_t _fourCharPresent
Definition: Header.h:322
size_t _nbAnalogByFrame
Definition: Header.h:226
float _frameRate
Definition: Header.h:243
size_t nb3dPoints() const
Get the number 3D points.
Definition: Header.cpp:246
size_t _firstBlockKeyLabel
Definition: Header.h:319
size_t _keyLabelPresent
Definition: Header.h:303
void print() const
Print the header.
Definition: Header.cpp:68
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 beggi...
Definition: Header.cpp:219
const std::vector< std::string > & eventsLabel() const
Get the event labels.
Definition: Header.cpp:412
size_t nbAnalogs() const
Get the number of analogs.
Definition: Header.cpp:256
Header()
Create a valid header with minimal informations.
Definition: Header.cpp:13