Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::MeshManager Class Reference

This manager handles the storage, generation, and query of of Graphics Meshes. More...

#include <meshmanager.h>

+ Inheritance diagram for Mezzanine::Graphics::MeshManager:
+ Collaboration diagram for Mezzanine::Graphics::MeshManager:

Public Types

typedef MeshContainer::const_iterator ConstMeshIterator
 Const Iterator type for Mesh instances stored in this class.
 
typedef std::map< String, Mesh * > MeshContainer
 Basic container type for Mesh storage in this class.
 
typedef MeshContainer::iterator MeshIterator
 Iterator type for Mesh instances stored in this class.
 
- Public Types inherited from Mezzanine::ManagerBase
enum  ManagerType {
  MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3,
  MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7,
  MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11,
  MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15,
  MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104,
  MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108,
  MT_VehicleManager = 109, MT_UserCreated = 512
}
 A listing of Manager Types. More...
 

Public Member Functions

 MeshManager ()
 Class constructor.
 
 MeshManager (const XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~MeshManager ()
 Class destructor.
 
Ogre::MeshManager * _GetInternalManager () const
 Gets the internal MeshManager. More...
 
Mesh_WrapInternalMesh (Ogre::MeshPtr ToWrap)
 Wraps and stores an Ogre Mesh instance. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
virtual String GetImplementationTypeName () const
 This Allows any manager name to be sent to a stream. Primarily used for logging. More...
 
virtual ManagerType GetInterfaceType () const
 This returns the type of this manager. More...
 
MeshGetMesh (const String &MeshName)
 Gets a Mesh stored in this manager. More...
 
Whole GetNumMeshes ()
 Gets the number of currently loaded meshes. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
MeshLoadMesh (const String &ResourceName, const String &ResourceGroup)
 Loads a Mesh file from an asset group and prepares it for use. More...
 
MeshLoadMesh (const String &FilePathAndName)
 Loads a Mesh file from disk and prepares it for use. More...
 
MeshLoadMesh (std::istream *Stream)
 Loads an Mesh from an input stream. More...
 
void SaveMesh (Mesh *ToSave, const String &FileName, const String &GroupName)
 Writes a Mesh to the asset group. More...
 
void SaveMesh (Mesh *ToSave, const String &FilePathAndName)
 Writes a Mesh to the disk. More...
 
void SaveMesh (Mesh *ToSave, std::ostream *Stream)
 Writes a Mesh in a final serializable form to an output stream. More...
 
void UnloadAllMeshes ()
 Unloads every Mesh that is currently loaded.
 
void UnloadMesh (const String &MeshName)
 Unloads a Mesh from memory. More...
 
- Public Member Functions inherited from Mezzanine::EntresolManager
 EntresolManager ()
 Class constructor.
 
virtual ~EntresolManager ()
 Class destructor.
 
- Public Member Functions inherited from Mezzanine::ManagerBase
 ManagerBase ()
 Class constructor.
 
virtual ~ManagerBase ()
 Class destructor.
 
virtual String GetInterfaceTypeAsString () const
 Gets a string of the interface type of this manager. More...
 
Boole IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 
- Public Member Functions inherited from Mezzanine::Singleton< MeshManager >
 ~Singleton ()
 Class destructor.
 

Static Public Attributes

static const String ImplementationName = "DefaultMeshManager"
 A String containing the name of this manager implementation.
 
static const ManagerBase::ManagerType InterfaceType = ManagerBase::MT_MeshManager
 A ManagerType enum value used to describe the type of interface/functionality this manager provides.
 

Protected Member Functions

virtual void AddMesh (Mesh *ToAdd)
 Adds a Mesh to this manager.

Exceptions
Ifthe name of the Mesh being added is not unique a II_DUPLICATE_IDENTITY_EXCEPTION will be thrown.
More...
 
- Protected Member Functions inherited from Mezzanine::Singleton< MeshManager >
 Singleton ()
 Class constructor.
 

Protected Attributes

MeshContainer Meshes
 Container storing all of the currently loaded Meshes. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
Boole Initialized
 Simple Boole indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Mezzanine::ManagerBase
static String GetTypeAsString (const ManagerType &ManagerType)
 Gets the string form of the type of manager. More...
 
static ManagerType GetTypeFromString (const String &ManagerName)
 Gets the type of manager requested from a string. More...
 
- Static Public Member Functions inherited from Mezzanine::Singleton< MeshManager >
static MeshManager * GetSingletonPtr ()
 Fetches a pointer to the singleton. More...
 
static Boole SingletonValid ()
 Checks to see if the singleton pointer is valid. More...
 
- Static Protected Attributes inherited from Mezzanine::Singleton< MeshManager >
static MeshManager * SingletonPtr
 The one and only pointer to the single object. More...
 

Detailed Description

This manager handles the storage, generation, and query of of Graphics Meshes.

Definition at line 76 of file meshmanager.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::MeshManager::MeshManager ( const XML::Node XMLNode)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.
Todo:
This class currently doesn't initialize anything from XML, if that changes this constructor needs to be expanded.

Definition at line 65 of file meshmanager.cpp.

Member Function Documentation

Ogre::MeshManager * Mezzanine::Graphics::MeshManager::_GetInternalManager ( ) const

Gets the internal MeshManager.

Returns
Returns a pointer to the internal MeshManager.

Definition at line 200 of file meshmanager.cpp.

Mesh * Mezzanine::Graphics::MeshManager::_WrapInternalMesh ( Ogre::MeshPtr  ToWrap)

Wraps and stores an Ogre Mesh instance.

Parameters
ToWrapThe Ogre Mesh to get wrapped.
Returns
Returns a pointer to the wrapped Mesh.

Definition at line 193 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::AddMesh ( Mesh ToAdd)
protectedvirtual

Adds a Mesh to this manager.

Exceptions
Ifthe name of the Mesh being added is not unique a II_DUPLICATE_IDENTITY_EXCEPTION will be thrown.

Parameters
ToAddThe Mesh to be added.

Definition at line 76 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::Deinitialize ( )
virtual

Removes this manager from any necessary configuration so it can be safely disposed of.

Implements Mezzanine::ManagerBase.

Definition at line 178 of file meshmanager.cpp.

String Mezzanine::Graphics::MeshManager::GetImplementationTypeName ( ) const
virtual

This Allows any manager name to be sent to a stream. Primarily used for logging.

Returns
This returns a String that contains the name.

Implements Mezzanine::ManagerBase.

Definition at line 187 of file meshmanager.cpp.

ManagerBase::ManagerType Mezzanine::Graphics::MeshManager::GetInterfaceType ( ) const
virtual

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 184 of file meshmanager.cpp.

Mesh * Mezzanine::Graphics::MeshManager::GetMesh ( const String MeshName)

Gets a Mesh stored in this manager.

Parameters
MeshNameThe name of the Mesh to retrieve.
Returns
Returns a pointer to the requested Mesh.

Definition at line 158 of file meshmanager.cpp.

Whole Mezzanine::Graphics::MeshManager::GetNumMeshes ( )

Gets the number of currently loaded meshes.

Returns
Returns a Whole representing the number of meshes currently loaded.

Definition at line 167 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::Initialize ( )
virtual

Configures this manager for use prior to entering the main loop.

Implements Mezzanine::ManagerBase.

Definition at line 175 of file meshmanager.cpp.

Mesh * Mezzanine::Graphics::MeshManager::LoadMesh ( const String ResourceName,
const String ResourceGroup 
)

Loads a Mesh file from an asset group and prepares it for use.

Parameters
ResourceNameThe name of the Mesh file to be loaded.
ResourceGroupThe resource group from which the Mesh file should be loaded.
Returns
Returns a pointer to the loaded Mesh.

Definition at line 90 of file meshmanager.cpp.

Mesh * Mezzanine::Graphics::MeshManager::LoadMesh ( const String FilePathAndName)

Loads a Mesh file from disk and prepares it for use.

Parameters
FilePathAndNameThe full path and filename of the Mesh to be read.
Returns
Returns a pointer to the loaded Mesh.

Definition at line 99 of file meshmanager.cpp.

Mesh * Mezzanine::Graphics::MeshManager::LoadMesh ( std::istream *  Stream)

Loads an Mesh from an input stream.

Parameters
StreamA pointer to the stream to load the Mesh from.
Returns
Returns a pointer to the loaded Mesh.

Definition at line 114 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::SaveMesh ( Mesh ToSave,
const String FileName,
const String GroupName 
)

Writes a Mesh to the asset group.

Parameters
ToSaveThe Mesh to be saved.
FileNameThe name of the file to save the Mesh as.
GroupNameThe name of the asset group to save the Mesh to.

Definition at line 140 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::SaveMesh ( Mesh ToSave,
const String FilePathAndName 
)

Writes a Mesh to the disk.

Parameters
ToSaveThe Mesh to be saved.
FilePathAndNameThe full path and filename of the Mesh to be written.

Definition at line 145 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::SaveMesh ( Mesh ToSave,
std::ostream *  Stream 
)

Writes a Mesh in a final serializable form to an output stream.

Parameters
ToSaveThe Mesh to be saved.
StreamA pointer to the stream to save the Mesh to.

Definition at line 151 of file meshmanager.cpp.

void Mezzanine::Graphics::MeshManager::UnloadMesh ( const String MeshName)

Unloads a Mesh from memory.

Parameters
MeshNameThe name of the Mesh to be unloaded.

Definition at line 121 of file meshmanager.cpp.

Member Data Documentation

MeshContainer Mezzanine::Graphics::MeshManager::Meshes
protected

Container storing all of the currently loaded Meshes.

Definition at line 93 of file meshmanager.h.


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