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);
}

Qt osg QWidget osgViewer::Viewer的更多相关文章

  1. osgViewer::Viewer::Windows

    osg自带窗口去掉边框 #ifdef _WIN32 #include <Windows.h> #endif // _WIN32 #include<iostream> #incl ...

  2. osgViewer:: Viewer::advance() osg多线程与智能指针

    void ViewerBase::frame(double simulationTime) { if (_done) return; // OSG_NOTICE<<std::endl< ...

  3. [原][osg][QT]osg与QT界面结合的简单例子二

    //main.cpp #include "VREObliqueEditorQTWindow.h" #include <QtWidgets/QApplication> # ...

  4. [转][osg][QT]osg与QT界面结合的简单例子

    //QT += core gui opengl //LIBS += -losgViewer -losgDB -losgUtil -losg -lOpenThreads -losgGA -losgQt ...

  5. 《最长的一帧》 osg3.4 osgViewer::View::init() osgViewer::Viewer::getContexts()

    开始:osgViewer/ViewerBase.cpp   389行,startThreading()函数,启动线程   void ViewerBase::startThreading() { if ...

  6. QT中QWidget、QDialog以及MainWindow的区别

    参考 http://blog.csdn.net/u011619422/article/details/47311101 QT中QWidget.QDialog以及MainWindow的区别 QWidge ...

  7. QT中QWidget、QDialog QMainWindow

    继承关系:在Qt中所有的类都有一个共同的基类QObject ,QWidget直接继承与QPaintDevice类,QDialog.QMainWindow.QFrame直接继承QWidget 类. QW ...

  8. 【转】QT中QWidget、QDialog及QMainWindow的区别

    QWidget类是所有用户界面对象的基类. 窗口部件是用户界面的一个基本单元:它从窗口系统接收鼠标.键盘和其它事件,并且在屏幕上绘制自己.每一个窗口部件都是矩形的,并且它们按Z轴顺序排列.一个窗口部件 ...

  9. 【Qt】QWidget、QDialog、QMainWindow的异同点【转】

    简述 在分享所有基础知识之前,很有必要在这里介绍下常用的窗口-QWidget.QDialog.QMainWindow. 熟悉Qt的同学都应该知道,在新建Qt Widgets项目进行类信息选择时会碰到它 ...

随机推荐

  1. spring-boot-actuator 常用配置

    management: endpoints: web: base-path: "/" exposure: include: "*" endpoint: heal ...

  2. deep_learning_Github_初学者教程

    Github_link_from:https://github.com/lawlite19/MachineLearning_Python 机器学习算法Python实现 目录 机器学习算法Python实 ...

  3. Oracle 11g Dataguard 配置,维护与详解 (ADG)

    一.前言: 本手册主要记录如何配置,还介绍了配置原因,以及注意要点,已经主备切换,以及故障转移等重要操作步骤,我希望这个文章可以作为进行dataguard配置的一个参考手册. 二.前提 1.主库是归档 ...

  4. 【python】使用plotly生成图表数据

    安装 在 ubuntu 环境下,安装 plotly 很简单 python 版本2.7+ pip install plotly 绘图 在 plotly 网站注册后,可以直接将生成的图片保存到网站上,便于 ...

  5. java 常用算法和一些题目

    选择排序,复杂度O(n²) package com.example.demo; import org.junit.Test; /** * 选择排序 * @author zhzh.yin * */ pu ...

  6. python_tkinter事件

    1.事件绑定函数(3个) 组件.bind('事件类型',事件函数) 为一个组件绑定一个操作 组件.bind_class('组件类型','事件类型',事件函数) 为一个类组件绑定一个操作 组件.bind ...

  7. 验证码输入自动聚焦下一个input或者删除自动聚焦上一个input

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. Python+request+ smtplib 测试结果html报告邮件发送(下)《六》

    目录结构如下: 1.cfg.ini的配置信息写法如下: [email] ;--------------------------使用腾讯企业邮箱作为发件人的操作如下------------------- ...

  9. Node.js Websocket 区分不同的用户

    实现ws://serverIP:port/:param1/:param2 .通过param1,param2来管理不同的ws回话,以便实现群发和指定用户的消息推送 npm install ws --sa ...

  10. Consul概述

    环境安装 1.下载consul 官网https://www.consul.io/downloads.html下载对应版本的consul:本文以Windows-64版本为例 2.配置到系统环境变量 C: ...