本文整理汇总了C++中Engine::ConnectViewer方法的典型用法代码示例。如果您正苦于以下问题:C++ Engine::ConnectViewer方法的具体用法?C++ Engine::ConnectViewer怎么用?C++ Engine::ConnectViewer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::ConnectViewer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EngineMain
int
EngineMain(int argc, char *argv[])
{
// Start timings asap to get info on initialization activity
TimingsManager::Initialize("");
for (int i=1; i<argc; i++)
{
if (strcmp(argv[i], "-timing")==0 || strcmp(argv[i], "-timings")==0)
visitTimer->Enable();
}
Engine *engine = EngineBase::GetEngine();
// Do some pre-connect initialization
engine->Initialize(&argc, &argv, true);
debug1 << "Engine::Initialize completed." << endl;
// Try to connect to the viewer
if (engine->ConnectViewer(&argc, &argv))
{
debug1 << "Engine::ConnectViewer completed." << endl;
// Do the post-connect initialization
engine->SetUpViewerInterface(&argc, &argv);
debug1 << "Engine::SetupViewerInterface completed." << endl;
// Do the rest of the engine initialization.
engine->InitializeCompute();
debug1 << "Engine::InitializeCompute completed." << endl;
// Begin the engine's event processing loop.
#ifdef PARALLEL
debug1 << "Entering PAR_EventLoop" << endl;
engine->PAR_EventLoop();
#else
debug1 << "Entering EventLoop" << endl;
engine->EventLoop();
#endif
}
else
{
// Connect failed
if (PAR_Rank() == 0)
{
debug1 << "The engine could not connect to the viewer due to a "
<< "networking problem. The engine is exiting" << endl;
cerr << "The engine could not connect to the viewer due to a "
<< "networking problem. The engine is exiting" << endl;
}
}
if (DebugStream::Level1())
{
debug1 << "ENGINE exited." << endl;
}
engine->Finalize();
#ifdef DEBUG_MEMORY_LEAKS
delete engine;
vtkVisItUtility::CleanupStaticVTKObjects();
avtFileDescriptorManager::DeleteInstance();
#endif
#ifdef PARALLEL
PAR_Exit();
#endif
return 0;
}