Alphabetical Class Index   File Members   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>

List of all members.

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:
ctrl Pointer to Control Class


Member Function Documentation

void CDataLoader::Init ( HCtrlView view  ) 

Class Initialization

Parameters:
view Pointer to Hoops View Object

bool CDataLoader::StartDownload ( BSTR  filename,
bool  isStreamable = true 
)

Start file download

Parameters:
filename name of file to download
isStreamable true = allow streaming for this file, false = do not allow streaming for this file
Returns:
success

bool CDataLoader::OnData ( BYTE *  pBytes,
DWORD  dwSize 
)

Put new data chunk in cache list

Parameters:
pBytes Pointer to data chunk
dwSize Size 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

bool CDataLoader::GetDownloadInProgress (  )  [inline]

Returns:
Indicates if download is currently in progress

References m_bDownloadInProgress.

bool CDataLoader::GetDownloadComplete (  )  [inline]

Returns:
Indicates if download is currently in progress

References m_bDataProcessingComplete.

long CDataLoader::GetDownloadDataReceived (  )  [inline]

Returns:
Size of already received data

References m_DataReceived.

long CDataLoader::GetDownloadDataTotalSize (  )  [inline]

Returns:
Total size of downloaded file

References m_DataReceiveSize.

void CDataLoader::AbortDownload (  )  [inline]

Abort current download

References m_bAbortDownload, m_bDataProcessingComplete, and m_bDownloadInProgress.

void CDataLoader::SetDownloadStatus ( int  ulProgressMax  )  [inline]

Set download status

Parameters:
ulProgressMax Size of total data

References m_DataReceiveSize.

bool CDataLoader::GetRestoreCamera (  )  [inline]

Returns:
Restore camera to scene default

References m_bRestoreCamera.

void CDataLoader::SetRestoreCamera ( bool  restorecamera  )  [inline]

Restore camera to scene default

Parameters:
restorecamera TRUE: Restore Camera

References m_bRestoreCamera.

void CDataLoader::SetTreeControlXML ( char *  data  ) 

Sets Text String containing xml model structure information

Parameters:
data Pointer to Text String

char* CDataLoader::GetTreeControlXML (  )  [inline]

Returns Model Structure XML

Returns:
pointer to text string

struct vlist_s* CDataLoader::GetModelStructureTypeList (  )  [inline, read]

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

Returns:
Pointer to vlist

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

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:
mso Model Structure Object
identifier Identifier to search for
Returns:
Model Structure Object with given identifier

void CDataLoader::GetXMLForItemChildren ( int  identifier,
char *&  text 
)

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

Parameters:
identifier Identifier to start returning XML description from
text XML description of children for given identifier (returned)

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:
mso Model Structure Object
path Path to search for
Returns:
Model Structure Object with given path

void CDataLoader::GetXMLForItemChildren ( ModelStructureObject *  mso,
char *&  text 
)

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

Parameters:
mso Model Structure Object to start returning XML description from
text XML 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:
path Path of model structure object to start returning XML description from
text XML description of children for given identifier (returned)

void CDataLoader::GetPathFromIdentifier ( int  identifier,
char *  path 
)

Returns full path for given identifier

Parameters:
identifier Identifier to start returning path for
path path for given identifier (returned)

HCtrlView* CDataLoader::GetView ( void   )  [inline]

Returns:
HCtrlView Object

References m_pView.

CHoops3dStreamCtrl* CDataLoader::GetControl (  )  [inline]

Returns:
Control Class Object

TK_Status CDataLoader::ProcessData ( BYTE *  pBytes,
DWORD  dwSize 
) [protected]

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

Parameters:
pBytes Pointer to data chunk
dwSize Size of data chunk
Returns:
true = more data is pending, false = no more data is pending

void CDataLoader::ClearCachedDataList (  )  [protected]

Free data cache


Member Data Documentation

parsing thread ID

vector of data chunks

Pointer to HOOPS view object

Referenced by GetView().

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

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

Referenced by AbortDownload(), and GetDownloadInProgress().

long CDataLoader::m_DataReceived [protected]

amount of already received data

Referenced by GetDownloadDataReceived().

total size of downloaded file

Referenced by GetDownloadDataTotalSize(), and SetDownloadStatus().

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

Referenced by AbortDownload().

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

Referenced by AbortDownload(), and GetDownloadComplete().

true = restore camera, false = do not restore camera

Referenced by GetRestoreCamera(), and SetRestoreCamera().


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