我要发帖 回复

管理员

327

主题

4687

积分

15

专家分

兴趣点(最多三项):

视景仿真
地形仿真
高层游戏引擎

私信
发表时间 : 2018-1-2 12:38:23 | 浏览 : 3949    评论 : 1
1  Q3DVIEW.h
  1. #ifndef Q3DVIEW_H
  2. #define Q3DVIEW_H

  3. #include <QGLWidget>
  4. #include <QResizeEvent>
  5. #include <QtWidgets/QGraphicsView>
  6. #include <osgQt/GraphicsWindowQt>
  7. #include <QInputEvent>
  8. #include <QGraphicsScene>
  9. #include <qgraphicsscene.h>
  10. #include <QGraphicsSceneEvent>
  11. #include <osgViewer/Viewer>
  12. #include <osgViewer/ViewerEventHandlers>

  13. class Q3DView :public osgQt::GLWidget, public osgViewer::Viewer
  14. {
  15.        Q_OBJECT
  16. public:
  17.     Q3DView(QWidget *parent = NULL);

  18.     ~Q3DView(void);

  19.     osg::GraphicsContext* GetGraphicsContext();
  20.     virtual void paintEvent( QPaintEvent* event );
  21.     virtual void resizeEvent( QResizeEvent* event );
  22. };

  23. #endif // QOSGVIEW_H
复制代码




2 该类的使用方法:


1)新建对象:


mViewer = new Q3DView();

2)获取窗口对象:

QWidget *DCECore::getView()
{
    return mViewer;
}


3)加入到主窗口
QHBoxLayout *topLayout = new QHBoxLayout(ui->page_1);
    m_DCECore = new DCECore(url);
    topLayout->addWidget(m_DCECore->getView());

Q3DView.h

686 Bytes, 下载次数: 0

售价: 10 积分  [记录]  [购买]

Q3DView.cpp

1.44 KB, 下载次数: 0

售价: 50 积分  [记录]  [购买]

最近VR访客查看更多↓

UE4   |   虚幻引擎   |   Unity VR    |    Hololens
adam_2010_eva 评论于2018-1-4 18:31:23

rthttttttttttttttttt

手机版|VR开发网 统计 津ICP备18009691号
网安备12019202000257

GMT+8, 2023-4-2 02:00 PM

返回顶部