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


C++ SimpleSceneManagerRefPtr::redraw方法代码示例

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


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

示例1: display

// redraw the window
void display(void)
{
    // redraw the client window
    _mgr->redraw();


    OSG::commitChanges();

    try
    {
        if(_cluster_win != NULL)
        {
            OSG::Thread::getCurrentChangeList()->dump();

            // redraw the server windows
            _cluster_win->render((OSG::RenderAction *) _mgr->getRenderAction());
        }
    }
    
    catch(OSG_STDEXCEPTION_NAMESPACE::exception &e)
    {
        //printf("error: '%s'\n", e.what());
        printf("ClusterServer was killed!\n");

        _cluster_win = NULL;
    } 
    
    OSG::commitChanges();
    OSG::clearChangeList();
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:31,代码来源:testVTKClusterConnect.cpp

示例2: display

//
// redraw the window
//
void display(void)
{
    // render

    mgr->redraw();

    // all done, swap
    glutSwapBuffers();
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:12,代码来源:clipplanecaps.cpp

示例3: display

// redraw the window
void display(void)
{      
    // render
    
    mgr->redraw();

    // all done, swap  (better not GV)
    //glutSwapBuffers();
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:10,代码来源:testSurfaceRender.cpp

示例4: display

// redraw the window
void display(void)
{
    OSG::Real64 t = OSG::getSystemTime();
    // render scene
    _mgr->redraw();
    t = OSG::getSystemTime() - t;
    if(t > 0.0)
        printf("fps: %f\r", 1.0f / OSG::Real32(t));
    else
        printf("fps: very fast ...\r");
}
开发者ID:vossg,项目名称:OpenSGDevMaster,代码行数:12,代码来源:testSHLSharedParameters.cpp

示例5: display

// redraw the window
void display( void )
{
    // create the matrix
    OSG::Matrix m;
    OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME );
    
    m.setTransform(OSG::Quaternion(OSG::Vec3f(0,1,0), t / 1000.f));
    
    // set the transform's matrix
    trans->setMatrix(m);

    OSG::commitChanges();
   
    mgr->redraw();
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:16,代码来源:07multiindexgeometry.cpp

示例6: display

// redraw the window
void display(void)
{
//     std::cout << ">> FRAME START" << std::endl;

    static OSG::Time   tAcc = 0;
    static OSG::UInt32 fc   = 0;

    OSG::Time t0 = OSG::getSystemTime();

    OSG::FrameHandler::the()->frame();

    OSG::commitChangesAndClear();

    mgr->idle();
    mgr->redraw();

    OSG::Time t1 = OSG::getSystemTime();

    tAcc += (t1 - t0);
    fc   += 1;

    if(tAcc >= 1)
    {
        std::cout << "frame count [" << fc
                  << "] fc/tAcc [" << (fc/tAcc)
                  << "] tAcc/fc [" << (1000.f * (tAcc/fc))
                  << "] ms tAcc [" << tAcc << "] s" << std::endl;

        tAcc = 0;
        fc   = 0;
    }

//     std::cout << "<< FRAME END" << std::endl;

//     mgr->getWindow()->registerConstant(GL_MAX_VERTEX_UNIFORM_COMPONENTS  );
//     mgr->getWindow()->registerConstant(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);

//     OSG::Real32 maxVPUniforms =
//         mgr->getWindow()->getConstantValue(GL_MAX_VERTEX_UNIFORM_COMPONENTS);
//     OSG::Real32 maxFPUniforms =
//         mgr->getWindow()->getConstantValue(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);

//     std::cout << "GL_MAX_VERTEX_UNIFORM_COMPONENTS [" << maxVPUniforms
//               << "] GL_MAX_FRAGMENT_UNIFORM_COMPONENTS [" << maxFPUniforms
//               << "]" << std::endl;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:47,代码来源:testColladaLoader.cpp

示例7: display

// redraw the window
void display( void )
{
    // create the matrix
    OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME );
    
    // stagger the lights in time, so that they follow each other
    for(OSG::UInt16 i = 0; i < nlights; ++i)
    {
        OSG::Matrix m;
        
        makeMatrix(t - 2000 * i, m);

        lightBeacons[i]->setMatrix(m);
    }
    OSG::commitChanges();
    
    mgr->redraw();
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:19,代码来源:lights.cpp

示例8: display

//
// redraw the window
//
void display(void)
{
    // create the matrix
    OSG::Matrix m;
    OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME );
    
    // set the transforms' matrices
    m.setTransform(OSG::Vec3f(0, 0, OSG::osgSin(t / 1000.f) * 1.5),
                   OSG::Quaternion( OSG::Vec3f (1, 0, 0), t / 500.f));

    cyltrans->setMatrix(m);
    
    m.setTransform(OSG::Vec3f(OSG::osgSin(t / 1000.f), 0, 0),
                   OSG::Quaternion( OSG::Vec3f (0, 0, 1), t / 1000.f));

    tortrans->setMatrix(m);

    OSG::commitChanges();
    
    mgr->redraw();
}
开发者ID:vossg,项目名称:OpenSGDevMaster,代码行数:24,代码来源:multipropertyssbochunk_test.cpp

示例9: display

// redraw the window
void display( void )
{
    // update the geometry
    OSG::Matrix m;

    OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME );

    m.setTransform(OSG::Vec3f(OSG::osgSin(t / 1000.f),
                              OSG::osgCos(t / 1000.f),
                              OSG::osgSin(t / 1000.f)),

                   OSG::Quaternion( OSG::Vec3f(0,1,0), t / 1000.f));

    trans->setMatrix(m);

    // update the image

    grabImage(image);

    // redraw the screen

    mgr->redraw();
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:24,代码来源:videotexturebackground.cpp

示例10: display

//
// redraw the window
//
void display(void)
{
    // light spot direction and light position must be provided in eye space
    update_light_state(ubo_light_state, lights);

    // create the matrix
    OSG::Matrix m;
    OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME );
    
    // set the transforms' matrices
    m.setTransform(OSG::Vec3f(0, 0, OSG::osgSin(t / 1000.f) * 1.5),
                   OSG::Quaternion( OSG::Vec3f (1, 0, 0), t / 500.f));

    cyltrans->setMatrix(m);
    
    m.setTransform(OSG::Vec3f(OSG::osgSin(t / 1000.f), 0, 0),
                   OSG::Quaternion( OSG::Vec3f (0, 0, 1), t / 1000.f));

    tortrans->setMatrix(m);

    OSG::commitChanges();
    
    mgr->redraw();
}
开发者ID:marcusl,项目名称:OpenSG,代码行数:27,代码来源:shaderstoragebufferobject.cpp

示例11: display

// redraw the window
void display(void)
{
    static OSG::Real32 speed = 10000.0f;
    static OSG::Real32 t = glutGet(GLUT_ELAPSED_TIME);
    static OSG::Real32 t2 = 0.0;
    
    OSG::Real32 td = glutGet(GLUT_ELAPSED_TIME) - t;

    if(td > speed)
        t = glutGet(GLUT_ELAPSED_TIME);

    if(_animation)
    {
        t2 = (2 * OSG::Pi / speed) * td;

        _shl_vp->updateUniformVariable("cos_time_0_2PI", OSG::osgCos(t2));
        _shl_vp->updateUniformVariable("sin_time_0_2PI", OSG::osgSin(t2));
    }

    OSG::Thread::getCurrentChangeList()->commitChanges();

    // render scene
    _mgr->redraw();
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:25,代码来源:testSHLEarth_shaderprog.cpp

示例12: display

void display(void)
{
    mgr->redraw();
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:4,代码来源:05loading.cpp

示例13: display

// redraw the window
void display(void)
{
    mgr->idle();
    mgr->redraw();
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:6,代码来源:testTextParams.cpp

示例14: display

// redraw the window
void display(void)
{
  // render scene
  _mgr->redraw();
}
开发者ID:martinhecher,项目名称:OpenSGDevMaster,代码行数:6,代码来源:testSHLProcLights_shaderprog.cpp

示例15: doMain

int doMain(int argc, char **argv)
{
    //
    // This might be necessary depending on the
    // used platform to ensure that the corresponding
    // libraries get loaded.
    //
    OSG::preloadSharedObject("OSGFileIO");
    OSG::preloadSharedObject("OSGImageFileIO");
    OSG::preloadSharedObject("OSGContribPLY");

    OSG::osgInit(argc,argv);

    // GLUT init
    glutInit(&argc, argv);

    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_DOUBLE);

    glutCreateWindow("OpenSG");

    glutReshapeFunc(reshape);
    glutDisplayFunc(display);
    glutIdleFunc(display);
    glutMouseFunc(mouse);
    glutMotionFunc(motion);
    glutKeyboardFunc(keyboard);

    OSG::PassiveWindowRefPtr pwin=OSG::PassiveWindow::create();
    pwin->init();

    // create the SimpleSceneManager helper
    mgr = OSG::SimpleSceneManager::create();

    // create the window and initial camera/viewport
    mgr->setWindow(pwin);

    //
    // for storing clipplane beacon we use a container
    // collection attachment which we attach to the scene
    // node. Otherwise the scene could not be saved correctly,
    // as the beacons would be lost.
    //
    container = OSG::ContainerCollection::create();

    //
    // Implementation details:
    //      For each clip plane we provide a ClipPlaneChunk, the plane geometry,
    //      the plane transform core and at least a plane color conveniently in
    //      a vector of type VecClipPlaneDetailsT. The next function call
    //      initializes this data structure.
    //
    createClipPlaneDetails();

    //
    // The scene
    //
    scene = OSG::Node::create();
    scene->setCore(OSG::Group::create());
    scene->addAttachment(container);

    //
    // A place for accessing the box and torus.
    //
    vecGeometries.push_back(NULL);
    vecGeometries.push_back(NULL);

    //
    // Build concrete clipping planes and update the clip plane details.
    //
    ClipPlaneData data1;
    ClipPlaneData data2;

    data1._equation = OSG::Vec4f(0,0,1,0);
    data1._enabled  = true;

    data2._equation = OSG::Vec4f(1,0,0,0);
    data2._enabled  = false;

    vecClipPlaneData.push_back(data1);
    vecClipPlaneData.push_back(data2);

    updateClipPlanes(vecClipPlaneData);

    keyboard('3',-1,-1);
    keyboard('4',-1,-1);

    // tell the manager what to manage
    mgr->setRoot(scene);

    // show the whole scene
    mgr->showAll();
    mgr->redraw();

    pwin->dumpExtensions();

    return 0;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:97,代码来源:clipplanecaps.cpp


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