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


C++ Viewer::display方法代码示例

本文整理汇总了C++中Viewer::display方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::display方法的具体用法?C++ Viewer::display怎么用?C++ Viewer::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Viewer的用法示例。


在下文中一共展示了Viewer::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
	Scene scene;
    char* filename = "src/resources/scene.json";

    scene.parseScene(filename, scene);
    int width = 1024;
    int height = 768;
    Viewer *view = new Viewer(width, height, scene);
    view->display();
    return 0;
}
开发者ID:aksris,项目名称:PositionBasedFluids,代码行数:12,代码来源:main.cpp

示例2: setMaxHeartbeatInterval

void
MainThread::work() 
{
    setMaxHeartbeatInterval( 1.0 );

    // get 1 image
    // and check it's description for the particular image configuration
    getImage();
    
    //set up the viewer according to the configuration
    Viewer viewer = Viewer( imageData_->description->width,
                            imageData_->description->height,
                            imageData_->description->format,
                            context_ );

    while ( !isStopping() )
    {
        try 
        {
            // this blocks until a new image arrives and then
            // copies into a member variable
            getImage();
            
            // pass the image to the viewer
            viewer.display( imageData_ );
            
            //pushing too fast will cause the gui to not respond, sleep to prevent that
            // TODO: dodgy hack... needs to be fixed
            // The GUI diplay should be independent of incoming data. If the GUI dies,
            // then this code should be in the Viewer.
            IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(5));
        }
        catch ( ... ) 
        {
            orcaice::catchMainLoopExceptions( health() );

            // Re-create the viewer, unless we are stopping
            if ( !isStopping() ) {
                // TODO: make opencv window handle exception safe so we can create
                // another viewer here. At the moment, if an exception is thrown, 
                // the viewer will not self destruct. 
                // createViewer();
            }
        }

    } // end of while
}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:47,代码来源:mainthread.cpp


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