Streaming of 3D data typically refers to a process whereby graphical information is retrieved from a remote location such as a website or server and is displayed as soon as it is received by the client application. It allows the end-user to quickly obtain some visual feedback, as well as interact with the scene as it is still being displayed.
The following steps are necessary to add support for streaming an HSF into an application:
In review, it is up to the developer to map the data to their custom data-structures within the Execute method of their custom opcode handlers when using the base classes.
The following code demonstrates how an HSF file called 'factory.hsf'could be streamed into the HOOPS/3dGS database and incrementally drawn, using the base classes:
void Stream_HSF_File (char const * filename){auto char block[BUFFER_SIZE];auto int amount;// our sample custom toolkit only cares about segment and shellstk->SetOpcodeHandler (TKE_Open_Segment, new TK_My_Open_Segment);tk->SetOpcodeHandler (TKE_Close_Segment, new TK_My_Close_Segment);tk->SetOpcodeHandler (TKE_Shell, new TK_My_Shell);return status;do{break;status = tk->ParseBuffer (block, amount);MyGraphicsUpdateFunction();if (status == TK_Error){// whatever...break;}} while (status != TK_Complete);tk->CloseFile ();delete tk;}