当前位置: 首页>>代码示例>>C++>>正文


C++ Engine::ConnectViewer方法代码示例

本文整理汇总了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;
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:68,代码来源:main.C


注:本文中的Engine::ConnectViewer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。