Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Functions
FileLoader Namespace Reference

A namespace that contains functions to load in files. More...

Functions

std::string loadShaderFile (std::string fileName)
 
void loadOBJFile (std::string objFileName, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures)
 
void loadXYZFloats (std::stringstream &streamLine, std::vector< float > &vectorArray)
 
void loadUVFloats (std::stringstream &streamLine, std::vector< float > &vectorArray)
 
void sortWithIndices (std::stringstream &streamLine, std::vector< float > &loadedVertices, std::vector< float > &loadedVertexNormals, std::vector< float > &loadedVertexTextures, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures)
 

Detailed Description

A namespace that contains functions to load in files.

Author
Jamie Slowgrove

Function Documentation

void FileLoader::loadOBJFile ( std::string  objFileName,
std::vector< float > &  vertices,
std::vector< float > &  vertexNormals,
std::vector< float > &  vertexTextures 
)

Load the contents of an obj file.

Parameters
objFileNameThe name of the obj file.
verticesThe vertices vector array to push to.
vertexNormalsThe vertex normals vector array to push to.
vertexTexturesThe vertex texture vector array to push to.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string FileLoader::loadShaderFile ( std::string  fileName)

Load the contents of a text file in to a std::string.

Parameters
fileNameThe file name.
Returns
The contents of the file in a single std::string.

Here is the caller graph for this function:

void FileLoader::loadUVFloats ( std::stringstream &  streamLine,
std::vector< float > &  vectorArray 
)

Load in the UV coordinate from the line.

Parameters
streamLineThe current stringstream.
vectorArrayThe vector array to push to.

Here is the caller graph for this function:

void FileLoader::loadXYZFloats ( std::stringstream &  streamLine,
std::vector< float > &  vectorArray 
)

Load in the XYZ coordinate from the line.

Parameters
streamLineThe current stringstream.
vectorArrayThe vector array to push to.

Here is the caller graph for this function:

void FileLoader::sortWithIndices ( std::stringstream &  streamLine,
std::vector< float > &  loadedVertices,
std::vector< float > &  loadedVertexNormals,
std::vector< float > &  loadedVertexTextures,
std::vector< float > &  vertices,
std::vector< float > &  vertexNormals,
std::vector< float > &  vertexTextures 
)

Sort the data using the indices of the faces to order the data.

Parameters
streamLineThe current stringstream.
loadedVerticesThe vector array of the loaded vertices.
loadedVertexNormalsThe vector array of the loaded vertex normals.
loadedVertexTexturesThe vector array of the loaded vertex textures.
verticesThe vertices vector array to push to.
vertexNormalsThe vertex normals vector array to push to.
vertexTexturesThe vertex textures vector array to push to.

Here is the caller graph for this function: