OgreSceneManagerEnumerator.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __SceneManagerEnumerator_H__
#define __SceneManagerEnumerator_H__
#include "OgrePrerequisites.h"
#include "OgreSceneManager.h"
#include "OgreSingleton.h"
#include "OgreIteratorWrappers.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport DefaultSceneManagerFactory : public SceneManagerFactory
{
protected:
void initMetaData(void) const;
public:
DefaultSceneManagerFactory() {}
~DefaultSceneManagerFactory() {}
static const String FACTORY_TYPE_NAME;
SceneManager* createInstance(const String& instanceName);
void destroyInstance(SceneManager* instance);
};
class _OgreExport DefaultSceneManager : public SceneManager
{
public:
DefaultSceneManager(const String& name);
~DefaultSceneManager();
const String& getTypeName(void) const;
};
class _OgreExport SceneManagerEnumerator : public Singleton<SceneManagerEnumerator>, public SceneMgtAlloc
{
public:
typedef map<String, SceneManager*>::type Instances;
typedef vector<const SceneManagerMetaData*>::type MetaDataList;
private:
typedef list<SceneManagerFactory*>::type Factories;
Factories mFactories;
Instances mInstances;
MetaDataList mMetaDataList;
DefaultSceneManagerFactory mDefaultFactory;
unsigned long mInstanceCreateCount;
RenderSystem* mCurrentRenderSystem;
public:
SceneManagerEnumerator();
~SceneManagerEnumerator();
void addFactory(SceneManagerFactory* fact);
void removeFactory(SceneManagerFactory* fact);
const SceneManagerMetaData* getMetaData(const String& typeName) const;
typedef ConstVectorIterator<MetaDataList> MetaDataIterator;
MetaDataIterator getMetaDataIterator(void) const;
SceneManager* createSceneManager(const String& typeName,
const String& instanceName = StringUtil::BLANK);
SceneManager* createSceneManager(SceneTypeMask typeMask,
const String& instanceName = StringUtil::BLANK);
void destroySceneManager(SceneManager* sm);
SceneManager* getSceneManager(const String& instanceName) const;
bool hasSceneManager(const String& instanceName) const;
typedef MapIterator<Instances> SceneManagerIterator;
SceneManagerIterator getSceneManagerIterator(void);
void setRenderSystem(RenderSystem* rs);
void shutdownAll(void);
static SceneManagerEnumerator& getSingleton(void);
static SceneManagerEnumerator* getSingletonPtr(void);
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::SceneManagerEnumerator::Instances
map< String, SceneManager * >::type Instances
Scene manager instances, indexed by instance name.
Definition: OgreSceneManagerEnumerator.h:92
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::list
Definition: OgrePrerequisites.h:505
Ogre::SceneManagerEnumerator::mMetaDataList
MetaDataList mMetaDataList
Stored separately to allow iteration.
Definition: OgreSceneManagerEnumerator.h:101
Ogre::DefaultSceneManagerFactory::FACTORY_TYPE_NAME
static const String FACTORY_TYPE_NAME
Factory type name.
Definition: OgreSceneManagerEnumerator.h:55
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::SceneManagerEnumerator::Factories
list< SceneManagerFactory * >::type Factories
Scene manager factories.
Definition: OgreSceneManagerEnumerator.h:97
Ogre::DefaultSceneManagerFactory::DefaultSceneManagerFactory
DefaultSceneManagerFactory()
Definition: OgreSceneManagerEnumerator.h:52
Ogre::SceneManagerFactory
Class which will create instances of a given SceneManager.
Definition: OgreSceneManager.h:3637
Ogre::SceneManagerEnumerator::MetaDataIterator
ConstVectorIterator< MetaDataList > MetaDataIterator
Definition: OgreSceneManagerEnumerator.h:135
Ogre::SceneManagerEnumerator::mDefaultFactory
DefaultSceneManagerFactory mDefaultFactory
Factory for default scene manager.
Definition: OgreSceneManagerEnumerator.h:103
Ogre::SceneManagerEnumerator::MetaDataList
vector< const SceneManagerMetaData * >::type MetaDataList
List of available scene manager types as meta data.
Definition: OgreSceneManagerEnumerator.h:94
Ogre::DefaultSceneManagerFactory::~DefaultSceneManagerFactory
~DefaultSceneManagerFactory()
Definition: OgreSceneManagerEnumerator.h:53
Ogre::SceneTypeMask
uint16 SceneTypeMask
Bitmask containing scene types.
Definition: OgreSceneManager.h:3607
OgreSingleton.h
OgrePrerequisites.h
Ogre::RenderSystem
Defines the functionality of a 3D API.
Definition: OgreRenderSystem.h:125
Ogre::SceneManagerEnumerator
Enumerates the SceneManager classes available to applications.
Definition: OgreSceneManagerEnumerator.h:88
Ogre::SceneManagerEnumerator::mInstances
Instances mInstances
Definition: OgreSceneManagerEnumerator.h:99
Ogre::DefaultSceneManager
Default scene manager.
Definition: OgreSceneManagerEnumerator.h:60
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::SceneManagerMetaData
Structure containing information about a scene manager.
Definition: OgreSceneManager.h:3622
OgreHeaderSuffix.h
OgreSceneManager.h
OgreIteratorWrappers.h
Ogre::SceneManagerEnumerator::mInstanceCreateCount
unsigned long mInstanceCreateCount
Count of creations for auto-naming.
Definition: OgreSceneManagerEnumerator.h:105
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::DefaultSceneManagerFactory
Factory for default scene manager.
Definition: OgreSceneManagerEnumerator.h:47
Ogre::SceneManagerEnumerator::mCurrentRenderSystem
RenderSystem * mCurrentRenderSystem
Currently assigned render system.
Definition: OgreSceneManagerEnumerator.h:107
Ogre::ConstVectorIterator
Concrete IteratorWrapper for const access to the underlying container.
Definition: OgreIteratorWrapper.h:217
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::SceneManagerEnumerator::mFactories
Factories mFactories
Definition: OgreSceneManagerEnumerator.h:98
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::map
Definition: OgrePrerequisites.h:533
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::StringUtil::BLANK
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Ogre::SceneManagerEnumerator::SceneManagerIterator
MapIterator< Instances > SceneManagerIterator
Definition: OgreSceneManagerEnumerator.h:184
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58

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