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 9.77 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-2015, all rights reserved,
schultezub's avatar
schultezub committed
6
//      Christian Schulte zu Berge <christian.szb@in.tum.de>
7
//      Chair for Computer Aided Medical Procedures
8
9
//      Technische Universitaet Muenchen
//      Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
10
// 
schultezub's avatar
schultezub committed
11
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
12
// 
13
14
15
16
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
// except in compliance with the License. You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
17
// 
18
19
20
21
// Unless required by applicable law or agreed to in writing, software distributed under the 
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
// either express or implied. See the License for the specific language governing permissions 
// and limitations under the License.
22
23
24
// 
// ================================================================================================

schultezub's avatar
schultezub committed
25
26
#ifndef CAMPVISMAINWINDOW_H__
#define CAMPVISMAINWINDOW_H__
27
28

#include "sigslot/sigslot.h"
29
#include "application/applicationapi.h"
schultezub's avatar
schultezub committed
30
#include "application/campvisapplication.h"
31
#include "application/gui/mdi/mdidockarea.h"
32
#include "application/gui/pipelinetreewidget.h"
schultezub's avatar
schultezub committed
33
#include "application/gui/properties/propertycollectionwidget.h"
34
#include "application/gui/logviewerwidget.h"
35
#include "application/gui/scriptingwidget.h"
36
#include "application/gui/workflowcontrollerwidget.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>
Christian Schulte zu Berge's avatar
Christian Schulte zu Berge committed
44
#include <QComboBox>
45
#include <QScrollArea>
46
47
#include <vector>

schultezub's avatar
schultezub committed
48
namespace campvis {
49
    class DataContainerInspectorWidget;
50
    class DataContainerInspectorCanvas;
51
    class MdiDockableWindow;
52
    class LuaTableTreeWidget;
53

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

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

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

73
74
75
76
77
78
79
80
81
82
        
        /**
         * Initializes all OpenGL related stuff
         */
        void init();

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

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

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

97
98
99
100
101
102
103

        /**
         * Sets the workflow of this Mainwindow to \a w.
         * \param   w   The workflow to display for this window.
         */
        void setWorkflow(AbstractWorkflow* w);

104
105
106
107
108
109
        /**
         * Enables the kiosk mode of the MainWindow.
         * In kiosk mode, all docks but the main canvas and the workflow dock are hidden.
         */
        void enableKioskMode();

110
111
112
113
114
115
116
117
    protected:
        /**
         * Listens to resize events on _pipelinePropertiesWidget and resizes _pipelinePropertiesScrollArea accordingly
         * \param   watched    the object that caused the event
         * \param   event      the event to be filtered
         */
        bool eventFilter(QObject* watched, QEvent* event);

118
    signals:
119
        /// Qt signal for updating the PipelineWidget.
120
121
        void updatePipelineWidget(const std::vector<DataContainer*>&, const std::vector<AbstractPipeline*>&);

122
        /// Qt signal for updating the PropertyCollectionWidget
123
        void updatePropCollectionWidget(HasPropertyCollection*, DataContainer*);
124

125
    public slots:
126
127
128
129
        /**
         * Slot to be called by the PipelineWidget when the selected item changes.
         * \param   index   Index of the selected item
         */
130
131
        void onPipelineWidgetItemChanged(const QModelIndex& index);

132
133
134
135
136
137
138
139
140
141
        /**
         * Slot to be called when _btnExecute was clicked.
         */
        void onBtnExecuteClicked();

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

Hossain Mahmud's avatar
stuck!    
Hossain Mahmud committed
142
143
144
145
146
147
148
149
150
151
        /**
         * Slot to be called when _btnExecute was clicked.
         */
        void onBtnLuaLoadClicked();

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

152
153
154
        /// Slot to be called when _btnPipelineFactory was clicked;
        void onBtnPipelineFactoryClicked();

155
156
157
        /// Slot to be called when _btnProcessorFactory was clicked;
        void onBtnProcessorFactoryClicked();

158
159
160
        /// Slot to be called when all shaders shall be rebuilt.
        void onRebuildShadersClicked();

161
162
163
        /// Slot to be called when a Lua command shall be executed.
        void onLuaCommandExecuted(const QString& cmd);

164
    private:
165
166
167
168
169
170
171
172
173

        /**
         * Slot to be called by the application when its collection of pipelines has changed.
         */
        void onPipelinesChanged();

        /**
         * Slot to be called by the application when its collection of DataContainers has changed.
         */
174
        void onDataContainersChanged(); 
175

schultezub's avatar
schultezub committed
176
177
178
        /**
         * Setup Qt GUI stuff
         */
179
180
        void setup();

181
182
183
184
185
        /**
         * Create and populate the application's main menu.
         */
        void populateMainMenu();

186
187
188
189
190
191
192
193
194
195
196
197
        /**
         * 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);

198
199
        Ui::MainWindow ui;                                  ///< Interface definition of the MainWindow

200
        CampVisApplication* _application;                    ///< Pointer to the application hosting the whole stuff
201

202
        MdiDockArea* _mdiArea;                              ///< MDI area (the window's central widget)
203
204
205
        QWidget* _containerWidget;                          ///< Widget to manage the app's DataContainers and pipelines
        QComboBox* _cbPipelineFactory;                      ///< Combobox for selecting the Pipelines from the PipelineFactory
        QPushButton* _btnPipelineFactory;                   ///< Button to add a Pipeline from the factory
206
        PipelineTreeWidget* _pipelineWidget;                ///< Widget for browsing the active pipelines
207
208
        QWidget* _pipelinePropertiesWidget;                 ///< Widget showing the selected pipeline's properties
        QScrollArea* _pipelinePropertiesScrollArea;         ///< Scroll area for _pipelinePropertiesWidget
209
        PropertyCollectionWidget* _propCollectionWidget;    ///< Widget for brosing the PropertyCollection of the selected pipeline/processor
210
        DataContainerInspectorWidget* _dcInspectorWidget;   ///< Widget for inspecting the DataContainer of the selected pipeline.
211
        MdiDockableWindow* _dcInspectorWindow;              ///< Window displaying the above DataContainerInspectorWidget instance.
212
213
214
215
216
217

        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
218
219
        DataContainer* _selectedDataContainer;              ///< currently selected DataContainer

220
        LogViewerWidget* _logViewer;                        ///< Widget displaying log messages
221
        ScriptingWidget* _scriptingConsoleWidget;           ///< Widget showing the scripting console (if available)
222
        LuaTableTreeWidget* _luaTreeWidget;                 ///< Tree widget showing the global Lua variables
223
        WorkflowControllerWidget* _workflowWidget;          ///< Widget showing the workflow controller
224
225
226
        
        QComboBox* _cbProcessorFactory;                      ///< Combobox for selecting the Processor from the ProcessorFactory
        QPushButton* _btnProcessorFactory;                   ///< Button to add a Processor from the factory to the selected Pipeline
227

Hossain Mahmud's avatar
stuck!    
Hossain Mahmud committed
228
229
230
        QPushButton* _btnLuaLoad;
        QPushButton* _btnLuaSave;

231
        std::vector<QDockWidget*> _primaryDocks;            ///< Docks located in top docking area of the main window
232
233
234
    };
}

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