1.3.49
 
Loading...
Searching...
No Matches
helios::XMLparser Class Reference

Class for parsing XML input files. More...

#include <Context.h>

Static Public Member Functions

static int parse_data_float (const pugi::xml_node &node_data, std::vector< float > &data)
 Parse vector data of type 'float' within an XML tag.
 
static int parse_data_double (const pugi::xml_node &node_data, std::vector< double > &data)
 Parse vector data of type 'double' within an XML tag.
 
static int parse_data_int (const pugi::xml_node &node_data, std::vector< int > &data)
 Parse vector data of type 'int' within an XML tag.
 
static int parse_data_uint (const pugi::xml_node &node_data, std::vector< uint > &data)
 Parse vector data of type 'uint' within an XML tag.
 
static int parse_data_string (const pugi::xml_node &node_data, std::vector< std::string > &data)
 Parse vector data of type 'string' within an XML tag.
 
static int parse_data_vec2 (const pugi::xml_node &node_data, std::vector< vec2 > &data)
 Parse vector data of type 'vec2' within an XML tag.
 
static int parse_data_vec3 (const pugi::xml_node &node_data, std::vector< vec3 > &data)
 Parse vector data of type 'vec3' within an XML tag.
 
static int parse_data_vec4 (const pugi::xml_node &node_data, std::vector< vec4 > &data)
 Parse vector data of type 'vac4' within an XML tag.
 
static int parse_data_int2 (const pugi::xml_node &node_data, std::vector< int2 > &data)
 Parse vector data of type 'int2' within an XML tag.
 
static int parse_data_int3 (const pugi::xml_node &node_data, std::vector< int3 > &data)
 Parse vector data of type 'int3' within an XML tag.
 
static int parse_data_int4 (const pugi::xml_node &node_data, std::vector< int4 > &data)
 Parse vector data of type 'int4' within an XML tag.
 
static int parse_objID (const pugi::xml_node &node_data, uint &objID)
 Parse the value within an <objID> (object ID) tag.
 
static int parse_transform (const pugi::xml_node &node_data, float(&transform)[16])
 Parse the value within a <transform> (transformation matrix) tag.
 
static int parse_texture (const pugi::xml_node &node_data, std::string &texture)
 Parse the value within an <texture> (path to image texture) tag.
 
static int parse_textureUV (const pugi::xml_node &node_data, std::vector< vec2 > &uvs)
 Parse the value within a <textureUV> (texture coordinates) tag.
 
static int parse_solid_fraction (const pugi::xml_node &node_data, float &solid_fraction)
 Parse the value within a <solid_fraction> (primitive solid fraction) tag.
 
static int parse_vertices (const pugi::xml_node &node_data, std::vector< float > &vertices)
 Parse the value within a <vertices> (primitive vertex coordinates) tag.
 
static int parse_subdivisions (const pugi::xml_node &node_data, uint &subdivisions)
 Parse the value within a <subdivisions> (object sub-primitive resolution) tag.
 
static int parse_subdivisions (const pugi::xml_node &node_data, int2 &subdivisions)
 Parse the value within a <subdivisions> (object sub-primitive resolution) tag.
 
static int parse_subdivisions (const pugi::xml_node &node_data, int3 &subdivisions)
 Parse the value within a <subdivisions> (object sub-primitive resolution) tag.
 
static int parse_nodes (const pugi::xml_node &node_data, std::vector< vec3 > &nodes)
 Parse the value within a <nodes> (coordinates defining nodes of a tube or cone) tag.
 
static int parse_radius (const pugi::xml_node &node_data, std::vector< float > &radius)
 Parse the value within a <radius> (radius at nodes of a tube or cone) tag.
 

Detailed Description

Class for parsing XML input files.

Definition at line 1850 of file Context.h.

Member Function Documentation

◆ parse_data_double()

int XMLparser::parse_data_double ( const pugi::xml_node &  node_data,
std::vector< double > &  data 
)
static

Parse vector data of type 'double' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 45 of file Context_fileIO.cpp.

◆ parse_data_float()

int XMLparser::parse_data_float ( const pugi::xml_node &  node_data,
std::vector< float > &  data 
)
static

Parse vector data of type 'float' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 24 of file Context_fileIO.cpp.

◆ parse_data_int()

int XMLparser::parse_data_int ( const pugi::xml_node &  node_data,
std::vector< int > &  data 
)
static

Parse vector data of type 'int' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 66 of file Context_fileIO.cpp.

◆ parse_data_int2()

int XMLparser::parse_data_int2 ( const pugi::xml_node &  node_data,
std::vector< int2 > &  data 
)
static

Parse vector data of type 'int2' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 193 of file Context_fileIO.cpp.

◆ parse_data_int3()

int XMLparser::parse_data_int3 ( const pugi::xml_node &  node_data,
std::vector< int3 > &  data 
)
static

Parse vector data of type 'int3' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 215 of file Context_fileIO.cpp.

◆ parse_data_int4()

int XMLparser::parse_data_int4 ( const pugi::xml_node &  node_data,
std::vector< int4 > &  data 
)
static

Parse vector data of type 'int4' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 238 of file Context_fileIO.cpp.

◆ parse_data_string()

int XMLparser::parse_data_string ( const pugi::xml_node &  node_data,
std::vector< std::string > &  data 
)
static

Parse vector data of type 'string' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 108 of file Context_fileIO.cpp.

◆ parse_data_uint()

int XMLparser::parse_data_uint ( const pugi::xml_node &  node_data,
std::vector< uint > &  data 
)
static

Parse vector data of type 'uint' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 87 of file Context_fileIO.cpp.

◆ parse_data_vec2()

int XMLparser::parse_data_vec2 ( const pugi::xml_node &  node_data,
std::vector< vec2 > &  data 
)
static

Parse vector data of type 'vec2' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 124 of file Context_fileIO.cpp.

◆ parse_data_vec3()

int XMLparser::parse_data_vec3 ( const pugi::xml_node &  node_data,
std::vector< vec3 > &  data 
)
static

Parse vector data of type 'vec3' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 146 of file Context_fileIO.cpp.

◆ parse_data_vec4()

int XMLparser::parse_data_vec4 ( const pugi::xml_node &  node_data,
std::vector< vec4 > &  data 
)
static

Parse vector data of type 'vac4' within an XML tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]dataVector data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 169 of file Context_fileIO.cpp.

◆ parse_nodes()

int XMLparser::parse_nodes ( const pugi::xml_node &  node_data,
std::vector< vec3 > &  nodes 
)
static

Parse the value within a <nodes> (coordinates defining nodes of a tube or cone) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]nodesVector of node coordinate data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 428 of file Context_fileIO.cpp.

◆ parse_objID()

int XMLparser::parse_objID ( const pugi::xml_node &  node_data,
uint objID 
)
static

Parse the value within an <objID> (object ID) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]objIDObject ID value parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 262 of file Context_fileIO.cpp.

◆ parse_radius()

int XMLparser::parse_radius ( const pugi::xml_node &  node_data,
std::vector< float > &  radius 
)
static

Parse the value within a <radius> (radius at nodes of a tube or cone) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]radiusVector of radii at nodes parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 452 of file Context_fileIO.cpp.

◆ parse_solid_fraction()

int XMLparser::parse_solid_fraction ( const pugi::xml_node &  node_data,
float &  solid_fraction 
)
static

Parse the value within a <solid_fraction> (primitive solid fraction) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]solid_fractionPrimitive solid fraction value parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 338 of file Context_fileIO.cpp.

◆ parse_subdivisions() [1/3]

int XMLparser::parse_subdivisions ( const pugi::xml_node &  node_data,
int2 subdivisions 
)
static

Parse the value within a <subdivisions> (object sub-primitive resolution) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]subdivisions2D (vec2) subdivisions parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 393 of file Context_fileIO.cpp.

◆ parse_subdivisions() [2/3]

int XMLparser::parse_subdivisions ( const pugi::xml_node &  node_data,
int3 subdivisions 
)
static

Parse the value within a <subdivisions> (object sub-primitive resolution) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]subdivisions3D (vec3) subdivisions parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 410 of file Context_fileIO.cpp.

◆ parse_subdivisions() [3/3]

int XMLparser::parse_subdivisions ( const pugi::xml_node &  node_data,
uint subdivisions 
)
static

Parse the value within a <subdivisions> (object sub-primitive resolution) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]subdivisionsScalar (uint) subdivisions value parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 380 of file Context_fileIO.cpp.

◆ parse_texture()

int XMLparser::parse_texture ( const pugi::xml_node &  node_data,
std::string &  texture 
)
static

Parse the value within an <texture> (path to image texture) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]texturePath to image texture file parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty.

Definition at line 304 of file Context_fileIO.cpp.

◆ parse_textureUV()

int XMLparser::parse_textureUV ( const pugi::xml_node &  node_data,
std::vector< vec2 > &  uvs 
)
static

Parse the value within a <textureUV> (texture coordinates) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]uvs(u,v) texture coordinate data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 316 of file Context_fileIO.cpp.

◆ parse_transform()

int XMLparser::parse_transform ( const pugi::xml_node &  node_data,
float(&)  transform[16] 
)
static

Parse the value within a <transform> (transformation matrix) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]transformTransformation matrix data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly, 3 if data was parsed successfully but tag did not contain 16 values.

Definition at line 277 of file Context_fileIO.cpp.

◆ parse_vertices()

int XMLparser::parse_vertices ( const pugi::xml_node &  node_data,
std::vector< float > &  vertices 
)
static

Parse the value within a <vertices> (primitive vertex coordinates) tag.

Parameters
[in]node_dataPUGI XML node for tag containing vector data
[out]vertices(x,y,z) primitive vertex data parsed from XML node
Returns
0 if parsing was successful, 1 if tag/node did not exist or was empty, 2 if tag/node contained invalid data that could not be converted properly.

Definition at line 351 of file Context_fileIO.cpp.


The documentation for this class was generated from the following files: