mainwindow.h 3.98 KB
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
// ================================================================================================
// 
// This file is part of the TUMVis Visualization Framework.
// 
// 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.
// 
// ================================================================================================

29
30
31
32
33
34
#ifndef TUMVISMAINWINDOW_H__
#define TUMVISMAINWINDOW_H__

#include "sigslot/sigslot.h"
#include "application/tumvisapplication.h"
#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
41
42
#include <vector>

namespace TUMVis {
schultezub's avatar
schultezub committed
43
44
45
46
    /**
     * Main Window for the TUMVis application.
     * Wraps a nice Qt GUI around the TumVisApplication instance given during creation.
     */
47
48
49
50
    class MainWindow : public QMainWindow, public sigslot::has_slots<> {
        Q_OBJECT;

    public:
schultezub's avatar
schultezub committed
51
52
53
54
        /**
         * Creates a new TumVis Main window for \a application.
         * \param   application     TumVisApplication to create a GUI for.
         */
55
56
        MainWindow(TumVisApplication* application);

schultezub's avatar
schultezub committed
57
58
59
        /**
         * Destructor, make sure to call before destroying the application
         */
60
61
62
        ~MainWindow();


schultezub's avatar
schultezub committed
63
64
65
        /**
         * Slot to be called by the application when its collection of pipelines has changed.
         */
66
67
        void onPipelinesChanged();

68
69
        QSize sizeHint() const;

70
    signals:
71
        /// Qt signal for updating the PipelineWidget.
72
        void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
73
        /// Qt signal for updating the PropertyCollectionWidget
schultezub's avatar
schultezub committed
74
        void updatePropCollectionWidget(HasPropertyCollection*);
75

76
77
78
79
80
81
    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);
82
83

    private:
schultezub's avatar
schultezub committed
84
85
86
        /**
         * Setup Qt GUI stuff
         */
87
88
        void setup();

89
        TumVisApplication* _application;                    ///< Pointer to the application hosting the whole stuff
90

91
92
93
        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
94
95
96
97
    };
}

#endif // TUMVISMAINWINDOW_H__