NSMeshes::TMeshLoader Class Reference

This class contains static methods to load mesh. More...

#include <Mesh.h>

Inheritance diagram for NSMeshes::TMeshLoader:

Inheritance graph
[legend]
Collaboration diagram for NSMeshes::TMeshLoader:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static BOOL LoadMeshFromFile (const TString &filename, TMeshHeader &header, TArray< char > &vertices, TArray< WORD > &indices)
 This method loads mesh from specified mesh file.
static BOOL LoadMeshDataFromFile (const TString &filename, TMeshHeader &header, char **vertices, char **indices)
 This method loads mesh from specified mesh file.
static BOOL SaveMeshToFile (const TString &filename, const TMeshHeader &header, const TArray< char > &vertices, const TArray< WORD > &indices)
 This method save specified mesh file.

Detailed Description

This class contains static methods to load mesh.

Warning:
You CANNOT create instances of this class or derive another classes from this one.

Definition at line 80 of file Mesh.h.


Member Function Documentation

BOOL TMeshLoader::LoadMeshDataFromFile const TString filename,
TMeshHeader header,
char **  vertices,
char **  indices
[static]
 

This method loads mesh from specified mesh file.

Warning:
File is loaded from VFS thus this MUST be set properly!!!

This method allocates memory that must be deallocated by caller. Parameters VERTICES and INDICES will be set to new values !!! If method returns FALSE both values are invalid!!!

Parameters:
filename [in] name of file with mesh
header [out] structure for store header information
vertices [out] array with loaded vertices
indices [out] array with loaded indices

Definition at line 103 of file Mesh.cpp.

References DBGTEXT, DBGTEXTF, FALSE, NSFileSystem::TFSFileSystem::GetFile(), TGlobalsSystem::GetFileSystem(), and TString::GetString().

Here is the call graph for this function:

BOOL TMeshLoader::LoadMeshFromFile const TString filename,
TMeshHeader header,
TArray< char > &  vertices,
TArray< WORD > &  indices
[static]
 

This method loads mesh from specified mesh file.

Warning:
File is loaded from VFS thus this MUST be set properly!!!
Parameters:
filename [in] name of file with mesh
header [out] structure for store header information
vertices [out] array with loaded vertices
indices [out] array with loaded indices

Definition at line 29 of file Mesh.cpp.

References NSFileSystem::TVirtualFile::Close(), DBGNL, DBGTEXT, DBGTEXTF, FALSE, NSFileSystem::TFSFileSystem::GetFile(), TGlobalsSystem::GetFileSystem(), TString::GetString(), and NSFileSystem::TVirtualFile::Read().

Here is the call graph for this function:

BOOL TMeshLoader::SaveMeshToFile const TString filename,
const TMeshHeader header,
const TArray< char > &  vertices,
const TArray< WORD > &  indices
[static]
 

This method save specified mesh file.

Caller must provide valid header and array with required number of vertices and indices. In both arrays there may exist more items, but minimum number of items is checked.

Warning:
This method DO NOT use VFS because VFS is read-only system!!!
Parameters:
filename [in] name of file with mesh
header [in] structure for store header information
vertices [in] array with stored vertices
indices [in] array with stored indices

Definition at line 177 of file Mesh.cpp.

References DBGTEXTF, FALSE, TArray< T, align, size, step >::GetSize(), NSMeshes::TMeshHeader::m_indexCount, NSMeshes::TMeshHeader::m_magic, NSMeshes::TMeshHeader::m_vertexCount, and NSMeshes::TMeshHeader::m_vertexSize.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 23:08:38 2007 for Joy4D by  doxygen 1.4.6-NO