zoukankan      html  css  js  c++  java
  • Qt osg QWidget osgViewer::Viewer

    osgViewer::Viewer* _viewer = nullptr;

    _viewer = new osgViewer::Viewer;
    osg::ref_ptr<osg::Group> root = new osg::Group;
    //注意:这两句话的先后顺序 先添加模型在添加相机
    //root->addChild(osgDB::readNodeFile("cow.osgt"));
    root->addChild(osgDB::readNodeFile("D:\参考手册\BIM\osg\library.OSGB"));

    root->addChild(createLight());
    _viewer->setCamera(camera);//这两句话的先后顺序
    _viewer->setSceneData(root);
    _viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
    _viewer->setCameraManipulator(new osgGA::TrackballManipulator);
    _viewer->addEventHandler(new osgViewer::WindowSizeHandler());

    GraphicsWindowQt* gcQT = dynamic_cast<GraphicsWindowQt*>(gc);
    if (gcQT) {
      QWidget *pWgt = gcQT->getGLWidget();
      //ui.verticalLayout->addWidget(pWgt);
      ui.verticalLayout->addWidget(pWgt);
    }

  • 相关阅读:
    dgango
    django
    pymysql 增删改 查 索引
    mysql 单表,多表,符合条件,子查询
    mysql 数据的增删改
    mysql foreignkey
    mysql基础知识之数据类型与约束
    MySol序
    MySql
    Python Selenium 常用方法总结
  • 原文地址:https://www.cnblogs.com/herd/p/11028738.html
Copyright © 2011-2022 走看看