Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | 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 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

 TerrainManager (World *Creator)
 Class constructor.
 
 TerrainManager (World *Creator, const 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 (World *Creator)
 Class constructor. More...
 
virtual ~WorldManager ()
 Class destructor.
 
virtual WorldGetWorld () const
 Gets the world this manager belongs to. More...
 
virtual Boole 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...
 
Boole IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 

Static Public Attributes

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

Protected Attributes

TerrainContainer Terrains
 A container of all terrain instances. More...
 
- Protected Attributes inherited from Mezzanine::WorldManager
Boole 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
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...
 

Detailed Description

This is manager for terrains and their functions.

Definition at line 60 of file terrainmanager.h.

Constructor & Destructor Documentation

Mezzanine::TerrainManager::TerrainManager ( World Creator,
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 58 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 90 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 160 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 191 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 126 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 134 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 204 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 201 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 85 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 70 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 75 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 183 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 178 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 116 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 96 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 103 of file terrainmanager.cpp.

Member Data Documentation

TerrainContainer Mezzanine::TerrainManager::Terrains
protected

A container of all terrain instances.

Definition at line 77 of file terrainmanager.h.


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