# Visualization Library

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

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

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

# vl::A3DSLoader Class Reference

The A3DSLoader class loads an Autodesk 3DS file and generates a vector of A3DSObject and A3DSMaterial objects. More...

`#include <vl3DS.hpp>`

List of all members.

## Public Member Functions

| A3DSLoader ()
bool | parse3DS (VirtualFile *file)

## Public Attributes

std::vector< A3DSObject > | mObjects
std::vector< A3DSMaterial > | mMaterials

## Protected Member Functions

fvec3 | readVec3 ()
fvec3 | readColByte3 ()
fvec3 | readColFloat3 ()
String | readLine ()
float | readWordPercent ()
float | readFloatPercent ()
void | readChunk ()
bool | skipChunk ()
void | read_3D_EDITOR_CHUNK ()
fvec3 | readColChunk ()
float | readPercentChunk ()
void | read_MATERIAL_BLOCK ()
A3DSTexture | readMapChunk ()
void | read_OBJECT_BLOCK ()
void | read_TRIANGULAR_MESH ()

## Protected Attributes

VirtualFile * | mInputFile
unsigned short | mChunkId
unsigned int | mChunkLen
bool | mCorrupted

## Detailed Description

The A3DSLoader class loads an Autodesk 3DS file and generates a vector of A3DSObject and A3DSMaterial objects.

Definition at line 201 of file vl3DS.hpp.

## Constructor & Destructor Documentation

A3DSLoader::A3DSLoader | ( | ) |

Definition at line 105 of file vl3DS.cpp.

## Member Function Documentation

bool A3DSLoader::parse3DS | ( | VirtualFile * | file ) |

Definition at line 633 of file vl3DS.cpp.

References vl::VirtualFile::close(), vl::VirtualFile::endOfFile(), vl::Log::error(), ID_3D_EDITOR_CHUNK, ID_3DS_VERSION, ID_MAIN_CHUNK, mChunkId, mCorrupted, mInputFile, vl::OM_ReadOnly, vl::VirtualFile::open(), vl::VirtualFile::path(), vl::Log::print(), read_3D_EDITOR_CHUNK(), readChunk(), vl::VirtualFile::readUInt32(), and skipChunk().

Referenced by vl::load3DS().

fvec3 A3DSLoader::readVec3 | ( | ) | `[protected]`

Definition at line 109 of file vl3DS.cpp.

References mInputFile, vl::VirtualFile::readFloat(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().

Referenced by read_TRIANGULAR_MESH().

fvec3 A3DSLoader::readColByte3 | ( | ) | `[protected]`

Definition at line 118 of file vl3DS.cpp.

References vl::Vector3< T_Scalar >::b(), vl::Vector3< T_Scalar >::g(), mInputFile, vl::Vector3< T_Scalar >::r(), and vl::VirtualFile::readUInt8().

Referenced by readColChunk().

fvec3 A3DSLoader::readColFloat3 | ( | ) | `[protected]`

Definition at line 127 of file vl3DS.cpp.

References vl::Vector3< T_Scalar >::b(), vl::Vector3< T_Scalar >::g(), mInputFile, vl::Vector3< T_Scalar >::r(), and vl::VirtualFile::readFloat().

Referenced by readColChunk().

String A3DSLoader::readLine | ( | ) | `[protected]`

Definition at line 136 of file vl3DS.cpp.

References mInputFile, and vl::VirtualFile::readUInt8().

Referenced by read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), and readMapChunk().

float A3DSLoader::readWordPercent | ( | ) | `[protected]`

Definition at line 148 of file vl3DS.cpp.

References mInputFile, and vl::VirtualFile::readUInt16().

Referenced by readPercentChunk().

float A3DSLoader::readFloatPercent | ( | ) | `[protected]`

Definition at line 153 of file vl3DS.cpp.

References mInputFile, and vl::VirtualFile::readFloat().

Referenced by readPercentChunk().

void A3DSLoader::readChunk | ( | ) | `[protected]`

Definition at line 158 of file vl3DS.cpp.

References mChunkId, mChunkLen, mInputFile, vl::VirtualFile::readUInt16(), and vl::VirtualFile::readUInt32().

Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and readPercentChunk().

bool A3DSLoader::skipChunk | ( | ) | `[protected]`

Definition at line 164 of file vl3DS.cpp.

References vl::Log::error(), mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, and vl::VirtualFile::seekCur().

Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), and readMapChunk().

void A3DSLoader::read_3D_EDITOR_CHUNK | ( | ) | `[protected]`

Definition at line 177 of file vl3DS.cpp.

References vl::Log::error(), ID_MATERIAL_BLOCK, ID_OBJECT_BLOCK, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), readChunk(), vl::VirtualFile::size(), and skipChunk().

Referenced by parse3DS().

fvec3 A3DSLoader::readColChunk | ( | ) | `[protected]`

Definition at line 209 of file vl3DS.cpp.

References vl::Log::error(), ID_COLOR_24, ID_COLOR_F, ID_LIN_COLOR_24, ID_LIN_COLOR_F, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), readChunk(), readColByte3(), readColFloat3(), and vl::VirtualFile::size().

Referenced by read_MATERIAL_BLOCK().

float A3DSLoader::readPercentChunk | ( | ) | `[protected]`

Definition at line 246 of file vl3DS.cpp.

References ID_FLOAT_PERCENTAGE, ID_INT_PERCENTAGE, mChunkId, readChunk(), readFloatPercent(), and readWordPercent().

Referenced by read_MATERIAL_BLOCK().

void A3DSLoader::read_MATERIAL_BLOCK | ( | ) | `[protected]`

Definition at line 263 of file vl3DS.cpp.

References vl::Log::error(), ID_MAT_AMBIENT, ID_MAT_DIFFUSE, ID_MAT_SHININESS_PERCENT, ID_MAT_SHININESS_STRENGTH_PERCENT, ID_MAT_SPECULAR, ID_MAT_TEXMAP, ID_MAT_TEXMAP2, ID_MAT_TRANSPARENCY, ID_MAT_TWO_SIDE, ID_MATERIAL_NAME, vl::A3DSMaterial::mAmbient, mChunkId, mChunkLen, mCorrupted, vl::A3DSMaterial::mDiffuse, vl::A3DSMaterial::mDoubleSided, mInputFile, vl::A3DSMaterial::mMaterialName, mMaterials, mObjects, vl::A3DSMaterial::mShininess, vl::A3DSMaterial::mShininessStrength, vl::A3DSMaterial::mSpecular, vl::A3DSMaterial::mTexture1, vl::A3DSMaterial::mTexture2, vl::A3DSMaterial::mTransparency, vl::VirtualFile::position(), readChunk(), readColChunk(), readLine(), readMapChunk(), readPercentChunk(), vl::VirtualFile::size(), and skipChunk().

Referenced by read_3D_EDITOR_CHUNK().

A3DSTexture A3DSLoader::readMapChunk | ( | ) | `[protected]`

Definition at line 353 of file vl3DS.cpp.

References vl::defFileSystem(), vl::Log::error(), vl::String::extractPath(), ID_MAT_MAP_ROTATION, ID_MAT_MAP_TILING, ID_MAT_MAPNAME, ID_MAT_UOFFSET, ID_MAT_USCALE, ID_MAT_VOFFSET, ID_MAT_VSCALE, vl::FileSystem::locateFile(), mChunkId, mChunkLen, mCorrupted, vl::A3DSTexture::mFileName, mInputFile, mMaterials, mObjects, vl::A3DSTexture::mOpt_decal, vl::A3DSTexture::mOpt_ignore_alpha, vl::A3DSTexture::mOpt_mirror, vl::A3DSTexture::mOpt_negative, vl::A3DSTexture::mOpt_one_channel_tint, vl::A3DSTexture::mOpt_rgb_tint, vl::A3DSTexture::mOpt_summed_area, vl::A3DSTexture::mOpt_tile, vl::A3DSTexture::mOpt_use_alpha, vl::A3DSTexture::mRotation, vl::A3DSTexture::mUOffset, vl::A3DSTexture::mUScale, vl::A3DSTexture::mVOffset, vl::A3DSTexture::mVScale, vl::VirtualFile::path(), vl::VirtualFile::position(), readChunk(), vl::VirtualFile::readFloat(), readLine(), vl::VirtualFile::readUInt16(), vl::VirtualFile::size(), and skipChunk().

Referenced by read_MATERIAL_BLOCK().

void A3DSLoader::read_OBJECT_BLOCK | ( | ) | `[protected]`

Definition at line 442 of file vl3DS.cpp.

References vl::Log::error(), ID_TRIANGULAR_MESH, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), read_TRIANGULAR_MESH(), readChunk(), readLine(), vl::VirtualFile::size(), and skipChunk().

Referenced by read_3D_EDITOR_CHUNK().

void A3DSLoader::read_TRIANGULAR_MESH | ( | ) | `[protected]`

Definition at line 478 of file vl3DS.cpp.

References vl::Log::error(), ID_FACE_LIST, ID_FACE_MATERIAL_LIST, ID_LOCAL_COORDS_SYSTEM, ID_MAPPING_COORDS, ID_SMOOTHING_GROUP_LIST, ID_VERTEX_LIST, mChunkId, mChunkLen, mCorrupted, mInputFile, mMaterials, mObjects, vl::VirtualFile::position(), vl::VirtualFile::read(), readChunk(), vl::VirtualFile::readFloat(), readLine(), vl::VirtualFile::readUInt16(), vl::VirtualFile::readUInt32(), readVec3(), vl::Vector2< T_Scalar >::s(), vl::Matrix4< T_Scalar >::setT(), vl::Matrix4< T_Scalar >::setX(), vl::Matrix4< T_Scalar >::setY(), vl::Matrix4< T_Scalar >::setZ(), vl::VirtualFile::size(), skipChunk(), and vl::Vector2< T_Scalar >::t().

Referenced by read_OBJECT_BLOCK().

## Member Data Documentation

std::vector<A3DSObject> vl::A3DSLoader::mObjects

Definition at line 225 of file vl3DS.hpp.

Referenced by vl::load3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().

std::vector<A3DSMaterial> vl::A3DSLoader::mMaterials

Definition at line 226 of file vl3DS.hpp.

Referenced by vl::load3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().

VirtualFile* vl::A3DSLoader::mInputFile`[protected]`

Definition at line 229 of file vl3DS.hpp.

Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColByte3(), readColChunk(), readColFloat3(), readFloatPercent(), readLine(), readMapChunk(), readVec3(), readWordPercent(), and skipChunk().

unsigned short vl::A3DSLoader::mChunkId`[protected]`

Definition at line 230 of file vl3DS.hpp.

Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColChunk(), readMapChunk(), and readPercentChunk().

unsigned int vl::A3DSLoader::mChunkLen`[protected]`

Definition at line 231 of file vl3DS.hpp.

Referenced by read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readChunk(), readColChunk(), readMapChunk(), and skipChunk().

bool vl::A3DSLoader::mCorrupted`[protected]`

Definition at line 232 of file vl3DS.hpp.

Referenced by parse3DS(), read_3D_EDITOR_CHUNK(), read_MATERIAL_BLOCK(), read_OBJECT_BLOCK(), read_TRIANGULAR_MESH(), readColChunk(), readMapChunk(), and skipChunk().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/vl3DS.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/vl3DS.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.