# Ogre::SceneManagerEnumerator Class Reference
[Scene]

Enumerates the SceneManager classes available to applications. More...

`#include <OgreSceneManagerEnumerator.h>`

Inheritance diagram for Ogre::SceneManagerEnumerator:
[legend]

List of all members.

## Public Types

typedef map< String, SceneManager * >::type | Instances
| Scene manager instances, indexed by instance name.
typedef vector< const SceneManagerMetaData * >::type | MetaDataList
| List of available scene manager types as meta data.
typedef ConstVectorIterator < MetaDataList > | MetaDataIterator
typedef MapIterator< Instances > | SceneManagerIterator

## Public Member Functions

| SceneManagerEnumerator ()
| ~SceneManagerEnumerator ()
void | addFactory (SceneManagerFactory *fact)
| Register a new SceneManagerFactory.
void | removeFactory (SceneManagerFactory *fact)
| Remove a SceneManagerFactory.
const SceneManagerMetaData * | getMetaData (const String &typeName) const
| Get more information about a given type of SceneManager.
MetaDataIterator | getMetaDataIterator (void) const
| Iterate over all types of SceneManager available for construction, providing some information about each one.
SceneManager * | createSceneManager (const String &typeName, const String &instanceName=StringUtil::BLANK)
| Create a SceneManager instance of a given type.
SceneManager * | createSceneManager (SceneTypeMask typeMask, const String &instanceName=StringUtil::BLANK)
| Create a SceneManager instance based on scene type support.
void | destroySceneManager (SceneManager *sm)
| Destroy an instance of a SceneManager.
SceneManager * | getSceneManager (const String &instanceName) const
| Get an existing SceneManager instance that has already been created, identified by the instance name.
bool | hasSceneManager (const String &instanceName) const
| Identify if a SceneManager instance already exists.
SceneManagerIterator | getSceneManagerIterator (void)
| Get an iterator over all the existing SceneManager instances.
void | setRenderSystem (RenderSystem *rs)
| Notifies all SceneManagers of the destination rendering system.
void | shutdownAll (void)
| Utility method to control shutdown of the managers.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)

## Static Public Member Functions

static SceneManagerEnumerator & | getSingleton (void)
| Override standard Singleton retrieval.
static SceneManagerEnumerator * | getSingletonPtr (void)
| Override standard Singleton retrieval.
static SceneManagerEnumerator & | getSingleton (void)
static SceneManagerEnumerator * | getSingletonPtr (void)

## Static Protected Attributes

static SceneManagerEnumerator * | ms_Singleton

## Private Types

typedef list < SceneManagerFactory * > ::type | Factories
| Scene manager factories.

## Private Attributes

Factories | mFactories
Instances | mInstances
MetaDataList | mMetaDataList
| Stored separately to allow iteration.
DefaultSceneManagerFactory | mDefaultFactory
| Factory for default scene manager.
unsigned long | mInstanceCreateCount
| Count of creations for auto-naming.
RenderSystem * | mCurrentRenderSystem
| Currently assigned render system.

## Detailed Description

Enumerates the SceneManager classes available to applications.

Remarks:
  As described in the SceneManager class, SceneManagers are responsible for organising the scene and issuing rendering commands to the RenderSystem. Certain scene types can benefit from different rendering approaches, and it is intended that subclasses will be created to special case this.

  In order to give applications easy access to these implementations, this class has a number of methods to create or retrieve a SceneManager which is appropriate to the scene type.

  SceneManagers are created by SceneManagerFactory instances. New factories for new types of SceneManager can be registered with this class to make them available to clients.

  Note that you can still plug in your own custom SceneManager without using a factory, should you choose, it's just not as flexible that way. Just instantiate your own SceneManager manually and use it directly.

Definition at line 87 of file OgreSceneManagerEnumerator.h.

## Member Typedef Documentation

typedef list<SceneManagerFactory*>::type Ogre::SceneManagerEnumerator::Factories `[private]`

Scene manager factories.

Definition at line 96 of file OgreSceneManagerEnumerator.h.

typedef map<String, SceneManager*>::type Ogre::SceneManagerEnumerator::Instances

Scene manager instances, indexed by instance name.

Definition at line 91 of file OgreSceneManagerEnumerator.h.

typedef ConstVectorIterator<MetaDataList> Ogre::SceneManagerEnumerator::MetaDataIterator

Definition at line 134 of file OgreSceneManagerEnumerator.h.

typedef vector<const SceneManagerMetaData*>::type Ogre::SceneManagerEnumerator::MetaDataList

List of available scene manager types as meta data.

Definition at line 93 of file OgreSceneManagerEnumerator.h.

typedef MapIterator<Instances> Ogre::SceneManagerEnumerator::SceneManagerIterator

Definition at line 183 of file OgreSceneManagerEnumerator.h.

## Constructor & Destructor Documentation

Ogre::SceneManagerEnumerator::SceneManagerEnumerator | ( |  | ) |

Ogre::SceneManagerEnumerator::~SceneManagerEnumerator | ( |  | ) |

## Member Function Documentation

void Ogre::SceneManagerEnumerator::addFactory | ( | SceneManagerFactory * | fact | ) |

Register a new SceneManagerFactory.

Remarks:
  Plugins should call this to register as new SceneManager providers.

SceneManager* Ogre::SceneManagerEnumerator::createSceneManager | ( | const String & | typeName,
|  | const String & | instanceName = `StringUtil::BLANK` |
| ) |  |  |

Create a SceneManager instance of a given type.

Remarks:
  You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from getMetaDataIterator.

Note:
  This method throws an exception if the named type is not found.

Parameters:

  | typeName | String identifying a unique SceneManager type
  | instanceName | Optional name to given the new instance that is created. If you leave this blank, an auto name will be assigned.

SceneManager* Ogre::SceneManagerEnumerator::createSceneManager | ( | SceneTypeMask | typeMask,
|  | const String & | instanceName = `StringUtil::BLANK` |
| ) |  |  |

Create a SceneManager instance based on scene type support.

Remarks:
  Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.

Note:
  This method always succeeds, if a specific scene manager is not found, the default implementation is always returned.

Parameters:

  | typeMask | A mask containing one or more SceneType flags
  | instanceName | Optional name to given the new instance that is created. If you leave this blank, an auto name will be assigned.

void Ogre::SceneManagerEnumerator::destroySceneManager | ( | SceneManager * | sm | ) |

Destroy an instance of a SceneManager.

const SceneManagerMetaData* Ogre::SceneManagerEnumerator::getMetaData | ( | const String & | typeName | ) | const

Get more information about a given type of SceneManager.

Remarks:
  The metadata returned tells you a few things about a given type of SceneManager, which can be created using a factory that has been registered already.

Parameters:

  | typeName | The type name of the SceneManager you want to enquire on. If you don't know the typeName already, you can iterate over the metadata for all types using getMetaDataIterator.

MetaDataIterator Ogre::SceneManagerEnumerator::getMetaDataIterator | ( | void |  | ) | const

Iterate over all types of SceneManager available for construction, providing some information about each one.

SceneManager* Ogre::SceneManagerEnumerator::getSceneManager | ( | const String & | instanceName | ) | const

Get an existing SceneManager instance that has already been created, identified by the instance name.

Parameters:

  | instanceName | The name of the instance to retrieve.

SceneManagerIterator Ogre::SceneManagerEnumerator::getSceneManagerIterator | ( | void |  | ) |

Get an iterator over all the existing SceneManager instances.

static SceneManagerEnumerator& Ogre::SceneManagerEnumerator::getSingleton | ( | void |  | ) | `[static]`

Override standard Singleton retrieval.

Remarks:
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

static SceneManagerEnumerator & Ogre::Singleton< SceneManagerEnumerator >::getSingleton | ( | void |  | ) | `[static, inherited]`

Definition at line 90 of file OgreSingleton.h.

static SceneManagerEnumerator * Ogre::Singleton< SceneManagerEnumerator >::getSingletonPtr | ( | void |  | ) | `[static, inherited]`

Definition at line 92 of file OgreSingleton.h.

static SceneManagerEnumerator* Ogre::SceneManagerEnumerator::getSingletonPtr | ( | void |  | ) | `[static]`

Override standard Singleton retrieval.

Remarks:
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

bool Ogre::SceneManagerEnumerator::hasSceneManager | ( | const String & | instanceName | ) | const

Identify if a SceneManager instance already exists.

Parameters:

  | instanceName | The name of the instance to retrieve.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

void Ogre::SceneManagerEnumerator::removeFactory | ( | SceneManagerFactory * | fact | ) |

Remove a SceneManagerFactory.

void Ogre::SceneManagerEnumerator::setRenderSystem | ( | RenderSystem * | rs | ) |

Notifies all SceneManagers of the destination rendering system.

void Ogre::SceneManagerEnumerator::shutdownAll | ( | void |  | ) |

Utility method to control shutdown of the managers.

## Member Data Documentation

RenderSystem* Ogre::SceneManagerEnumerator::mCurrentRenderSystem `[private]`

Currently assigned render system.

Definition at line 106 of file OgreSceneManagerEnumerator.h.

DefaultSceneManagerFactory Ogre::SceneManagerEnumerator::mDefaultFactory `[private]`

Factory for default scene manager.

Definition at line 102 of file OgreSceneManagerEnumerator.h.

Factories Ogre::SceneManagerEnumerator::mFactories `[private]`

Definition at line 97 of file OgreSceneManagerEnumerator.h.

unsigned long Ogre::SceneManagerEnumerator::mInstanceCreateCount `[private]`

Count of creations for auto-naming.

Definition at line 104 of file OgreSceneManagerEnumerator.h.

Instances Ogre::SceneManagerEnumerator::mInstances `[private]`

Definition at line 98 of file OgreSceneManagerEnumerator.h.

MetaDataList Ogre::SceneManagerEnumerator::mMetaDataList `[private]`

Stored separately to allow iteration.

Definition at line 100 of file OgreSceneManagerEnumerator.h.

SceneManagerEnumerator * Ogre::Singleton< SceneManagerEnumerator >::ms_Singleton `[static, protected, inherited]`

Definition at line 75 of file OgreSingleton.h.

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

- OgreSceneManagerEnumerator.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:25:00