24 Parameter(
const std::string &name =
"",
const std::string &description =
"");
42 void write(std::fstream &f,
int groupIdx, std::streampos &dataStartPosition)
const;
53 size_t writeImbricatedParameter(std::fstream &f,
const std::vector<size_t> &dim,
size_t currentIdx=0,
size_t cmp=0)
const;
82 const std::string&
name()
const;
88 void name(
const std::string name);
132 const std::vector<size_t>
dimension()
const;
214 void set(
size_t data);
225 void set(
const std::vector<int>& data,
const std::vector<size_t>& dimension = {});
233 void set(
float data);
241 void set(
double data);
252 void set(
const std::vector<float>& data,
const std::vector<size_t>& dimension = {});
258 void set(
const std::string& data);
269 void set(
const std::vector<std::string>& data,
const std::vector<size_t>& dimension = {});
std::string _name
The name of the parameter.
const std::vector< int > & valuesAsInt() const
Return the vector of values of the parameter.
bool isDimensionConsistent(size_t dataSize, const std::vector< size_t > &dimension) const
Check if the dimension parameter is consistent with the values.
Group holder of C3D parameters.
void print() const
Print the parameter and its values.
std::vector< float > _param_data_float
Parameter values if the parameter type is DATA_TYPE::FLOAT.
bool _isLocked
The lock status of the parameter.
void unlock()
Set the locking status of the parameter to false.
ezc3d::DATA_TYPE type() const
Return the type of the data.
std::vector< size_t > _dimension
Mapping of the data vector to the matrix of parameter.
const std::vector< size_t > dimension() const
Return the vector mapping the dimension of the parameter matrix.
std::vector< std::string > _param_data_string
Parameter values if the parameter type is DATA_TYPE::CHAR.
Parameter(const std::string &name="", const std::string &description="")
Create an empty parameter.
const std::string & description() const
Get the description of the parameter.
const std::string & name() const
Get the name of the parameter.
std::string _description
The description of the parameter.
size_t writeImbricatedParameter(std::fstream &f, const std::vector< size_t > &dim, size_t currentIdx=0, size_t cmp=0) const
Write a matrix of parameter to a file.
bool isLocked() const
Get the locking status of the parameter.
Main class for C3D holder.
void write(std::fstream &f, int groupIdx, std::streampos &dataStartPosition) const
Write the parameter to an opened file.
ezc3d::DATA_TYPE _data_type
The type of data (int, float or string) the parameter is.
const std::vector< std::string > & valuesAsString() const
Return the vector of values of the parameter.
Declaration of ezc3d class.
const std::vector< float > & valuesAsFloat() const
Return the vector of values of the parameter.
int read(c3d &c3d, const Parameters ¶ms, std::fstream &file, int nbCharInName)
Read and store a parameter from an opened C3D file.
const std::vector< int > & valuesAsByte() const
Return the vector of values of the parameter.
std::vector< int > _param_data_int
Parameter values if the parameter type is DATA_TYPE::BYTE of DATA_TYPE::INT.
DATA_TYPE
Enum that describes the size of different types.
void lock()
Set the locking status of the parameter to true.