mainwindow.cpp 933 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "mainwindow.h"

#include "tgt/assert.h"
#include "application/tumvisapplication.h"

namespace TUMVis {

    MainWindow::MainWindow(TumVisApplication* application)
        : QMainWindow()
        , _application(application)
        , _pipelineWidget(0)
    {
        tgtAssert(_application != 0, "Application must not be 0.");
        setup();
    }

    MainWindow::~MainWindow() {

    }

    void MainWindow::setup() {
        _pipelineWidget = new PipelineTreeWidget(this);
        setCentralWidget(_pipelineWidget);

        connect(this, SIGNAL(updatePipelineWidget(const std::vector<AbstractPipeline*>&)), _pipelineWidget, SLOT(update(const std::vector<AbstractPipeline*>&)));
        _application->s_PipelinesChanged.connect(this, &MainWindow::onPipelinesChanged);
    }

    void MainWindow::onPipelinesChanged() {
        emit updatePipelineWidget(_application->_pipelines);
    }

}