OGRE  1.9
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-2014 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 
46  class _OgreExport DefaultSceneManagerFactory : public SceneManagerFactory
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:
63  DefaultSceneManager(const String& name);
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 
118  void addFactory(SceneManagerFactory* fact);
119 
122  void removeFactory(SceneManagerFactory* fact);
123 
133  const SceneManagerMetaData* getMetaData(const String& typeName) const;
134 
139  MetaDataIterator getMetaDataIterator(void) const;
140 
152  SceneManager* createSceneManager(const String& typeName,
153  const String& instanceName = StringUtil::BLANK);
154 
167  SceneManager* createSceneManager(SceneTypeMask typeMask,
168  const String& instanceName = StringUtil::BLANK);
169 
171  void destroySceneManager(SceneManager* sm);
172 
177  SceneManager* getSceneManager(const String& instanceName) const;
178 
182  bool hasSceneManager(const String& instanceName) const;
183 
186  SceneManagerIterator getSceneManagerIterator(void);
187 
190  void setRenderSystem(RenderSystem* rs);
191 
193  void shutdownAll(void);
209  static SceneManagerEnumerator& getSingleton(void);
225  static SceneManagerEnumerator* getSingletonPtr(void);
226 
227  };
228 
232 }
233 
234 #include "OgreHeaderSuffix.h"
235 
236 #endif
#define _OgreExport
Definition: OgrePlatform.h:260
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.