AtlasTOC Class Reference [Atlas Core]

#include <atlasBaseTOC.h>

Inheritance diagram for AtlasTOC:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base class for all Atlas Table Of Contents classes.

Atlas works off of the notion of a file, containing multiple TOCs.

For various type safety reasons, although TOCs are templated, we have to have a base class which we can access w/o any type knowledge for stubs or chunks. This, AtlasTOC provides several useful generic members, as well as some helper functions, and many callbacks which are important to the threaded loading process.

Many of these functions are only really relevant for AtlasResourceTOCs, but get carried over to AtlasInstanceTOCs to avoid having yet another interface.


Public Types

 RootLoad = 1
 Issued by a new object needing to kick off loading.
 LowPriority
 NormalPriority
 WarmUp
 AttemptSplitChildren
 EditorLoad
 This is a load for the purposes of some editor task.
 ConfigTOCLoad
 BlenderLoad
 InstanceShutdown
 Unload only, used in the AtlasInstanceTOC destructor.
 CollisionPreload
 Loading required data for leaf collision.
enum  LoadReasons {
  RootLoad = 1,
  LowPriority,
  NormalPriority,
  WarmUp,
  AttemptSplitChildren,
  EditorLoad,
  ConfigTOCLoad,
  BlenderLoad,
  InstanceShutdown,
  CollisionPreload
}
 For tracking purposes we allow most load/unload methods to specify a reason. More...

Public Member Functions

 AtlasTOC ()
virtual ~AtlasTOC ()
virtual bool write (Stream *s)
 Serialize the TOC to a stream.
virtual bool read (Stream *s)
 Serialize the TOC from a stream.
virtual void generate (RectI invalidationRegion)
 (Re)build all the tiles that contain the specified region, which is specified in leaf level tiles.
virtual void getIOStatus (AtlasFile::IOStatus::TOCIOStatus &status)
 Fill in the TOC I/O status structure.
virtual void cbOnChunkWriteComplete (U32 key, AtlasDeferredIO *adio)
virtual void cbOnStubWriteComplete (U32 key, AtlasDeferredIO *adio)
virtual void cbPostBackToAtlasFile (U32 key, AtlasDeferredIO *adio)
virtual void cbOnChunkReadComplete (U32 stubIdx, AtlasChunk *chunk)
virtual void cbOnChunkReadStarted (U32 stubIdx)
virtual void cbPopulateChunkReadNote (AtlasReadNote *arn)
virtual void dumpStubLoadStatus (U32 stubIdx)
 Used to dump the load request status of the specified stub.
virtual void syncCallback (const F32 deltaTime)
 This gets called back from AtlasFile::syncThreads, with time in seconds since last call.
virtual AtlasChunkconstructNewChunk ()
 Construct a new chunk that is of the appropriate type for this TOC, and set the owning TOC to ourselves.
virtual void recalculateUpdates (Vector< AtlasReadNote * > &list, U32 maxCount)
 Take our internal priority list, and fill the provided list with a pri-sorted set of elements describing what are our highest priorities at the moment.
const U32 getTreeDepth () const
AtlasFilegetAtlasFile () const

Static Public Member Functions

static const U32 getNodeCount (const U32 depth)
 Size of a quadtree of depth.
static const U32 getNodeIndex (const U32 level, const Point2I pos)
 Index of a node at given position in a quadtree.

Protected Attributes

U32 mTreeDepth
 Depth of our tree.
AtlasFilemFile
 Owning file.
bool mIsQuadtree
 Safety; are we allowing people to use us in a way that implies we're a quadtree? (This is mostly here so people don't try to diddle a config TOC the wrong way.

Friends

class AtlasFile


Member Enumeration Documentation

For tracking purposes we allow most load/unload methods to specify a reason.

This also lets us filter and prioritize based on context, if needed.

Enumerator:
RootLoad  Issued by a new object needing to kick off loading.
LowPriority 
NormalPriority 
WarmUp 
AttemptSplitChildren 
EditorLoad  This is a load for the purposes of some editor task.
ConfigTOCLoad 
BlenderLoad 
InstanceShutdown  Unload only, used in the AtlasInstanceTOC destructor.
CollisionPreload  Loading required data for leaf collision.


Constructor & Destructor Documentation

AtlasTOC::AtlasTOC (  )  [inline]

virtual AtlasTOC::~AtlasTOC (  )  [inline, virtual]


Member Function Documentation

static const U32 AtlasTOC::getNodeCount ( const U32  depth  )  [inline, static]

Size of a quadtree of depth.

static const U32 AtlasTOC::getNodeIndex ( const U32  level,
const Point2I  pos 
) [inline, static]

Index of a node at given position in a quadtree.

virtual bool AtlasTOC::write ( Stream s  )  [inline, virtual]

virtual bool AtlasTOC::read ( Stream s  )  [inline, virtual]

virtual void AtlasTOC::generate ( RectI  invalidationRegion  )  [inline, virtual]

(Re)build all the tiles that contain the specified region, which is specified in leaf level tiles.

Reimplemented in AtlasResourceTOC< StubTypeT >, AtlasResourceTOC< AtlasResourceGeomStub >, AtlasResourceTOC< AtlasResourceConfigStub >, and AtlasResourceTOC< AtlasResourceTexStub >.

virtual void AtlasTOC::getIOStatus ( AtlasFile::IOStatus::TOCIOStatus status  )  [inline, virtual]

virtual void AtlasTOC::cbOnChunkReadComplete ( U32  stubIdx,
AtlasChunk chunk 
) [inline, virtual]

virtual void AtlasTOC::cbOnChunkReadStarted ( U32  stubIdx  )  [inline, virtual]

virtual void AtlasTOC::dumpStubLoadStatus ( U32  stubIdx  )  [inline, virtual]

virtual void AtlasTOC::syncCallback ( const F32  deltaTime  )  [inline, virtual]

This gets called back from AtlasFile::syncThreads, with time in seconds since last call.

It's useful for updating things like heat.

Reimplemented in AtlasResourceTOC< StubTypeT >, AtlasResourceTOC< AtlasResourceGeomStub >, AtlasResourceTOC< AtlasResourceConfigStub >, and AtlasResourceTOC< AtlasResourceTexStub >.

virtual AtlasChunk* AtlasTOC::constructNewChunk (  )  [inline, virtual]

Construct a new chunk that is of the appropriate type for this TOC, and set the owning TOC to ourselves.

Reimplemented in AtlasResourceTOC< StubTypeT >, AtlasResourceTOC< AtlasResourceGeomStub >, AtlasResourceTOC< AtlasResourceConfigStub >, and AtlasResourceTOC< AtlasResourceTexStub >.

virtual void AtlasTOC::recalculateUpdates ( Vector< AtlasReadNote * > &  list,
U32  maxCount 
) [inline, virtual]

Take our internal priority list, and fill the provided list with a pri-sorted set of elements describing what are our highest priorities at the moment.

Reimplemented in AtlasResourceTOC< StubTypeT >, AtlasResourceTOC< AtlasResourceGeomStub >, AtlasResourceTOC< AtlasResourceConfigStub >, and AtlasResourceTOC< AtlasResourceTexStub >.

const U32 AtlasTOC::getTreeDepth (  )  const [inline]

AtlasFile* AtlasTOC::getAtlasFile (  )  const [inline]


Friends And Related Function Documentation

friend class AtlasFile [friend]


Member Data Documentation

Depth of our tree.

AtlasFile* AtlasTOC::mFile [protected]

Owning file.

Safety; are we allowing people to use us in a way that implies we're a quadtree? (This is mostly here so people don't try to diddle a config TOC the wrong way.

)