Skip to content

Commit

Permalink
No need to set a dummy scene data.
Browse files Browse the repository at this point in the history
We can have an empty view.
  • Loading branch information
adeas31 committed Sep 15, 2016
1 parent 721b825 commit 9854949
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions OMEdit/OMEditGUI/Animation/AnimationWindowContainer.cpp
Expand Up @@ -67,8 +67,7 @@ AnimationWindowContainer::AnimationWindowContainer(QWidget *pParent)
setThreadingModel(osgViewer::CompositeViewer::SingleThreaded);

//the viewer widget
osg::ref_ptr<osg::Node> rootNode = osgDB::readRefNodeFile("D:/Programming/OPENMODELICA_GIT/OpenModelica/build/bin/dumptruck.osg");
mpViewerWidget = setupViewWidget(rootNode);
mpViewerWidget = setupViewWidget();

//mpViewerWidget->setParent(this);
//mpViewerWidget->setWindowFlags(Qt::SubWindow);
Expand Down Expand Up @@ -140,7 +139,7 @@ AnimationWindowContainer::AnimationWindowContainer(QWidget *pParent)
* creates the widget for the osg viewer
* \return the widget
*/
QWidget* AnimationWindowContainer::setupViewWidget(osg::ref_ptr<osg::Node> rootNode)
QWidget* AnimationWindowContainer::setupViewWidget()
{
//desktop resolution
QRect rec = QApplication::desktop()->screenGeometry();
Expand Down Expand Up @@ -175,7 +174,6 @@ QWidget* AnimationWindowContainer::setupViewWidget(osg::ref_ptr<osg::Node> rootN
//camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
camera->setViewport(new osg::Viewport(0, 0, width, height));
camera->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(traits->width/2) / static_cast<double>(traits->height/2), 1.0f, 10000.0f);
mpSceneView->setSceneData(rootNode);
mpSceneView->addEventHandler(new osgViewer::StatsHandler());
mpSceneView->setCameraManipulator(new osgGA::MultiTouchTrackballManipulator());
gw->setTouchEventsEnabled(true);
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Animation/AnimationWindowContainer.h
Expand Up @@ -63,7 +63,7 @@ class AnimationWindowContainer : public QMainWindow, public osgViewer::Composite
Q_OBJECT
public:
AnimationWindowContainer(QWidget *pParent);
QWidget* setupViewWidget(osg::ref_ptr<osg::Node> rootNode);
QWidget* setupViewWidget();
void showWidgets();
void loadVisualization();
double getTimeFraction();
Expand Down

0 comments on commit 9854949

Please sign in to comment.