Loads and processes OBJ models and materials. More...

#include <OBJLoader.h>

Classes

struct  FaceData
 
struct  VertexData
 

Public Types

typedef std::unordered_map< std::string, MaterialDataMaterialMap
 

Public Member Functions

 OBJLoader (obj::obj_parser::flags_type flags)
 Constructor. More...
 
 OBJLoader (ModelData *data, obj::obj_parser::flags_type flags)
 Constructor. More...
 
virtual ~OBJLoader ()
 Virtual destructor. More...
 
bool load (std::istream &istream)
 Loads the model data from an input stream. More...
 
void createFaceNormals ()
 Creates the normal vectors of the face. More...
 
void createVertexNormals ()
 Creates the normal vectors of the vertex. More...
 
ModelData::GroupMap getData ()
 Returns the geometry groups. More...
 

Static Public Member Functions

static MaterialData loadMaterial (const std::string &fileName, const std::string &materialName)
 Loads an obj material. More...
 

Detailed Description

Loads and processes OBJ models and materials.

Author
David Steiner, Benjamin Buergisser

Member Typedef Documentation

typedef std::unordered_map< std::string, MaterialData > OBJLoader::MaterialMap

Constructor & Destructor Documentation

OBJLoader::OBJLoader ( obj::obj_parser::flags_type  flags)
inline

Constructor.

Parameters
[in]flags
OBJLoader::OBJLoader ( ModelData data,
obj::obj_parser::flags_type  flags 
)
inline

Constructor.

Parameters
[in]dataThe underlying data of the model
[in]flags
virtual OBJLoader::~OBJLoader ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

void OBJLoader::createFaceNormals ( )

Creates the normal vectors of the face.

void OBJLoader::createVertexNormals ( )

Creates the normal vectors of the vertex.

ModelData::GroupMap OBJLoader::getData ( )
inline

Returns the geometry groups.

bool OBJLoader::load ( std::istream &  istream)

Loads the model data from an input stream.

Parameters
[in]istream
MaterialData OBJLoader::loadMaterial ( const std::string &  fileName,
const std::string &  materialName 
)
static

Loads an obj material.

Parameters
[in]fileNameFile name including extension
[in]materialNameName of the material