zoukankan      html  css  js  c++  java
  • initGLWidgetAndViewer

    void initGLWidgetAndViewer()
    {
        osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::SingleThreaded;
        IfcSystem* m_system->getRootNode()->setCullingActive( false );
        osg::ref_ptr<VCGraphicsWindowQt> m_graphics_window = new GraphicsWindowQt( this );
        QtOSGWidget* opengl_widget = m_graphics_window->getOpenGLWidget();
        opengl_widget->setMinimumSize( QSize( 150, 150 ) );
        osg::ref_ptr<osgViewer::View> m_main_view = opengl_widget->getView();
        m_main_view->setSceneData( m_system->getRootNode() );
        osg::ref_ptr<osgViewer::CompositeViewer> m_composite_viewer = opengl_widget->getViewer();
        m_composite_viewer->setThreadingModel( threadingModel );
        m_composite_viewer->setKeyEventSetsDone( 0 );        // disable the default setting of viewer.done() by pressing Escape.
        m_composite_viewer->addView( m_main_view );
    
        // set up the camera
        osg::ref_ptr<osg::Camera> camera = m_main_view->getCamera();
        camera->setGraphicsContext( m_graphics_window );
        camera->setClearColor( osg::Vec4f( 0.92, 0.93, 0.94, 1.0 ) );
        camera->setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR );
    
        if( m_main_view )
        {
            m_main_view->setCameraManipulator( m_camera_manipulator );
            m_main_view->setSceneData( m_system->getRootNode() );
        }
    }

  • 相关阅读:
    CSS——制作天天生鲜主页
    HTML——制作一个图片列表
    HTML——制作一个简易菜单栏
    CSS——三种页面引入方法
    【20170903】模拟赛
    【LA 3942】 Remember the word
    【BZOJ 1036】 树的统计count
    UVA 12299 RMQ with shifts
    【20170706】次短路
    【20170706】保卫萝卜
  • 原文地址:https://www.cnblogs.com/herd/p/11249675.html
Copyright © 2011-2022 走看看