1 #define EZC3D_API_EXPORTS 25 std::vector<std::string> pointNames;
28 std::vector<std::string> analogNames;
53 pt.
x(static_cast<float>(
c3d.
readInt(processorType, file, ezc3d::DATA_TYPE::WORD)) * pointScaleFactor);
54 pt.
y(static_cast<float>(
c3d.
readInt(processorType, file, ezc3d::DATA_TYPE::WORD)) * pointScaleFactor);
55 pt.
z(static_cast<float>(
c3d.
readInt(processorType, file, ezc3d::DATA_TYPE::WORD)) * pointScaleFactor);
56 pt.
residual(static_cast<float>(
c3d.
readInt(processorType, file, ezc3d::DATA_TYPE::WORD)) * pointScaleFactor);
58 ptsAtAFrame.point(pt, i);
71 c.
data( (
c3d.
readFloat(processorType, file) - analogZeroOffset[i]) * analogScaleFactors[i] * analogGeneralFactor );
73 c.
data( (static_cast<float>(
c3d.
readInt(processorType, file, ezc3d::DATA_TYPE::WORD)) - analogZeroOffset[i]) * analogScaleFactors[i] * analogGeneralFactor );
83 size_t nFrames(_frames.size());
85 for (
size_t i=0; i<nFrames-1; i--){
86 if (_frames.back().isempty())
95 for (
size_t i = 0; i < nbFrames(); ++i){
96 std::cout <<
"Frame " << i << std::endl;
98 std::cout << std::endl;
104 for (
size_t i = 0; i < nbFrames(); ++i)
110 return _frames.size();
116 return _frames.at(idx);
117 }
catch(std::out_of_range) {
118 throw std::out_of_range(
"Data::frame method is trying to access the frame " 119 + std::to_string(idx) +
120 " while the maximum number of frame is " 121 + std::to_string(nbFrames()) +
".");
128 return _frames.at(idx);
129 }
catch(std::out_of_range) {
130 throw std::out_of_range(
"Data::frame method is trying to access the frame " 131 + std::to_string(idx) +
132 " while the maximum number of frames is " 133 + std::to_string(nbFrames()) +
".");
140 _frames.push_back(frame);
142 if (idx >= _frames.size())
143 _frames.resize(idx+1);
144 _frames[idx].
add(frame);
ezc3d::DataNS::Frame & frame_nonConst(size_t idx)
Get the frame of index idx in order to be modified by the caller.
Analog holder for C3D analogous data.
const std::vector< int > & valuesAsInt() const
Return the vector of values of the parameter.
float data() const
Get the value of the analog data.
Points holder for C3D data 3D points data.
void print() const
Print the data.
const std::vector< ezc3d::DataNS::Frame > & frames() const
Get all the frames from the data set.
PROCESSOR_TYPE
The type of processor used to store the data.
void add(const ezc3d::DataNS::Frame &frame)
Add a frame by copying a sent frame.
Data()
Create a ready to fill Data class.
Declaration of data class.
float y() const
Get the Y component of the 3D point.
const ezc3d::DataNS::AnalogsNS::Channel & channel(size_t idx) const
Get a particular analog channel of index idx from the analogous data.
PROCESSOR_TYPE processorType() const
Get the processor type the file was writen on.
const ezc3d::ParametersNS::GroupNS::Group & group(size_t idx) const
Get a particular group of index idx from the group holder.
size_t nbFrames() const
Get the number of frames in the data structure.
size_t nbChannels() const
Get the number of analog channels.
const ezc3d::ParametersNS::GroupNS::Parameter & parameter(size_t idx) const
Get a particular parameter of index idx from the group.
Subframe for the analogous data.
const ezc3d::DataNS::AnalogsNS::SubFrame & subframe(size_t idx) const
Get a particular subframe of index idx from the analogous data set.
float residual() const
Get the residual component of the 3D point.
Channel of an analogous data.
float z() const
Get the Z component of the 3D point.
const ezc3d::Header & header() const
The header of the C3D.
const ezc3d::ParametersNS::Parameters & parameters() const
The parameters of the C3D.
Main class for C3D holder.
const std::vector< std::string > & valuesAsString() const
Return the vector of values of the parameter.
Frame holder for C3D data.
int readInt(PROCESSOR_TYPE processorType, std::fstream &file, unsigned int nByteToRead, int nByteFromPrevious=0, const std::ios_base::seekdir &pos=std::ios::cur)
Read an integer of nByteToRead bytes at the position current + nByteFromPrevious from a file...
const std::vector< float > & valuesAsFloat() const
Return the vector of values of the parameter.
const ezc3d::DataNS::Frame & frame(size_t idx) const
Get the frame of index idx.
size_t nbSubframes() const
Get the number of subframes.
float x() const
Get the X component of the 3D point.
void write(std::fstream &f) const
Write all the data to an opened file.
Declaration of Parameters class.
float readFloat(PROCESSOR_TYPE processorType, std::fstream &file, int nByteFromPrevious=0, const std::ios_base::seekdir &pos=std::ios::cur)
Read a float at the position current + nByteFromPrevious from a file.