- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# OBJ_FileLoader Class Reference

A loader for Wavefront .obj-files. More...

`#include <obj_loader.hpp>`

List of all members.

## Public Member Functions
| OBJ_FileLoader ()
| Constructor.
| OBJ_FileLoader (const char *fname)
| Constructor.
| ~OBJ_FileLoader ()
| Destructor.
int | GetNMeshes () const
| Get the number of meshes found in the file.
OBJ_Mesh const * | GetMesh (int index) const
| Get a Mesh from the file.
void | AddMesh (OBJ_Mesh const &mesh)
| Add a mesh to the meshlist.
void | WriteFile (char const *fname) const
| Write data back to a file.

## Detailed Description

A loader for Wavefront .obj-files.

## Constructor & Destructor Documentation

OBJ_FileLoader::OBJ_FileLoader | ( | const char * | fname | ) |

Constructor.

Parameters:

  `[in]` | fname | Full path to the file that shall be loaded

Exceptions:

  | std::bad_alloc |

## Member Function Documentation

int OBJ_FileLoader::GetNMeshes | ( |  | ) | const

Get the number of meshes found in the file.

Returns:
  The number of meshes found in the file

OBJ_Mesh const * OBJ_FileLoader::GetMesh | ( | int | index | ) | const

Get a Mesh from the file.

Parameters:

  `[in]` | index | Number of the mesh from range [0..( GetNMeshes() - 1 )]

Returns:
  A OBJ_Mesh object of the mesh

void OBJ_FileLoader::AddMesh | ( | OBJ_Mesh const & | mesh | ) |

Add a mesh to the meshlist.

Parameters:

  `[in]` | mesh | The mesh to add

Exceptions:

  | std::bad_alloc |

void OBJ_FileLoader::WriteFile | ( | char const * | fname | ) | const

Write data back to a file.

Parameters:

  `[in]` | fname | Full path to the output file

Exceptions:

  | Ghulbus::gbException | GB_FAILED indicates a file access error

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

- include/obj_loader.hpp
- src/obj_loader.cpp