AAM file parsing namespace. More...
Functions | |
bool | EnterBlock (std::ifstream &is) |
Reads the file returning true if the next parsed token is a block begin token. | |
bool | ExitBlock (std::ifstream &is) |
Reads the file returning true if the next parsed token is a block exit token. | |
bool | SkipBlock (std::ifstream &is, int level) |
Skips an entire block opened by a '{' and closed by a '}'. | |
bool | GoToSection (std::ifstream &is, const char *sec_name) |
Reads the file looking for a particular section. | |
bool | GetGeoSection (std::ifstream &is, bool &smgEnabled) |
bool | GetIntPar (std::ifstream &is, const char *par_name, int &int_param) |
Reads the integer parameter whose tag is par_name. | |
bool | GetFloatPar (std::ifstream &is, const char *par_name, float &float_param) |
Reads the float parameter whose tag is par_name. | |
bool | GetStringPar (std::ifstream &is, const char *par_name, std::string &string_param) |
Reads the string parameter whose tag is par_name. | |
bool | GetIDNamePar (std::ifstream &is, const char *par_name, int &ID, std::string &str) |
Reads a parameter whose tag is par_name returning the associated integer and the string. | |
bool | GetFloatVec3 (std::ifstream &is, float fVector[3]) |
Reads a float 3-dimensional vector. | |
bool | GetFloatVec3Par (std::ifstream &is, const char *par_name, float fVector[3]) |
Reads the float 3-dimensional vector parameter whose tag is par_name. | |
bool | GetFloatVec2 (std::ifstream &is, float fVector[2]) |
Reads a float 2-dimensional vector. | |
bool | GetInt2Par (std::ifstream &is, const char *par_name, int &val1, int &val2) |
Reads an int parameter composed by two values. | |
bool | GetIntVec3 (std::ifstream &is, int iVector[3]) |
Reads an 3-dimensional vector integer vector. | |
bool | GetIntVec3Par (std::ifstream &is, const char *par_name, int iVector[3]) |
Reads the int 3-dimensional integer vector parameter whose tag is par_name. | |
bool | GetIntVec31Par (std::ifstream &is, const char *par_name, int iVector[3], int &val) |
Reads the int 3-dimensional integer vector parameter whose tag is par_name and an additional integer. | |
bool | SkipPar (std::ifstream &is, const char *par_name) |
Skips a paramameter whose tag is par_name (if it effectively is the next tag) | |
bool | SeekPar (std::ifstream &is, const char *par_name) |
Seeks a parameter whose tag is par_name and positions the stream on that line. |
AAM file parsing namespace.
The namespace contains the utility functions used for AAM file parsing, a function is defined to obtain a specific type of data from the AAM file. As an example, the getIntPar() will get a single integer value from the file whose tag (name) is par_name, while getFloatVec3() will get an array of 3 floating points. All this functions return true in case of success and false in case of error, they always accept as first parameter the file input stream used to read the data. If any of this function fails, the stream position is resetted to the position it had before the beginning of the function.
bool VR3AAMParser::EnterBlock | ( | std::ifstream & | is ) |
Reads the file returning true if the next parsed token is a block begin token.
bool VR3AAMParser::ExitBlock | ( | std::ifstream & | is ) |
Reads the file returning true if the next parsed token is a block exit token.
bool VR3AAMParser::GetFloatPar | ( | std::ifstream & | is, |
const char * | par_name, | ||
float & | float_param | ||
) |
Reads the float parameter whose tag is par_name.
bool VR3AAMParser::GetFloatVec2 | ( | std::ifstream & | is, |
float | fVector[2] | ||
) |
Reads a float 2-dimensional vector.
bool VR3AAMParser::GetFloatVec3 | ( | std::ifstream & | is, |
float | fVector[3] | ||
) |
Reads a float 3-dimensional vector.
bool VR3AAMParser::GetFloatVec3Par | ( | std::ifstream & | is, |
const char * | par_name, | ||
float | fVector[3] | ||
) |
Reads the float 3-dimensional vector parameter whose tag is par_name.
This function does not reset the stream position and error flags in case of error.
bool VR3AAMParser::GetGeoSection | ( | std::ifstream & | is, |
bool & | smgEnabled | ||
) |
Runs through the file looking for the geometry section and reads a boolean flag stating if smoothing groups are enabled in the file
bool VR3AAMParser::GetIDNamePar | ( | std::ifstream & | is, |
const char * | par_name, | ||
int & | ID, | ||
std::string & | str | ||
) |
Reads a parameter whose tag is par_name returning the associated integer and the string.
bool VR3AAMParser::GetInt2Par | ( | std::ifstream & | is, |
const char * | par_name, | ||
int & | val1, | ||
int & | val2 | ||
) |
Reads an int parameter composed by two values.
bool VR3AAMParser::GetIntPar | ( | std::ifstream & | is, |
const char * | par_name, | ||
int & | int_param | ||
) |
Reads the integer parameter whose tag is par_name.
bool VR3AAMParser::GetIntVec3 | ( | std::ifstream & | is, |
int | iVector[3] | ||
) |
Reads an 3-dimensional vector integer vector.
bool VR3AAMParser::GetIntVec31Par | ( | std::ifstream & | is, |
const char * | par_name, | ||
int | iVector[3], | ||
int & | val | ||
) |
Reads the int 3-dimensional integer vector parameter whose tag is par_name and an additional integer.
bool VR3AAMParser::GetIntVec3Par | ( | std::ifstream & | is, |
const char * | par_name, | ||
int | iVector[3] | ||
) |
Reads the int 3-dimensional integer vector parameter whose tag is par_name.
bool VR3AAMParser::GetStringPar | ( | std::ifstream & | is, |
const char * | par_name, | ||
std::string & | string_param | ||
) |
Reads the string parameter whose tag is par_name.
bool VR3AAMParser::GoToSection | ( | std::ifstream & | is, |
const char * | sec_name | ||
) |
Reads the file looking for a particular section.
bool VR3AAMParser::SeekPar | ( | std::ifstream & | is, |
const char * | par_name | ||
) |
Seeks a parameter whose tag is par_name and positions the stream on that line.
bool VR3AAMParser::SkipBlock | ( | std::ifstream & | is, |
int | level | ||
) |
Skips an entire block opened by a '{' and closed by a '}'.
[in] | is | File input stream |
[in] | level | Where we are located in the file block structures:
|
bool VR3AAMParser::SkipPar | ( | std::ifstream & | is, |
const char * | par_name | ||
) |
Skips a paramameter whose tag is par_name (if it effectively is the next tag)