OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgrePCZoneFactory.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 OgrePCZoneFactory.h - PCZone Factory & Factory Manager
28 
29 -----------------------------------------------------------------------------
30 begin : Mon Apr 16 2007
31 author : Eric Cha
32 email : ericc@xenopi.com
33 Code Style Update :
34 -----------------------------------------------------------------------------
35 */
36 
37 #ifndef PCZONE_FACTORY_H
38 #define PCZONE_FACTORY_H
39 
40 #include <OgreSingleton.h>
41 #include "OgrePCZone.h"
42 
43 namespace Ogre
44 {
45  class PCZSceneManager;
46 
49  {
50  public:
51  PCZoneFactory(const String & typeName);
52  virtual ~PCZoneFactory();
53  virtual bool supportsPCZoneType(const String& zoneType) = 0;
54  virtual PCZone* createPCZone(PCZSceneManager * pczsm, const String& zoneName) = 0;
55  const String& getFactoryTypeName() const { return mFactoryTypeName; }
58  };
59 
60  // Factory for default zone
62  {
63  public:
65  virtual ~DefaultZoneFactory();
66  bool supportsPCZoneType(const String& zoneType);
67  PCZone* createPCZone(PCZSceneManager * pczsm, const String& zoneName);
68  };
69 
70  // PCZoneFactory manager class
71  class _OgrePCZPluginExport PCZoneFactoryManager : public Singleton<PCZoneFactoryManager>, public SceneCtlAllocatedObject
72  {
73  public:
76  void registerPCZoneFactory(PCZoneFactory* factory);
77  void unregisterPCZoneFactory(PCZoneFactory* factory);
78  PCZone* createPCZone(PCZSceneManager * pczsm,
79  const String& zoneType,
80  const String& zoneName);
96  static PCZoneFactoryManager& getSingleton(void);
112  static PCZoneFactoryManager* getSingletonPtr(void);
113  /* PCZoneFactory Iterator - for querying what types of PCZone
114  factories are available */
118  PCZoneFactoryIterator getPCZoneFactoryIterator(void);
119 
120  protected:
123  };
124 }
125 
126 #endif
Factory for PCZones.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
DefaultZoneFactory mDefaultFactory
String mFactoryTypeName
Factory type name.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
#define _OgrePCZPluginExport
PCZoneFactoryMap mPCZoneFactories
Portal-Connected Zone datastructure for managing scene nodes.
Definition: OgrePCZone.h:81
_StringBase String
const String & getFactoryTypeName() const
MapIterator< PCZoneFactoryMap > PCZoneFactoryIterator
map< String, PCZoneFactory * >::type PCZoneFactoryMap
Specialized SceneManager that uses Portal-Connected-Zones to divide the scene spatially.