OGRE  2.0
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 "OgrePCZPrerequisites.h"
41 #include "OgreSingleton.h"
42 #include "OgreIteratorWrappers.h"
43 
44 namespace Ogre
45 {
46  class PCZSceneManager;
47  class PCZone;
48 
51  {
52  public:
53  PCZoneFactory(const String & typeName);
54  virtual ~PCZoneFactory();
55  virtual bool supportsPCZoneType(const String& zoneType) = 0;
56  virtual PCZone* createPCZone(PCZSceneManager * pczsm, const String& zoneName) = 0;
57  const String& getFactoryTypeName() const { return mFactoryTypeName; }
60  };
61 
62  // Factory for default zone
64  {
65  public:
67  virtual ~DefaultZoneFactory();
68  bool supportsPCZoneType(const String& zoneType);
69  PCZone* createPCZone(PCZSceneManager * pczsm, const String& zoneName);
70  };
71 
72  // PCZoneFactory manager class
73  class _OgrePCZPluginExport PCZoneFactoryManager : public Singleton<PCZoneFactoryManager>, public SceneCtlAllocatedObject
74  {
75  public:
78  void registerPCZoneFactory(PCZoneFactory* factory);
79  void unregisterPCZoneFactory(PCZoneFactory* factory);
80  PCZone* createPCZone(PCZSceneManager * pczsm,
81  const String& zoneType,
82  const String& zoneName);
98  static PCZoneFactoryManager& getSingleton(void);
114  static PCZoneFactoryManager* getSingletonPtr(void);
115  /* PCZoneFactory Iterator - for querying what types of PCZone
116  factories are available */
120  PCZoneFactoryIterator getPCZoneFactoryIterator(void);
121 
122  protected:
125  };
126 }
127 
128 #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
Definition: OgreCommon.h:53
const String & getFactoryTypeName() const
MapIterator< PCZoneFactoryMap > PCZoneFactoryIterator
map< String, PCZoneFactory * >::type PCZoneFactoryMap
Specialized SceneManager that uses Portal-Connected-Zones to divide the scene spatially.