mainwindow.h 5.31 KB
Newer Older
1
2
// ================================================================================================
// 
schultezub's avatar
schultezub committed
3
// This file is part of the CAMPVis Visualization Framework.
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
// 
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
//      Christian Schulte zu Berge (christian.szb@in.tum.de)
//      Chair for Computer Aided Medical Procedures
//      Technische Universität München
//      Boltzmannstr. 3, 85748 Garching b. München, Germany
// 
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
// 
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// 
// ================================================================================================

schultezub's avatar
schultezub committed
29
30
#ifndef CAMPVISMAINWINDOW_H__
#define CAMPVISMAINWINDOW_H__
31
32

#include "sigslot/sigslot.h"
schultezub's avatar
schultezub committed
33
#include "application/campvisapplication.h"
34
#include "application/gui/pipelinetreewidget.h"
schultezub's avatar
schultezub committed
35
#include "application/gui/properties/propertycollectionwidget.h"
36
37

#include <QMainWindow>
38
39
#include <QVBoxLayout>
#include <QHBoxLayout>
40
#include <QPushButton>
41
42
#include <vector>

schultezub's avatar
schultezub committed
43
namespace campvis {
44
    class DataContainerInspectorWidget;
45
    class DataContainerInspectorCanvas;
46

schultezub's avatar
schultezub committed
47
    /**
schultezub's avatar
schultezub committed
48
     * Main Window for the CAMPVis application.
schultezub's avatar
schultezub committed
49
50
     * Wraps a nice Qt GUI around the TumVisApplication instance given during creation.
     */
51
52
53
54
    class MainWindow : public QMainWindow, public sigslot::has_slots<> {
        Q_OBJECT;

    public:
schultezub's avatar
schultezub committed
55
56
57
58
        /**
         * Creates a new TumVis Main window for \a application.
         * \param   application     TumVisApplication to create a GUI for.
         */
59
60
        MainWindow(TumVisApplication* application);

schultezub's avatar
schultezub committed
61
62
63
        /**
         * Destructor, make sure to call before destroying the application
         */
64
65
        ~MainWindow();

66
67
68
69
70
71
72
73
74
75
        
        /**
         * Initializes all OpenGL related stuff
         */
        void init();

        /**
         * Deinitializes all OpenGL related stuff
         */
        void deinit();
76

schultezub's avatar
schultezub committed
77
78
79
        /**
         * Slot to be called by the application when its collection of pipelines has changed.
         */
80
81
        void onPipelinesChanged();

82
83
84
85
        /**
         * Size hint for the default window size
         * \return QSize(800, 450)
         */
86
87
        QSize sizeHint() const;

88
    signals:
89
        /// Qt signal for updating the PipelineWidget.
90
        void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
91
        /// Qt signal for updating the PropertyCollectionWidget
schultezub's avatar
schultezub committed
92
        void updatePropCollectionWidget(HasPropertyCollection*);
93

94
95
96
97
98
99
    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);
100

101
102
103
104
105
106
107
108
109
110
        /**
         * Slot to be called when _btnExecute was clicked.
         */
        void onBtnExecuteClicked();

        /**
         * Slot to be called when _btnShowDataContainerInspector was clicked.
         */
        void onBtnShowDataContainerInspectorClicked();

111
    private:
schultezub's avatar
schultezub committed
112
113
114
        /**
         * Setup Qt GUI stuff
         */
115
116
        void setup();

117
        TumVisApplication* _application;                    ///< Pointer to the application hosting the whole stuff
118

119
120
121
        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
122
123
        DataContainerInspectorWidget* _dcInspectorWidget;   ///< Widget for inspecting the DataContainer of the selected pipeline.

124
125
        DataContainerInspectorCanvas* _dcInspectorCanvas;

126
127
128
129
130
        QPushButton* _btnExecute;                           ///< Button to execute the selected pipeline/processor
        QPushButton* _btnShowDataContainerInspector;        ///< Button to show the DataContainerInspector for the selected pipeline

        AbstractPipeline* _selectedPipeline;                ///< currently selected pipeline
        AbstractProcessor* _selectedProcessor;              ///< currently selected processor
131
132
133
    };
}

schultezub's avatar
schultezub committed
134
#endif // CAMPVISMAINWINDOW_H__