NSMeshes::TDeclarationManager Class Reference

This class manages vertex declarations loaded from files (TDeclaration type). More...

#include <Declaration.h>

Inheritance diagram for NSMeshes::TDeclarationManager:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

BOOL Initialize (void)
 This method loads all declarations according to configuration TGlobalsSystem::GetConfiguration().
TDeclarationGetDeclaration (const DWORD &vertexTypeNumber)
 This method returns declaration from specified file.

Static Public Member Functions

static TDeclarationManagerCreateDeclarationManager (TRenderer *renderer)
 Creates manager for vertex declarations.
static void DestroyDeclarationManager (TDeclarationManager *manager)
 Destroys manager for vertex declarations.

Detailed Description

This class manages vertex declarations loaded from files (TDeclaration type).

Application defines required vertex declarations in global configuration file via numbers. Number of file must be identical with vertex type. Vertex types are listed in MODELING/MESH.TXT.

Declaration manager must load all declarations when application is initialized. After it application may get vertex declarations via their numbers. If there is no specified vertex declarations then NULL is returned. You load declarations via method TDeclarationManager::Initialize().

Because vertex declaration is small renderer resource there isn't problem with memory. Thus when number of references reaches to zero declarations isn't destroyed. Vertex declarations are destroyed either when manager is destroyed or via special method. Application should always carefully use Release method - it may useful for debugging purposes etc.

Definition at line 201 of file Declaration.h.


Member Function Documentation

TDeclarationManager * TDeclarationManager::CreateDeclarationManager TRenderer renderer  )  [static]
 

Creates manager for vertex declarations.

Returns NULL if an error occured.

Parameters:
renderer [in] valid renderer

Definition at line 310 of file Declaration.cpp.

References TGlobalsSystem::GetLogFile(), Initialize(), and NSMath::NSStdMath::log().

Here is the call graph for this function:

void TDeclarationManager::DestroyDeclarationManager TDeclarationManager manager  )  [static]
 

Destroys manager for vertex declarations.

Destroyed manager should have no referenced declarations.

Parameters:
manager [in] manager to destroy

Definition at line 339 of file Declaration.cpp.

References TGlobalsSystem::GetLogFile(), and NSMath::NSStdMath::log().

Here is the call graph for this function:

TDeclaration * TDeclarationManager::GetDeclaration const DWORD vertexTypeNumber  ) 
 

This method returns declaration from specified file.

Warning:
Method can return NULL - this means declaration do not exists!!!.
Parameters:
vertexTypeNumber [in] vertex type number - see more information in MODELING/MESH.TXT

Definition at line 458 of file Declaration.cpp.

References TArrayPtrs< T, size, step >::GetSize().

Here is the call graph for this function:

BOOL TDeclarationManager::Initialize void   ) 
 

This method loads all declarations according to configuration TGlobalsSystem::GetConfiguration().

Method use section "graphic-declarations" in config file, where each item has format:

"number" = "file_with_declaration"

where number must be greater than or equal to zero and its determines vertex type specified in MODELING/MESH.TXT.

Warning:
Method returns TRUE if ALL declaration files specified in configuration file are loaded!!! If method returns FALSE you should destroy entire object and close application because without declarations there is no possible to use 3D graphic subsystem.

Method uses VFS!!!

Definition at line 368 of file Declaration.cpp.

References TArrayPtrs< T, size, step >::AddItem(), TString::c_str(), TArrayPtrs< T, size, step >::Clear(), DBGASSERT_GRAPHICLOW, FALSE, TGlobalsSystem::GetConfiguration(), TGlobalsSystem::GetLogFile(), NSConfigFile::TConfigFileSection::GetName(), NSConfigFile::TConfigFile::GetSection(), NSConfigFile::TConfigFileSection::GetSize(), NSConfigFile::TConfigFileSection::GetValue(), NSMeshes::TDeclaration::LoadDeclaration(), NSMath::NSStdMath::log(), TArrayPtrs< T, size, step >::Size(), and TString::ToInt().

Referenced by CreateDeclarationManager().

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:29 2007 for Joy4D by  doxygen 1.4.6-NO