Alphabetical Class Index   Compound Members   File List  

CDataLoader Class Reference

The CDataLoader class provides support for loading a file in a piecwise fashion (streaming) More...

#include <DataLoader.h>

Public Member Functions

 CDataLoader (CHoops3dStreamCtrl *ctrl)
 
void Init (HCtrlView *view)
 
bool StartDownload (BSTR filename, bool isStreamable=true)
 
bool OnData (BYTE *pBytes, DWORD dwSize)
 
bool ProcessNextChunk ()
 
bool GetDownloadInProgress ()
 
bool GetDownloadComplete ()
 
long GetDownloadDataReceived ()
 
long GetDownloadDataTotalSize ()
 
void AbortDownload ()
 
void SetDownloadStatus (int ulProgressMax)
 
bool GetRestoreCamera ()
 
void SetRestoreCamera (bool restorecamera)
 
void SetTreeControlXML (char *data)
 
char * GetTreeControlXML ()
 
struct vlist_s * GetModelStructureTypeList ()
 
ModelStructureObject * GetModelStructureObjectTree ()
 
int FilterIdentifier (int identifier, char *type)
 
ModelStructureObject * FindModelStructureObject (ModelStructureObject *mso, int identifier)
 
void GetXMLForItemChildren (int identifier, char *(&text))
 
ModelStructureObject * FindModelStructureObject (ModelStructureObject *mso, char *path)
 
void GetXMLForItemChildren (ModelStructureObject *mso, char *(&text))
 
void GetXMLForItemChildren (char *path, char *(&text))
 
void GetPathFromIdentifier (int identifier, char *path)
 
HCtrlViewGetView ()
 
CHoops3dStreamCtrlGetControl ()
 

Public Attributes

DWORD m_ParsingThread
 

Protected Member Functions

TK_Status ProcessData (BYTE *pBytes, DWORD dwSize)
 
void ClearCachedDataList ()
 

Protected Attributes

vector< databuffer * > m_CachedDataList
 
HCtrlViewm_pView
 
bool m_bDataIsStreamable
 
bool m_bDownloadInProgress
 
long m_DataReceived
 
long m_DataReceiveSize
 
bool m_bAbortDownload
 
bool m_bDataProcessingComplete
 
bool m_bRestoreCamera
 

Detailed Description

The CDataLoader class provides support for loading a file in a piecwise fashion (streaming)

By chopping up data into smaller chunks the CDataLoader class allows the streaming of HSF data while not interrupting any user interaction

Constructor & Destructor Documentation

CDataLoader::CDataLoader ( CHoops3dStreamCtrl ctrl)

Class Constructor

Parameters
ctrlPointer to Control Class

Member Function Documentation

void CDataLoader::AbortDownload ( )
inline

Abort current download

void CDataLoader::ClearCachedDataList ( )
protected

Free data cache

int CDataLoader::FilterIdentifier ( int  identifier,
char *  type 
)

Filters Identifier based on model structure type. (example: an identifier pointing to an edge with a face as a filter will return the identifier of its parent face

Returns
Pointer to identifier
ModelStructureObject* CDataLoader::FindModelStructureObject ( ModelStructureObject *  mso,
int  identifier 
)

Given the model structure object to start the search from this function will return the model structure object associated to a given identifier

Parameters
msoModel Structure Object
identifierIdentifier to search for
Returns
Model Structure Object with given identifier
ModelStructureObject* CDataLoader::FindModelStructureObject ( ModelStructureObject *  mso,
char *  path 
)

Given the model structure object to start the search from this function will return the model structure object associated to a given path

Parameters
msoModel Structure Object
pathPath to search for
Returns
Model Structure Object with given path
CHoops3dStreamCtrl* CDataLoader::GetControl ( )
inline
Returns
Control Class Object
bool CDataLoader::GetDownloadComplete ( )
inline
Returns
Indicates if download is currently in progress
long CDataLoader::GetDownloadDataReceived ( )
inline
Returns
Size of already received data
long CDataLoader::GetDownloadDataTotalSize ( )
inline
Returns
Total size of downloaded file
bool CDataLoader::GetDownloadInProgress ( )
inline
Returns
Indicates if download is currently in progress
ModelStructureObject* CDataLoader::GetModelStructureObjectTree ( )
inline

Returns Pointer to the Model Structure Tree describing the model structure of the currently loaded hsf file

Returns
Pointer to ModelStructureObject
struct vlist_s* CDataLoader::GetModelStructureTypeList ( )
inline

Returns Pointer to a list of Model Structure Types (body, shell, face,etc.)

Returns
Pointer to vlist
void CDataLoader::GetPathFromIdentifier ( int  identifier,
char *  path 
)

Returns full path for given identifier

Parameters
identifierIdentifier to start returning path for
pathpath for given identifier (returned)
bool CDataLoader::GetRestoreCamera ( )
inline
Returns
Restore camera to scene default
char* CDataLoader::GetTreeControlXML ( )
inline

Returns Model Structure XML

Returns
pointer to text string
HCtrlView* CDataLoader::GetView ( )
inline
Returns
HCtrlView Object
void CDataLoader::GetXMLForItemChildren ( int  identifier,
char *&  text 
)

Returns Model Structure XML for children of the object with the given identifier

Parameters
identifierIdentifier to start returning XML description from
textXML description of children for given identifier (returned)
void CDataLoader::GetXMLForItemChildren ( ModelStructureObject *  mso,
char *&  text 
)

Returns Model Structure XML for children of the given model structure object

Parameters
msoModel Structure Object to start returning XML description from
textXML description of children for given identifier (returned)
void CDataLoader::GetXMLForItemChildren ( char *  path,
char *&  text 
)

Returns Model Structure XML for children of the object with the given path

Parameters
pathPath of model structure object to start returning XML description from
textXML description of children for given identifier (returned)
void CDataLoader::Init ( HCtrlView view)

Class Initialization

Parameters
viewPointer to Hoops View Object
bool CDataLoader::OnData ( BYTE *  pBytes,
DWORD  dwSize 
)

Put new data chunk in cache list

Parameters
pBytesPointer to data chunk
dwSizeSize of data chunk
Returns
true = more data is pending, false = no more data is pending
TK_Status CDataLoader::ProcessData ( BYTE *  pBytes,
DWORD  dwSize 
)
protected

Process new data chunk (either store or hand to streaming toolkit)

Parameters
pBytesPointer to data chunk
dwSizeSize of data chunk
Returns
true = more data is pending, false = no more data is pending
bool CDataLoader::ProcessNextChunk ( )

Process next data chunk. This function is typically called ín regular intervals from the main application

Returns
true = more data is pending, false = no more data is pending
void CDataLoader::SetDownloadStatus ( int  ulProgressMax)
inline

Set download status

Parameters
ulProgressMaxSize of total data
void CDataLoader::SetRestoreCamera ( bool  restorecamera)
inline

Restore camera to scene default

Parameters
restorecameraTRUE: Restore Camera
void CDataLoader::SetTreeControlXML ( char *  data)

Sets Text String containing xml model structure information

Parameters
dataPointer to Text String
bool CDataLoader::StartDownload ( BSTR  filename,
bool  isStreamable = true 
)

Start file download

Parameters
filenamename of file to download
isStreamabletrue = allow streaming for this file, false = do not allow streaming for this file
Returns
success

Member Data Documentation

bool CDataLoader::m_bAbortDownload
protected

true = abort download as soon as possible, false = no abortion

bool CDataLoader::m_bDataIsStreamable
protected

true = file is streamable, false = file is not streamable

bool CDataLoader::m_bDataProcessingComplete
protected

true = all data chunks have been processed, false = data processing in progress

bool CDataLoader::m_bDownloadInProgress
protected

true = download currently in progress, false = no download in progress

bool CDataLoader::m_bRestoreCamera
protected

true = restore camera, false = do not restore camera

vector<databuffer *> CDataLoader::m_CachedDataList
protected

vector of data chunks

long CDataLoader::m_DataReceived
protected

amount of already received data

long CDataLoader::m_DataReceiveSize
protected

total size of downloaded file

DWORD CDataLoader::m_ParsingThread

parsing thread ID

HCtrlView* CDataLoader::m_pView
protected

Pointer to HOOPS view object


The documentation for this class was generated from the following file: