Xface Core Library: XEngine::MeshManager Class Reference

XFace / XEngine / XMath

XEngine::MeshManager Class Reference

#include <MeshManager.h>

List of all members.

Detailed Description

Koray Balci
May 2003
Meshes (IndexedFaceSet instances) are stored and managed through here. All the meshes are stored in a hash map (currently) with a string representing the name as the key of the hash. MeshManager is a singleton class.

Here is a typical usage in IModelLoader;

        IndexedFaceSet* m_pMesh = new IndexedFaceSet; // Create an instance (IndexedFaceSet IS-A IMesh)
        ... // Initialization, etc..
        // MeshManager is a singleton class.
        MeshManager::getInstance()->registerMesh(m_pMesh); // Add the mesh to MeshManager

And here is how we access the loaded Mesh (from RendererGL);

        Drawable* pDrawable; // Assume it is initialized correctly.
        std::string MeshName = pDrawable->getMeshName();
        const DeformableGeometry* pMesh = MeshManager::getInstance()->getMesh(MeshName);

Public Member Functions

void destroyAll ()
void registerMesh (DeformableGeometry *pMesh)
DeformableGeometry *const getMesh (const std::string &name) const

Static Public Member Functions

static void releaseInstance ()
static MeshManagergetInstance ()

Member Function Documentation

void XEngine::MeshManager::destroyAll  ) 

Destroys all of the meshes in the storage.

MeshManager * XEngine::MeshManager::getInstance  )  [static]

Singleton class accessor for the one and only instance of this class.

DeformableGeometry *const XEngine::MeshManager::getMesh const std::string &  name  )  const

Retrieves a mesh with the name passed.

0 if unsucessful, a valid pointer to IMesh if successful.

void XEngine::MeshManager::registerMesh DeformableGeometry pMesh  ) 

Registers a mesh object to the storage.

void XEngine::MeshManager::releaseInstance  )  [static]

Releases the one and only instance.

The documentation for this class was generated from the following files:
Generated on Mon Aug 28 15:39:26 2006 for Xface Core Library by  doxygen 1.4.6-NO