OgreParticleSystemManager.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __ParticleSystemManager_H__
29#define __ParticleSystemManager_H__
30
31
32#include "OgrePrerequisites.h"
33#include "OgreParticleSystem.h"
34#include "OgreFrameListener.h"
35#include "OgreSingleton.h"
37#include "OgreScriptLoader.h"
39#include "OgreHeaderPrefix.h"
40
41namespace Ogre {
42
43 // Forward decl
44 class ParticleSystemFactory;
45
78 public Singleton<ParticleSystemManager>, public ScriptLoader, public FXAlloc
79 {
81 public:
86 protected:
88
91
94
97
100
102
103 // Factory instance
105
120
123 const String& resourceGroup);
128
129
130 public:
131
134
153
172
182
200
211 void removeTemplate(const String& name, bool deleteTemplate = true);
212
220
221
229
243
250
262
272
284
294
304
314
320 void _initialise(void);
321
323 const StringVector& getScriptPatterns(void) const;
325 void parseScript(DataStreamPtr& stream, const String& groupName);
328
338
339
343 {
345 mSystemTemplates.begin(), mSystemTemplates.end());
346 }
347
349 ParticleSystemFactory* _getFactory(void) { return mFactory; }
350
383
384 };
385
388 {
389 protected:
391 public:
394
396
397 const String& getType(void) const;
399
400 };
404}
405
406#include "OgreHeaderSuffix.h"
407
408#endif
409
#define _OgreExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Interface definition for a factory class which produces a certain kind of MovableObject,...
Abstract class defining a movable object in a scene.
Abstract class defining the interface to be implemented by creators of ParticleAffector subclasses.
Abstract class defining the interface to be implemented by particle affectors.
Abstract class defining the interface to be implemented by creators of ParticleEmitter subclasses.
Abstract class defining the interface to be implemented by particle emitters.
Factory object for creating ParticleSystem instances.
const String & getType(void) const
Get the type of the object to be created.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
Manages particle systems, particle system scripts (templates) and the available emitter & affector fa...
const StringVector & getScriptPatterns(void) const
Gets the file patterns which should be used to find scripts for this class.
void skipToNextOpenBrace(DataStreamPtr &chunk)
Internal script parsing method.
ParticleEmitterFactoryIterator getEmitterFactoryIterator(void)
Return an iterator over the emitter factories currently registered.
ParticleAffectorFactoryIterator getAffectorFactoryIterator(void)
Return an iterator over the affector factories currently registered.
void _destroyEmitter(ParticleEmitter *emitter)
Internal method for destroying an emitter.
void parseAffectorAttrib(const String &line, ParticleAffector *sys)
Internal script parsing method.
ParticleSystemTemplateIterator getTemplateIterator(void)
Gets an iterator over the list of particle system templates.
void parseEmitterAttrib(const String &line, ParticleEmitter *sys)
Internal script parsing method.
void _destroyAffector(ParticleAffector *affector)
Internal method for destroying an affector.
ParticleEmitter * _createEmitter(const String &emitterType, ParticleSystem *psys)
Internal method for creating a new emitter from a factory.
void addRendererFactory(ParticleSystemRendererFactory *factory)
Registers a factory class for creating ParticleSystemRenderer instances.
void addEmitterFactory(ParticleEmitterFactory *factory)
Adds a new 'factory' object for emitters to the list of available emitter types.
void removeTemplate(const String &name, bool deleteTemplate=true)
Removes a specified template from the ParticleSystemManager.
map< String, ParticleSystemRendererFactory * >::type ParticleSystemRendererFactoryMap
ParticleSystem * getTemplate(const String &name)
Retrieves a particle system template for possible modification.
void addAffectorFactory(ParticleAffectorFactory *factory)
Adds a new 'factory' object for affectors to the list of available affector types.
ParticleRendererFactoryIterator getRendererFactoryIterator(void)
Return an iterator over the renderer factories currently registered.
ParticleTemplateMap mSystemTemplates
Templates based on scripts.
MapIterator< ParticleTemplateMap > ParticleSystemTemplateIterator
ParticleAffectorFactoryMap mAffectorFactories
Factories for named affector types (can be extended using plugins)
void parseScript(DataStreamPtr &stream, const String &groupName)
Parse a script file.
void parseNewEmitter(const String &type, DataStreamPtr &chunk, ParticleSystem *sys)
Internal script parsing method.
void removeTemplatesByResourceGroup(const String &resourceGroup)
Removes all templates that belong to a secific Resource Group from the ParticleSystemManager.
void removeAllTemplates(bool deleteTemplate=true)
Removes a specified template from the ParticleSystemManager.
static ParticleSystemManager & getSingleton(void)
Override standard Singleton retrieval.
map< String, ParticleEmitterFactory * >::type ParticleEmitterFactoryMap
void destroySystemImpl(ParticleSystem *sys)
Internal implementation of destroySystem.
ParticleSystemFactory * _getFactory(void)
Get an instance of ParticleSystemFactory (internal use).
static ParticleSystemManager * getSingletonPtr(void)
Override standard Singleton retrieval.
ParticleSystem * createSystemImpl(const String &name, size_t quota, const String &resourceGroup)
Internal implementation of createSystem.
ParticleSystem * createTemplate(const String &name, const String &resourceGroup)
Create a new particle system template.
void parseNewAffector(const String &type, DataStreamPtr &chunk, ParticleSystem *sys)
Internal script parsing method.
map< String, ParticleSystem * >::type ParticleTemplateMap
ParticleSystem * createSystemImpl(const String &name, const String &templateName)
Internal implementation of createSystem.
ParticleSystemRenderer * _createRenderer(const String &rendererType)
Internal method for creating a new renderer from a factory.
void addTemplate(const String &name, ParticleSystem *sysTemplate)
Adds a new particle system template to the list of available templates.
void parseAttrib(const String &line, ParticleSystem *sys)
Internal script parsing method.
void _destroyRenderer(ParticleSystemRenderer *renderer)
Internal method for destroying a renderer.
void skipToNextCloseBrace(DataStreamPtr &chunk)
Internal script parsing method.
MapIterator< ParticleSystemRendererFactoryMap > ParticleRendererFactoryIterator
MapIterator< ParticleAffectorFactoryMap > ParticleAffectorFactoryIterator
Real getLoadingOrder(void) const
Gets the relative loading order of scripts of this type.
ParticleSystemRendererFactoryMap mRendererFactories
Map of renderer types to factories.
void _initialise(void)
Init method to be called by OGRE system.
MapIterator< ParticleEmitterFactoryMap > ParticleEmitterFactoryIterator
ParticleAffector * _createAffector(const String &affectorType, ParticleSystem *psys)
Internal method for creating a new affector from a factory.
map< String, ParticleAffectorFactory * >::type ParticleAffectorFactoryMap
ParticleEmitterFactoryMap mEmitterFactories
Factories for named emitter types (can be extended using plugins)
Abstract class definition of a factory object for ParticleSystemRenderer.
Abstract class defining the interface required to be implemented by classes which provide rendering c...
Class defining particle system based special effects.
Abstract class defining the interface used by classes which wish to perform script loading to define ...
Reference-counted shared pointer, used for objects where implicit destruction is required.
Template class for creating single-instance global classes.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition OgreCommon.h:550
_StringBase String
std::map< K, V, P, A > type

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