OgreSceneManagerEnumerator.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __SceneManagerEnumerator_H__
29 #define __SceneManagerEnumerator_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 #include "OgreSceneManager.h"
34 #include "OgreSingleton.h"
35 #include "OgreIteratorWrappers.h"
36 #include "OgreHeaderPrefix.h"
37 
38 namespace Ogre {
39 
48  {
49  protected:
50  void initMetaData(void) const;
51  public:
55  static const String FACTORY_TYPE_NAME;
56  SceneManager* createInstance(const String& instanceName);
57  void destroyInstance(SceneManager* instance);
58  };
61  {
62  public:
65  const String& getTypeName(void) const;
66  };
67 
88  class _OgreExport SceneManagerEnumerator : public Singleton<SceneManagerEnumerator>, public SceneMgtAlloc
89  {
90  public:
95  private:
105  unsigned long mInstanceCreateCount;
108 
109 
110  public:
113 
119 
123 
133  const SceneManagerMetaData* getMetaData(const String& typeName) const;
134 
140 
153  const String& instanceName = StringUtil::BLANK);
154 
168  const String& instanceName = StringUtil::BLANK);
169 
172 
177  SceneManager* getSceneManager(const String& instanceName) const;
178 
182  bool hasSceneManager(const String& instanceName) const;
183 
187 
191 
193  void shutdownAll(void);
226 
227  };
228 
232 }
233 
234 #include "OgreHeaderSuffix.h"
235 
236 #endif
#define _OgreExport
Definition: OgrePlatform.h:257
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Concrete IteratorWrapper for const access to the underlying container.
Factory for default scene manager.
void initMetaData(void) const
Internal method to initialise the metadata, must be implemented.
void destroyInstance(SceneManager *instance)
Destroy an instance of a SceneManager.
SceneManager * createInstance(const String &instanceName)
Create a new instance of a SceneManager.
static const String FACTORY_TYPE_NAME
Factory type name.
const String & getTypeName(void) const
Retrieve the type name of this scene manager.
DefaultSceneManager(const String &name)
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Defines the functionality of a 3D API.
Enumerates the SceneManager classes available to applications.
static SceneManagerEnumerator & getSingleton(void)
Override standard Singleton retrieval.
RenderSystem * mCurrentRenderSystem
Currently assigned render system.
MetaDataIterator getMetaDataIterator(void) const
Iterate over all types of SceneManager available for construction, providing some information about e...
SceneManager * createSceneManager(SceneTypeMask typeMask, const String &instanceName=StringUtil::BLANK)
Create a SceneManager instance based on scene type support.
list< SceneManagerFactory * >::type Factories
Scene manager factories.
SceneManagerIterator getSceneManagerIterator(void)
Get an iterator over all the existing SceneManager instances.
vector< const SceneManagerMetaData * >::type MetaDataList
List of available scene manager types as meta data.
DefaultSceneManagerFactory mDefaultFactory
Factory for default scene manager.
map< String, SceneManager * >::type Instances
Scene manager instances, indexed by instance name.
unsigned long mInstanceCreateCount
Count of creations for auto-naming.
static SceneManagerEnumerator * getSingletonPtr(void)
Override standard Singleton retrieval.
void destroySceneManager(SceneManager *sm)
Destroy an instance of a SceneManager.
MetaDataList mMetaDataList
Stored separately to allow iteration.
SceneManager * createSceneManager(const String &typeName, const String &instanceName=StringUtil::BLANK)
Create a SceneManager instance of a given type.
bool hasSceneManager(const String &instanceName) const
Identify if a SceneManager instance already exists.
ConstVectorIterator< MetaDataList > MetaDataIterator
SceneManager * getSceneManager(const String &instanceName) const
Get an existing SceneManager instance that has already been created, identified by the instance name.
const SceneManagerMetaData * getMetaData(const String &typeName) const
Get more information about a given type of SceneManager.
void addFactory(SceneManagerFactory *fact)
Register a new SceneManagerFactory.
void removeFactory(SceneManagerFactory *fact)
Remove a SceneManagerFactory.
MapIterator< Instances > SceneManagerIterator
void setRenderSystem(RenderSystem *rs)
Notifies all SceneManagers of the destination rendering system.
void shutdownAll(void)
Utility method to control shutdown of the managers.
Class which will create instances of a given SceneManager.
Manages the organisation and rendering of a 'scene' i.e.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:65
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
uint16 SceneTypeMask
Bitmask containing scene types.
_StringBase String
Structure containing information about a scene manager.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.