mainwindow.h 2.22 KB
Newer Older
1
2
3
4
5
6
#ifndef TUMVISMAINWINDOW_H__
#define TUMVISMAINWINDOW_H__

#include "sigslot/sigslot.h"
#include "application/tumvisapplication.h"
#include "application/gui/pipelinetreewidget.h"
7
#include "application/gui/propertycollectionwidget.h"
8
9

#include <QMainWindow>
10
11
#include <QVBoxLayout>
#include <QHBoxLayout>
12
13
14
#include <vector>

namespace TUMVis {
schultezub's avatar
schultezub committed
15
16
17
18
    /**
     * Main Window for the TUMVis application.
     * Wraps a nice Qt GUI around the TumVisApplication instance given during creation.
     */
19
20
21
22
    class MainWindow : public QMainWindow, public sigslot::has_slots<> {
        Q_OBJECT;

    public:
schultezub's avatar
schultezub committed
23
24
25
26
        /**
         * Creates a new TumVis Main window for \a application.
         * \param   application     TumVisApplication to create a GUI for.
         */
27
28
        MainWindow(TumVisApplication* application);

schultezub's avatar
schultezub committed
29
30
31
        /**
         * Destructor, make sure to call before destroying the application
         */
32
33
34
        ~MainWindow();


schultezub's avatar
schultezub committed
35
36
37
        /**
         * Slot to be called by the application when its collection of pipelines has changed.
         */
38
39
40
        void onPipelinesChanged();

    signals:
41
        /// Qt signal for updating the PipelineWidget.
42
        void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
43
44
        /// Qt signal for updating the PropertyCollectionWidget
        void updatePropCollectionWidget(PropertyCollection*);
45

46
47
48
49
50
51
    private slots:
        /**
         * Slot to be called by the PipelineWidget when the selected item changes.
         * \param   index   Index of the selected item
         */
        void onPipelineWidgetItemClicked(const QModelIndex& index);
52
53

    private:
schultezub's avatar
schultezub committed
54
55
56
        /**
         * Setup Qt GUI stuff
         */
57
58
        void setup();

59
        TumVisApplication* _application;                    ///< Pointer to the application hosting the whole stuff
60

61
62
63
        QWidget* _centralWidget;                            ///< Central widget of the MainWindow
        PipelineTreeWidget* _pipelineWidget;                ///< Widget for browsing the active pipelines
        PropertyCollectionWidget* _propCollectionWidget;    ///< Widget for brosing the PropertyCollection of the selected pipeline/processor
64
65
66
67
    };
}

#endif // TUMVISMAINWINDOW_H__