The ObjectLOD Class


  public:
 ObjectLOD();
 ~ObjectLOD();

 static void SetupEmptyTable( int numEntries );
 static void SetupTable( int file, char *basename );
 static void CleanupTable();

 void Reference(void)  { refCount++; };
 void Release(void)  { refCount--; if (refCount==0) Unload(); };

 BOOL Fetch(void); // True means ready to draw.  False means still waiting.
 void Draw(void) const { ShiAssert( root ); root->Draw(); };

 static CRITICAL_SECTION cs_ObjectLOD;

  protected:
 // Handle asychronous data loading
 void  RequestLoad( void );
 static void LoaderCallBack( struct LoaderQ* request );
 void  Unload( void );

 static int    objectFile;
 static BNodeType  *tagListBuffer;

 int  refCount;  // How many instances of this LOD are in use
 short onOrder;  // TRUE when IO is pending (normally 1, -1 means no longer needed)

  public:
 // Object flag values
 enum { NONE = 0, PERSP_CORR = 1, };

 short flags;   // Special handling flags for this visual
 BRoot *root;   // NULL until loaded, then pointer to node tree
 UInt32 fileoffset;  // Where in the disk file is this record's tree stored
 UInt32 filesize;  // How big the disk representation of this record's tree

#ifdef USE_SMART_HEAP
  public:
 static MEM_POOL pool;
#endif