Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

mainwindow.h 6.99 KB
Newer Older
1
2
// ================================================================================================
// 
schultezub's avatar
schultezub committed
3
// This file is part of the CAMPVis Software Framework.
4
5
// 
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
schultezub's avatar
schultezub committed
6
//      Christian Schulte zu Berge <christian.szb@in.tum.de>
7
8
9
//      Chair for Computer Aided Medical Procedures
//      Technische Universität München
//      Boltzmannstr. 3, 85748 Garching b. München, Germany
schultezub's avatar
schultezub committed
10
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 
// 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
30
31
#ifndef CAMPVISMAINWINDOW_H__
#define CAMPVISMAINWINDOW_H__
32
33

#include "sigslot/sigslot.h"
schultezub's avatar
schultezub committed
34
#include "application/campvisapplication.h"
35
#include "application/gui/pipelinetreewidget.h"
schultezub's avatar
schultezub committed
36
#include "application/gui/properties/propertycollectionwidget.h"
37
38
#include "application/tools/qtexteditlog.h"
#include "application/ui_mainwindow.h"
39
40

#include <QMainWindow>
41
42
#include <QVBoxLayout>
#include <QHBoxLayout>
43
#include <QPushButton>
44
#include <QTextEdit>
45
46
#include <vector>

schultezub's avatar
schultezub committed
47
namespace campvis {
48
    class DataContainerInspectorWidget;
49
    class DataContainerInspectorCanvas;
50

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

    public:
schultezub's avatar
schultezub committed
59
60
        /**
         * Creates a new TumVis Main window for \a application.
61
         * \param   application     CampVisApplication to create a GUI for.
schultezub's avatar
schultezub committed
62
         */
63
        MainWindow(CampVisApplication* application);
64

schultezub's avatar
schultezub committed
65
66
67
        /**
         * Destructor, make sure to call before destroying the application
         */
68
69
        ~MainWindow();

70
71
72
73
74
75
76
77
78
79
        
        /**
         * Initializes all OpenGL related stuff
         */
        void init();

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

schultezub's avatar
schultezub committed
81
82
83
        /**
         * Slot to be called by the application when its collection of pipelines has changed.
         */
84
85
        void onPipelinesChanged();

86
87
88
89
        /**
         * Size hint for the default window size
         * \return QSize(800, 450)
         */
90
91
        QSize sizeHint() const;

92
93
94
95
96
97
98
        /**
         * Adds a widget of a visualization pipeline to the main window.
         * \param   name       the name of the visualization pipeline.
         * \param   widget     the pipeline's widget to add to the main window.
         */
        void addVisualizationPipelineWidget(const std::string& name, QWidget* widget);

99
    signals:
100
        /// Qt signal for updating the PipelineWidget.
101
        void updatePipelineWidget(const std::vector<AbstractPipeline*>&);
102
        /// Qt signal for updating the PropertyCollectionWidget
schultezub's avatar
schultezub committed
103
        void updatePropCollectionWidget(HasPropertyCollection*);
104

105
106
107
108
109
110
    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);
111

112
113
114
115
116
117
118
119
120
121
        /**
         * Slot to be called when _btnExecute was clicked.
         */
        void onBtnExecuteClicked();

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

122
    private:
schultezub's avatar
schultezub committed
123
124
125
        /**
         * Setup Qt GUI stuff
         */
126
127
        void setup();

128
129
130
131
132
133
134
135
136
137
138
139
        /**
         * Adds a widget to the top docking area of the main window.
         * This method creates a new dock with the specified name,
         * sets its widget to the given widget, and docks it in top
         * docking area of the main window. If there are already
         * other docks there, they're tabified with the new dock.
         * \param   name       the name that will be given to the created dock
         * \param   widget     the widget to add to the top docking area of the main window
         * \return  the dock created to store the provided widget
         */
        QDockWidget* dockPrimaryWidget(const std::string& name, QWidget* widget);

140
141
        Ui::MainWindow ui;                                  ///< Interface definition of the MainWindow

142
        CampVisApplication* _application;                    ///< Pointer to the application hosting the whole stuff
143

144
145
146
        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
147
        DataContainerInspectorWidget* _dcInspectorWidget;   ///< Widget for inspecting the DataContainer of the selected pipeline.
148
        QDockWidget* _dcInspectorDock;                      ///< Dock storing the above DataContainerInspectorWidget instance.
149
150
151
152
153
154

        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
155
156
        QTextEditLog* _log;                                 ///< Log appending messages to a QTextEdit
        QTextEdit* _logViewer;                              ///< Widget displaying log messages
157
        std::vector<QDockWidget*> _primaryDocks;           ///< Docks located in top docking area of the main window
158
159
160
    };
}

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