/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// /* OdVisualizeStreamingServer */ #include "OdaCommon.h" #include "Server.h" #include "RxInit.h" #include "TvFactory.h" void ODASdkActivate() { static const char* ActInfo[] = { #ifdef TEIGHA_TRIAL "", "" #else //"UserInfo", "UserSignature" // Before compiling, a ODA SDK activation file should be placed in a location that a compiler can access, // otherwise you get a compiler error such as "Kernel/Extensions/ExServices/ExSystemServices.h:43:10: fatal error: 'OdActivationInfo' file not found". // To learn about ODA SDK activation, see the activation guide at https://docs.opendesign.com/tkernel/oda_activation.html #include "OdActivationInfo" #endif }; odActivate( ActInfo[ 0 ], ActInfo[ 1 ] ); } void ODASdkDeactivate() { odCleanUpStaticData(); } int main( int argc, char* argv[] ) { // Activate ODA SDK ODASdkActivate(); // Initialize factory odTvInitialize(); //Create server instance OdTvStreamingServerPtr pServer = OdTvStreamingServer::createServer(); //Add files to the server auto registerFile = [&pServer]( const OdString& file, const OdString& fileToSave = OdString::kEmpty ) { OdTvStreamingServer::FileAddingResult res = pServer->addFile( file ); if( res < OdTvStreamingServer::FileAddingResult::kLinearStreaming ) { OdString str = OD_T( "File \"" ); str += file; str += OD_T( "\" can not be registered\n " ); printf( "%s", str.operator const char* ( ) ); if( !fileToSave.isEmpty() && res == OdTvStreamingServer::FileAddingResult::kNotStreamingCompatible ) { if( OdTvDatabaseReceiver::makeStreamingCompatible( file, fileToSave ) == tvOk ) { res = pServer->addFile( fileToSave ); if( res < OdTvStreamingServer::FileAddingResult::kLinearStreaming ) { OdString str = OD_T( "\tFile \"" ); str += fileToSave; str += OD_T( "\" can not be registered\n" ); printf( "%s", str.operator const char* ( ) ); } else if( res == OdTvStreamingServer::FileAddingResult::kLinearStreaming ) { OdString str = OD_T( "\tFile \"" ); str += fileToSave; str += OD_T( "\" available for Linear streaming\n" ); printf( "%s", str.operator const char* ( ) ); } else { OdString str = OD_T( "\tFile \"" ); str += fileToSave; str += OD_T( "\" available for both Linear and Partial streaming\n" ); printf( "%s", str.operator const char* ( ) ); } } } } else if( res == OdTvStreamingServer::FileAddingResult::kLinearStreaming ) { OdString str = OD_T( "File \"" ); str += file; str += OD_T( "\" available for Linear streaming\n" ); printf( "%s", str.operator const char* ( ) ); } else { OdString str = OD_T( "File \"" ); str += file; str += OD_T( "\" available for both Linear and Partial streaming\n" ); printf( "%s", str.operator const char* ( ) ); } }; /*registerFile(OD_T("D:\\ODA\\Files\\VSFX\\streaming\\MoscowMap.vsfx")); registerFile( OD_T( "D:\\ODA\\Files\\VSFX\\streaming\\coffee table_ORIGINAL_PI.vsfx" ) ); registerFile( OD_T( "D:\\ODA\\Files\\VSFX\\streaming\\rcs\\stream_flower.vsfx" ) ); registerFile( OD_T( "D:\\ODA\\Files\\VSFX\\streaming\\assembly\\assembly.vsfx" ), OD_T( "D:\\ODA\\Files\\VSFX\\streaming\\assembly\\assembly_streaming.vsfx" ) ); registerFile( OD_T( "D:\\ODA\\Files\\VSFX\\streaming\\assembly\\mmap_assembly.vsfx" ) );*/ //registerFile( OD_T( "D:\\assembly\\output\\assembly.vsfx" ) ); //registerFile( OD_T( "D:\\1.vsfx" ), OD_T( "D:\\1_stream.vsfx" ) ); //registerFile( OD_T( "D:\\2.vsfx" ), OD_T( "D:\\2_stream.vsfx" ) ); registerFile( OD_T( "D:\\assembly\\output\\07-186100-4800000333-CH2-ARC-MDL-900010_A.rvt.vsfx" ), OD_T( "D:\\assembly\\output\\tmp\\07-186100-4800000333-CH2-ARC-MDL-900010_A.rvt.vsfx" ) ); registerFile( OD_T( "D:\\assembly\\output\\07-186100-4800000333-CH2-ARC-MDL-900011_A.rvt.vsfx" ), OD_T( "D:\\assembly\\output\\tmp\\07-186100-4800000333-CH2-ARC-MDL-900011_A.rvt.vsfx" ) ); registerFile( OD_T( "D:\\assembly\\output\\07-186100-4800000333-CH2-ARC-MDL-900201_A.rvt.vsfx" ), OD_T( "D:\\assembly\\output\\tmp\\07-186100-4800000333-CH2-ARC-MDL-900201_A.rvt.vsfx" ) ); registerFile( OD_T( "D:\\assembly\\output\\07-186100-4800000333-CH2-ARC-MDL-900320_A.rvt.vsfx" ), OD_T( "D:\\assembly\\output\\tmp\\07-186100-4800000333-CH2-ARC-MDL-900320_A.rvt.vsfx" ) ); registerFile( OD_T( "D:\\assembly\\output\\07-186100-4800000333-CH2-ARC-MDL-900401_A.rvt.vsfx" ), OD_T( "D:\\assembly\\output\\tmp\\07-186100-4800000333-CH2-ARC-MDL-900401_A.rvt.vsfx" ) ); if( !pServer->start( "27015" ) ) { printf( "Server execution error\n" ); } odTvUninitialize(); ODASdkDeactivate(); return 0; }