OGRE  2.0
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 "OgreHeaderPrefix.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, size_t numWorkerThreads,
56  InstancingTheadedCullingMethod threadedCullingMethod);
57  void destroyInstance(SceneManager* instance);
58  };
61  {
62  public:
63  DefaultSceneManager(const String& name, size_t numWorkerThreads,
64  InstancingTheadedCullingMethod threadedCullingMethod);
66  const String& getTypeName(void) const;
67  };
68 
89  class _OgreExport SceneManagerEnumerator : public Singleton<SceneManagerEnumerator>, public SceneMgtAlloc
90  {
91  public:
96  private:
106  unsigned long mInstanceCreateCount;
109 
110 
111  public:
114 
119  void addFactory(SceneManagerFactory* fact);
120 
123  void removeFactory(SceneManagerFactory* fact);
124 
134  const SceneManagerMetaData* getMetaData(const String& typeName) const;
135 
140  MetaDataIterator getMetaDataIterator(void) const;
141 
153  SceneManager* createSceneManager(const String& typeName, size_t numWorkerThreads,
154  InstancingTheadedCullingMethod threadedCullingMethod,
155  const String& instanceName = BLANKSTRING);
156 
169  SceneManager* createSceneManager(SceneTypeMask typeMask, size_t numWorkerThreads,
170  InstancingTheadedCullingMethod threadedCullingMethod,
171  const String& instanceName = BLANKSTRING );
172 
174  void destroySceneManager(SceneManager* sm);
175 
180  SceneManager* getSceneManager(const String& instanceName) const;
181 
185  bool hasSceneManager(const String& instanceName) const;
186 
189  SceneManagerIterator getSceneManagerIterator(void);
190 
193  void setRenderSystem(RenderSystem* rs);
194 
196  void shutdownAll(void);
212  static SceneManagerEnumerator& getSingleton(void);
228  static SceneManagerEnumerator* getSingletonPtr(void);
229 
230  };
231 
235 }
236 
237 #include "OgreHeaderSuffix.h"
238 
239 #endif
#define _OgreExport
Definition: OgrePlatform.h:255
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.
InstancingTheadedCullingMethod
There are two Instancing techniques that perform culling of their own: HW Basic HW VTF Frustum cullin...
const String BLANKSTRING
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreCommon.h:574
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...
uint16 SceneTypeMask
Bitmask containing scene types.
unsigned long mInstanceCreateCount
Count of creations for auto-naming.
Enumerates the SceneManager classes available to applications.
_StringBase String
Definition: OgreCommon.h:53
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.