This class represents a collection of pages which make up a world. More...
#include <OgrePagedWorld.h>
Public Types | |
typedef map< String, PagedWorldSection * >::type | SectionMap |
Public Member Functions | |
PagedWorld (const String &name, PageManager *manager) | |
Constructor. More... | |
virtual | ~PagedWorld () |
virtual bool | _loadProceduralPage (Page *page, PagedWorldSection *section) |
Give a world the opportunity to prepare page content procedurally. More... | |
virtual bool | _prepareProceduralPage (Page *page, PagedWorldSection *section) |
Give a world the opportunity to prepare page content procedurally. More... | |
StreamSerialiser * | _readPageStream (PageID pageID, PagedWorldSection *section) |
Get a serialiser set up to read Page data for the given PageID. More... | |
virtual bool | _unloadProceduralPage (Page *page, PagedWorldSection *section) |
Give a world the opportunity to unload page content procedurally. More... | |
virtual bool | _unprepareProceduralPage (Page *page, PagedWorldSection *section) |
Give a world the opportunity to unprepare page content procedurally. More... | |
StreamSerialiser * | _writePageStream (PageID pageID, PagedWorldSection *section) |
Get a serialiser set up to read Page data for the given PageID. More... | |
PagedWorldSection * | createSection (SceneManager *sceneMgr, const String &typeName, const String §ionName=StringUtil::BLANK) |
Create a new section of the world based on a specialised type. More... | |
PagedWorldSection * | createSection (const String &strategyName, SceneManager *sceneMgr, const String §ionName=StringUtil::BLANK) |
Create a new manually defined section of the world. More... | |
PagedWorldSection * | createSection (PageStrategy *strategy, SceneManager *sceneMgr, const String §ionName=StringUtil::BLANK) |
Create a manually defined new section of the world. More... | |
void | destroyAllSections () |
Destroy all world sections. More... | |
void | destroySection (const String &name) |
Destroy a section of world. More... | |
void | destroySection (PagedWorldSection *sec) |
Destroy a section of world. More... | |
virtual void | frameEnd (Real timeElapsed) |
Called when the frame ends. More... | |
virtual void | frameStart (Real timeSinceLastFrame) |
Called when the frame starts. More... | |
PageManager * | getManager () const |
Get the manager of this world. More... | |
const String & | getName () const |
PageProvider * | getPageProvider () const |
Get the PageProvider which can provide streams for Pages in this world. More... | |
PagedWorldSection * | getSection (const String &name) |
Retrieve a section of the world. More... | |
size_t | getSectionCount () const |
Get the number of sections this world has. More... | |
const SectionMap & | getSections () const |
Retrieve a const reference to all the sections in this world. More... | |
void | load (const String &filename) |
Load world data from a file. More... | |
void | load (const DataStreamPtr &stream) |
Load world data from a stream. More... | |
bool | load (StreamSerialiser &stream) |
Load world data from a serialiser (returns true if successful) More... | |
virtual void | notifyCamera (Camera *cam) |
Notify a world of the current camera. More... | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void * | operator new[] (size_t sz) |
void | save (const String &filename) |
Save world data to a file. More... | |
void | save (const DataStreamPtr &stream) |
Save world data to a stream. More... | |
void | save (StreamSerialiser &stream) |
Save world data to a serialiser. More... | |
void | setPageProvider (PageProvider *provider) |
Set the PageProvider which can provide streams for Pages in this world. More... | |
Static Public Attributes | |
static const uint32 | CHUNK_ID |
static const uint32 | CHUNK_SECTIONDECLARATION_ID |
static const uint16 | CHUNK_VERSION |
Protected Attributes | |
PageManager * | mManager |
String | mName |
PageProvider * | mPageProvider |
NameGenerator | mSectionNameGenerator |
SectionMap | mSections |
Friends | |
_OgrePagingExport friend std::ostream & | operator<< (std::ostream &o, const PagedWorld &p) |
Function for writing to a stream. More... | |
This class represents a collection of pages which make up a world.
Definition at line 57 of file OgrePagedWorld.h.
typedef map<String, PagedWorldSection*>::type Ogre::PagedWorld::SectionMap |
Definition at line 161 of file OgrePagedWorld.h.
Ogre::PagedWorld::PagedWorld | ( | const String & | name, |
PageManager * | manager | ||
) |
Constructor.
name | The name of the world, which must be enough to identify the place where data for it can be loaded from (doesn't have to be a filename necessarily). |
manager | The PageManager that is in charge of providing this world with services such as related object factories. |
|
virtual |
|
virtual |
Give a world the opportunity to prepare page content procedurally.
|
virtual |
Give a world the opportunity to prepare page content procedurally.
StreamSerialiser* Ogre::PagedWorld::_readPageStream | ( | PageID | pageID, |
PagedWorldSection * | section | ||
) |
Get a serialiser set up to read Page data for the given PageID.
pageID | The ID of the page being requested |
section | The parent section to which this page will belong |
|
virtual |
Give a world the opportunity to unload page content procedurally.
|
virtual |
Give a world the opportunity to unprepare page content procedurally.
StreamSerialiser* Ogre::PagedWorld::_writePageStream | ( | PageID | pageID, |
PagedWorldSection * | section | ||
) |
Get a serialiser set up to read Page data for the given PageID.
pageID | The ID of the page being requested |
section | The parent section to which this page will belong |
PagedWorldSection* Ogre::PagedWorld::createSection | ( | SceneManager * | sceneMgr, |
const String & | typeName, | ||
const String & | sectionName = StringUtil::BLANK |
||
) |
Create a new section of the world based on a specialised type.
sceneMgr | The SceneManager to use for this section. |
typeName | The type of section to use (must be registered with PageManager), or blank to use the default type (simple grid) |
sectionName | An optional name to give the section (if none is provided, one will be generated) |
PagedWorldSection* Ogre::PagedWorld::createSection | ( | const String & | strategyName, |
SceneManager * | sceneMgr, | ||
const String & | sectionName = StringUtil::BLANK |
||
) |
Create a new manually defined section of the world.
strategyName | The name of the strategy to use (must be registered with PageManager) |
sceneMgr | The SceneManager to use for this section |
sectionName | An optional name to give the section (if none is provided, one will be generated) |
PagedWorldSection* Ogre::PagedWorld::createSection | ( | PageStrategy * | strategy, |
SceneManager * | sceneMgr, | ||
const String & | sectionName = StringUtil::BLANK |
||
) |
Create a manually defined new section of the world.
strategy | The strategy to use |
sceneMgr | The SceneManager to use for this section |
sectionName | An optional name to give the section (if none is provided, one will be generated) |
void Ogre::PagedWorld::destroyAllSections | ( | ) |
Destroy all world sections.
void Ogre::PagedWorld::destroySection | ( | const String & | name | ) |
Destroy a section of world.
void Ogre::PagedWorld::destroySection | ( | PagedWorldSection * | sec | ) |
Destroy a section of world.
|
virtual |
Called when the frame ends.
|
virtual |
Called when the frame starts.
|
inline |
Get the manager of this world.
Definition at line 80 of file OgrePagedWorld.h.
|
inline |
Definition at line 78 of file OgrePagedWorld.h.
|
inline |
Get the PageProvider which can provide streams for Pages in this world.
Definition at line 179 of file OgrePagedWorld.h.
PagedWorldSection* Ogre::PagedWorld::getSection | ( | const String & | name | ) |
Retrieve a section of the world.
|
inline |
Get the number of sections this world has.
Definition at line 156 of file OgrePagedWorld.h.
|
inline |
Retrieve a const reference to all the sections in this world.
Definition at line 163 of file OgrePagedWorld.h.
void Ogre::PagedWorld::load | ( | const String & | filename | ) |
Load world data from a file.
void Ogre::PagedWorld::load | ( | const DataStreamPtr & | stream | ) |
Load world data from a stream.
bool Ogre::PagedWorld::load | ( | StreamSerialiser & | stream | ) |
Load world data from a serialiser (returns true if successful)
|
virtual |
Notify a world of the current camera.
|
inlineinherited |
Definition at line 96 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 102 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 108 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 113 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 119 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
operator new, with debug line info
Definition at line 68 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 73 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
placement operator new
Definition at line 79 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
array operator new, with debug line info
Definition at line 86 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 91 of file OgreMemoryAllocatedObject.h.
void Ogre::PagedWorld::save | ( | const String & | filename | ) |
Save world data to a file.
filename | The name of the file to create; this can either be an absolute filename or |
void Ogre::PagedWorld::save | ( | const DataStreamPtr & | stream | ) |
Save world data to a stream.
void Ogre::PagedWorld::save | ( | StreamSerialiser & | stream | ) |
Save world data to a serialiser.
|
inline |
Set the PageProvider which can provide streams for Pages in this world.
Definition at line 176 of file OgrePagedWorld.h.
|
friend |
Function for writing to a stream.
|
static |
Definition at line 65 of file OgrePagedWorld.h.
|
static |
Definition at line 67 of file OgrePagedWorld.h.
|
static |
Definition at line 66 of file OgrePagedWorld.h.
|
protected |
Definition at line 61 of file OgrePagedWorld.h.
|
protected |
Definition at line 60 of file OgrePagedWorld.h.
|
protected |
Definition at line 62 of file OgrePagedWorld.h.
|
protected |
Definition at line 245 of file OgrePagedWorld.h.
|
protected |
Definition at line 244 of file OgrePagedWorld.h.