MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Mezzanine::TerrainManager Class Reference

This is manager for terrains and their functions. More...

#include <terrainmanager.h>

+ Inheritance diagram for Mezzanine::TerrainManager:
+ Collaboration diagram for Mezzanine::TerrainManager:

Public Types

typedef
TerrainContainer::const_iterator 
ConstTerrainIterator
 Const Iterator type for TerrainBase instances stored by this class.
 
typedef std::vector
< TerrainBase * > 
TerrainContainer
 Basic container type for TerrainBase storage by this class.
 
typedef TerrainContainer::iterator TerrainIterator
 Iterator type for TerrainBase instances stored by this class.
 

Public Member Functions

 TerrainManager ()
 Class constructor.
 
 TerrainManager (XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~TerrainManager ()
 Class destructor.
 
virtual void AddTerrain (TerrainBase *Terrain)
 Adds a pre-made terrain to the world and the manager. More...
 
virtual MeshTerrainCreateMeshTerrain (const Vector3 &InitPosition, const String &name, const String &file, const String &group)
 Creates a terrain based on a given mesh. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
virtual void DestroyAllTerrains ()
 Removes and deletes all terrains currently in this manager from the world and the manager.
 
virtual void DestroyTerrain (const Whole &Index)
 Destroys a terrain and removes it from world. More...
 
virtual void DestroyTerrain (TerrainBase *ToBeDestroyed)
 Destroys a terrain and removes it from world. 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...
 
virtual Whole GetNumTerrains () const
 Gets the number of terrains being stored in this manager. More...
 
virtual TerrainBaseGetTerrainByIndex (const Whole &Index)
 Retrieves a MeshTerrain from the list of terrains. More...
 
virtual TerrainBaseGetTerrainByName (const String &Name)
 Retrieves a Meshterrain from the list of terrains. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
virtual void Pause (const UInt32 PL)
 Sets the pause state of this manager, or has no effect depending on the value passed in. More...
 
virtual void RemoveAllTerrains ()
 Removes all terrains currently in this manager from the world and the manager. More...
 
virtual void RemoveTerrain (const Whole &Index)
 Removes a terrain from the world and this manager by index. More...
 
virtual void RemoveTerrain (TerrainBase *ToBeRemoved)
 Removes a terrain from the world and this manager. More...
 
- Public Member Functions inherited from Mezzanine::WorldManager
 WorldManager ()
 Class constructor.
 
virtual ~WorldManager ()
 Class destructor.
 
virtual void _SetWorld (World *Parent)
 Sets the world this manager belongs to.

Exceptions
Ifthis manager is already initialized, this method will throw an "INVALID_STATE_EXCEPTION".
More...
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual bool IsPaused () const
 Gets whether or not this manager is currently paused. More...
 
- 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...
 
bool IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Protected Attributes

TerrainContainer Terrains
 A container of all terrain instances.
 
- Protected Attributes inherited from Mezzanine::WorldManager
bool OperationsPaused
 This stores whether or not processing for some or all objects in this manager has been paused. More...
 
WorldParentWorld
 A pointer to the world that created this manager. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
bool Initialized
 Simple bool 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...
 

Detailed Description

This is manager for terrains and their functions.

Definition at line 60 of file terrainmanager.h.

Constructor & Destructor Documentation

Mezzanine::TerrainManager::TerrainManager ( 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 55 of file terrainmanager.cpp.

Member Function Documentation

void Mezzanine::TerrainManager::AddTerrain ( TerrainBase Terrain)
virtual

Adds a pre-made terrain to the world and the manager.

Parameters
TerrainThe terrain to be added.

Definition at line 86 of file terrainmanager.cpp.

MeshTerrain * Mezzanine::TerrainManager::CreateMeshTerrain ( const Vector3 InitPosition,
const String name,
const String file,
const String group 
)
virtual

Creates a terrain based on a given mesh.

This method creates a terrain object and handles adding it to the world.

Parameters
InitPositionThe location of the terrain.
nameThe name of the terrain.
fileThe 3d mesh file that contains the 3d model the actor will use.
groupThe resource group where the 3d mesh and other related files can be found.
Returns
Returns a pointer to the created MeshTerrain object.

Definition at line 156 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::Deinitialize ( )
virtual

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

Implements Mezzanine::ManagerBase.

Definition at line 189 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::DestroyTerrain ( const Whole Index)
virtual

Destroys a terrain and removes it from world.

Parameters
IndexIndex of desired terrain in MeshTerrains.

Definition at line 122 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::DestroyTerrain ( TerrainBase ToBeDestroyed)
virtual

Destroys a terrain and removes it from world.

Parameters
Namename of desired terrain in MeshTerrains.

Definition at line 130 of file terrainmanager.cpp.

String Mezzanine::TerrainManager::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 203 of file terrainmanager.cpp.

ManagerBase::ManagerType Mezzanine::TerrainManager::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 200 of file terrainmanager.cpp.

Whole Mezzanine::TerrainManager::GetNumTerrains ( ) const
virtual

Gets the number of terrains being stored in this manager.

Returns
Returns a whole representing the number of terrains in this manager.

Definition at line 81 of file terrainmanager.cpp.

TerrainBase * Mezzanine::TerrainManager::GetTerrainByIndex ( const Whole Index)
virtual

Retrieves a MeshTerrain from the list of terrains.

Parameters
indexIndex of desired terrain in MeshTerrains.
Returns
Returns a pointer to the MeshTerrain at the given index.

Definition at line 66 of file terrainmanager.cpp.

TerrainBase * Mezzanine::TerrainManager::GetTerrainByName ( const String Name)
virtual

Retrieves a Meshterrain from the list of terrains.

Parameters
nameThe name of the terrain.
Returns
Returns a pointer to the named MeshTerrain, or NULL if no MeshTerrain exists with given name.

Definition at line 71 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::Initialize ( )
virtual

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

Exceptions
Ifthis is called while no valid world is set, this will throw an "INVALID_STATE_EXCEPTION".

Reimplemented from Mezzanine::WorldManager.

Definition at line 179 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::Pause ( const UInt32  PL)
virtual

Sets the pause state of this manager, or has no effect depending on the value passed in.

Parameters
PLA bitfield describing the pause level being assigned to the parent world of this manager.

Implements Mezzanine::WorldManager.

Definition at line 174 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::RemoveAllTerrains ( )
virtual

Removes all terrains currently in this manager from the world and the manager.

Todo:
When adding more types of terrains, it should be remembered that code should be added to clear the extra vectors.

Definition at line 112 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::RemoveTerrain ( const Whole Index)
virtual

Removes a terrain from the world and this manager by index.

Parameters
IndexThe index at which to remove the terrain.

Definition at line 92 of file terrainmanager.cpp.

void Mezzanine::TerrainManager::RemoveTerrain ( TerrainBase ToBeRemoved)
virtual

Removes a terrain from the world and this manager.

Parameters
ToBeRemovedThe terrain to be removed.

Definition at line 99 of file terrainmanager.cpp.


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