The small3d library
Public Member Functions | List of all members
small3d::WavefrontFile Class Reference

.obj (Wavefront) file parser class. The file format has to be somewhat specific, with triangulated faces and containing the normals. Such a file can be exported from Blender for example (see blender.org). From the file menu, select Export > Wavefront (.obj). Then from the "Export OBJ" menu, only select "Write Normals", "Triangulate Faces" and "Keep Vertex Order". More...

#include <WavefrontFile.hpp>

Inheritance diagram for small3d::WavefrontFile:
small3d::File

Public Member Functions

 WavefrontFile (const std::string &filePath)
 Constructor. More...
 
void load (Model &model, const std::string &meshName) override
 Load data from the Wavefront file into a Model. More...
 
std::vector< std::string > getMeshNames () override
 Get a list of the names of the meshes contained in the file. More...
 
- Public Member Functions inherited from small3d::File
 File (const std::string &fileLocation)
 Constructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from small3d::File
std::string fullPath = ""
 The path to the file being parsed.
 

Detailed Description

.obj (Wavefront) file parser class. The file format has to be somewhat specific, with triangulated faces and containing the normals. Such a file can be exported from Blender for example (see blender.org). From the file menu, select Export > Wavefront (.obj). Then from the "Export OBJ" menu, only select "Write Normals", "Triangulate Faces" and "Keep Vertex Order".

Constructor & Destructor Documentation

◆ WavefrontFile()

small3d::WavefrontFile::WavefrontFile ( const std::string &  filePath)
explicit

Constructor.

Parameters
filePathPath to wavefront file

Member Function Documentation

◆ getMeshNames()

std::vector< std::string > small3d::WavefrontFile::getMeshNames ( )
overridevirtual

Get a list of the names of the meshes contained in the file.

Returns
The list of mesh names

Implements small3d::File.

◆ load()

void small3d::WavefrontFile::load ( Model model,
const std::string &  meshName 
)
overridevirtual

Load data from the Wavefront file into a Model.

Parameters
modelThe model to load the data to
meshNameThe name of the mesh to load

Implements small3d::File.


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