OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
37 namespace Ogre {
38 
45  class _OgreExport DefaultSceneManagerFactory : public SceneManagerFactory
47  {
48  protected:
49  void initMetaData(void) const;
50  public:
54  static const String FACTORY_TYPE_NAME;
55  SceneManager* createInstance(const String& instanceName);
56  void destroyInstance(SceneManager* instance);
57  };
60  {
61  public:
62  DefaultSceneManager(const String& name);
64  const String& getTypeName(void) const;
65  };
66 
87  class _OgreExport SceneManagerEnumerator : public Singleton<SceneManagerEnumerator>, public SceneMgtAlloc
88  {
89  public:
94  private:
104  unsigned long mInstanceCreateCount;
107 
108 
109  public:
112 
117  void addFactory(SceneManagerFactory* fact);
118 
121  void removeFactory(SceneManagerFactory* fact);
122 
132  const SceneManagerMetaData* getMetaData(const String& typeName) const;
133 
138  MetaDataIterator getMetaDataIterator(void) const;
139 
151  SceneManager* createSceneManager(const String& typeName,
152  const String& instanceName = StringUtil::BLANK);
153 
166  SceneManager* createSceneManager(SceneTypeMask typeMask,
167  const String& instanceName = StringUtil::BLANK);
168 
170  void destroySceneManager(SceneManager* sm);
171 
176  SceneManager* getSceneManager(const String& instanceName) const;
177 
181  bool hasSceneManager(const String& instanceName) const;
182 
185  SceneManagerIterator getSceneManagerIterator(void);
186 
189  void setRenderSystem(RenderSystem* rs);
190 
192  void shutdownAll(void);
208  static SceneManagerEnumerator& getSingleton(void);
224  static SceneManagerEnumerator* getSingletonPtr(void);
225 
226  };
227 
231 }
232 
233 #endif
#define _OgreExport
Definition: OgrePlatform.h:233
map< String, SceneManager * >::type Instances
Scene manager instances, indexed by instance name.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
ConstVectorIterator< MetaDataList > MetaDataIterator
Manages the organisation and rendering of a 'scene' i.e.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
list< SceneManagerFactory * >::type Factories
Scene manager factories.
MetaDataList mMetaDataList
Stored separately to allow iteration.
vector< const SceneManagerMetaData * >::type MetaDataList
List of available scene manager types as meta data.
RenderSystem * mCurrentRenderSystem
Currently assigned render system.
DefaultSceneManagerFactory mDefaultFactory
Factory for default scene manager.
MapIterator< Instances > SceneManagerIterator
Concrete IteratorWrapper for const access to the underlying container.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
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.
unsigned long mInstanceCreateCount
Count of creations for auto-naming.
Enumerates the SceneManager classes available to applications.
_StringBase String
static const String FACTORY_TYPE_NAME
Factory type name.
Defines the functionality of a 3D API.
Factory for default scene manager.
Structure containing information about a scene manager.
Class which will create instances of a given SceneManager.