# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# vl::ObjLoader Class Reference

Loads a Wavefront OBJ file. More...

`#include <vlOBJ.hpp>`

List of all members.

## Public Member Functions

const std::vector< fvec4 > & | vertexArray () const
const std::vector< fvec3 > & | normalArray () const
const std::vector< fvec3 > & | texCoordsArray () const
const std::map< std::string, ref< ObjMaterial > > & | materials () const
const std::vector< ref < ObjMesh > > & | meshes () const
std::vector< fvec4 > & | vertexArray ()
std::vector< fvec3 > & | normalArray ()
std::vector< fvec3 > & | texCoordsArray ()
std::map< std::string, ref < ObjMaterial > > & | materials ()
std::vector< ref< ObjMesh > > & | meshes ()
ref< ResourceDatabase > | loadOBJ (VirtualFile *file)
| Loads a Wavefront OBJ file.
void | loadObjMaterials (VirtualFile *file, std::vector< ObjMaterial > &materials)
| Loads a Wavefront MTL file.

## Protected Attributes

std::vector< fvec4 > | mCoords
std::vector< fvec3 > | mNormals
std::vector< fvec3 > | mTexCoords
std::map< std::string, ref < ObjMaterial > > | mMaterials
std::vector< ref< ObjMesh > > | mMeshes

## Detailed Description

Loads a Wavefront OBJ file.

Definition at line 340 of file vlOBJ.hpp.

## Member Function Documentation

const std::vector<fvec4>& vl::ObjLoader::vertexArray | ( | ) | const`[inline]`

Definition at line 343 of file vlOBJ.hpp.

References mCoords.

const std::vector<fvec3>& vl::ObjLoader::normalArray | ( | ) | const`[inline]`

Definition at line 344 of file vlOBJ.hpp.

References mNormals.

const std::vector<fvec3>& vl::ObjLoader::texCoordsArray | ( | ) | const`[inline]`

Definition at line 345 of file vlOBJ.hpp.

References mTexCoords.

const std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials | ( | ) | const`[inline]`

Definition at line 346 of file vlOBJ.hpp.

References mMaterials.

const std::vector< ref<ObjMesh> >& vl::ObjLoader::meshes | ( | ) | const`[inline]`

Definition at line 347 of file vlOBJ.hpp.

References mMeshes.

std::vector<fvec4>& vl::ObjLoader::vertexArray | ( | ) | `[inline]`

Definition at line 349 of file vlOBJ.hpp.

References mCoords.

std::vector<fvec3>& vl::ObjLoader::normalArray | ( | ) | `[inline]`

Definition at line 350 of file vlOBJ.hpp.

References mNormals.

std::vector<fvec3>& vl::ObjLoader::texCoordsArray | ( | ) | `[inline]`

Definition at line 351 of file vlOBJ.hpp.

References mTexCoords.

std::map< std::string, ref<ObjMaterial> >& vl::ObjLoader::materials | ( | ) | `[inline]`

Definition at line 352 of file vlOBJ.hpp.

References mMaterials.

std::vector< ref<ObjMesh> >& vl::ObjLoader::meshes | ( | ) | `[inline]`

Definition at line 353 of file vlOBJ.hpp.

References mMeshes.

ref< ResourceDatabase > ObjLoader::loadOBJ | ( | VirtualFile * | file ) |

Loads a Wavefront OBJ file.

Parameters:

  file | The OBJ file to be loaded

Definition at line 303 of file vlOBJ.cpp.

References vl::defFileSystem(), vl::EN_BLEND, vl::EN_CULL_FACE, vl::EN_DEPTH_TEST, vl::Log::error(), vl::String::extractPath(), vl::ref< T >::get(), loadObjMaterials(), vl::FileSystem::locateFile(), mCoords, mMaterials, mMeshes, mNormals, mTexCoords, vl::OM_ReadOnly, vl::VirtualFile::path(), vl::Log::print(), vl::PT_TRIANGLES, vl::TEM_DECAL, vl::TF_RGBA, vl::String::toStdString(), vl::String::trim(), vl::String::trimStdString(), VL_CHECK, VL_TRAP, and vl::Log::warning().

Referenced by vl::loadOBJ().

void ObjLoader::loadObjMaterials | ( | VirtualFile * | file,
|  | std::vector< ObjMaterial > & | materials
| ) |  |

Loads a Wavefront MTL file.

Parameters:

  file | The MTL file to be loaded
  materials | Is filled with the loaded materials

Definition at line 194 of file vlOBJ.cpp.

References vl::Vector3< T_Scalar >::b(), vl::String::empty(), vl::Log::error(), vl::String::field(), vl::Vector3< T_Scalar >::g(), vl::VirtualFile::path(), vl::Vector3< T_Scalar >::r(), vl::String::startsWith(), vl::String::toDouble(), vl::String::toFloat(), vl::String::toInt(), vl::String::toStdString(), and vl::String::trim().

Referenced by loadOBJ().

## Member Data Documentation

std::vector<fvec4> vl::ObjLoader::mCoords`[protected]`

Definition at line 365 of file vlOBJ.hpp.

Referenced by loadOBJ(), and vertexArray().

std::vector<fvec3> vl::ObjLoader::mNormals`[protected]`

Definition at line 366 of file vlOBJ.hpp.

Referenced by loadOBJ(), and normalArray().

std::vector<fvec3> vl::ObjLoader::mTexCoords`[protected]`

Definition at line 367 of file vlOBJ.hpp.

Referenced by loadOBJ(), and texCoordsArray().

std::map< std::string, ref<ObjMaterial> > vl::ObjLoader::mMaterials`[protected]`

Definition at line 368 of file vlOBJ.hpp.

Referenced by loadOBJ(), and materials().

std::vector< ref<ObjMesh> > vl::ObjLoader::mMeshes`[protected]`

Definition at line 369 of file vlOBJ.hpp.

Referenced by loadOBJ(), and meshes().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/vlOBJ.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/vlOBJ.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:43.
Permission is granted to use this page to write and publish articles regarding Visualization Library.