datacontainerfileloaderwidget.h 4 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
// ================================================================================================
// 
// This file is part of the CAMPVis Software Framework.
// 
// If not explicitly stated otherwise: Copyright (C) 2012-2013, 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
// 
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
// 
// 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
// 
// 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.
// 
// ================================================================================================

25
26
#ifndef DATACONTAINERFILELOADERWIDGET_H
#define DATACONTAINERFILELOADERWIDGET_H
27
28
29
30

#include "sigslot/sigslot.h"

#include "application/gui/properties/propertycollectionwidget.h"
31
#include "modules/io/processors/genericimagereader.h"
32
#include "application/gui/datacontainerinspectorwidget.h"
33
34

#include <QScrollArea>
35
#include <QGridLayout>
36
37
38
39
#include <QPushButton>

namespace campvis {

40
    class DataContainerFileLoaderWidget : public QWidget, public sigslot::has_slots<> {
41
42
43
44
        Q_OBJECT;

    public:
        /**
45
46
         * Creates a new DataContainerFileLoaderWidget.
         * \param   treeModel       Parent DataContainerInspectorWidget. Method Overridden to keep the widget floating.
47
48
         * \param   parent          Parent Qt widget, may be 0 (default)
         */
49
        explicit DataContainerFileLoaderWidget(DataContainerInspectorWidget* treeModel, QWidget* parent = nullptr);
50
51
52
53

        /**
         * Destructor.
         */
54
        ~DataContainerFileLoaderWidget();
55
56
57
58
59
60
61
62
63

        /**
         * Set the DataContainer this widget is inspecting.
         * \param   dataContainer   The DataContainer this widget shall inspect, may be 0.
         */
        void setDataContainer(DataContainer* dataContainer);

        /**
         * Size hint for the default window size
64
         * \return QSize(300, 350)
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
         */
        QSize sizeHint() const;
        
        /**
         * Initializes the OpenGL stuff (e.g. shaders).
         * Must be called with a valid and locked OpenGL context.
         */
        virtual void init();

        /**
         * Deinitializes the OpenGL stuff (e.g. shaders).
         * Must be called with a valid and locked OpenGL context.
         */
        void deinit();

    private slots:
        /**
         * Slot being called when the user clicks on the "Cancel" button.
         */
        void onBtnCancelClicked();

        /**
         * Slot being called when the user clicks on the "Load File" button.
         */
        void onBtnLoadFileClicked();

    protected:
        /**
         * Setup the GUI stuff
         */
        void setupGUI();

    protected:

        DataContainer* _dataContainer;                  ///< The DataContainer this widget is inspecting
100
        QGridLayout* _layout;                       ///< Layout for the _infoWidget
101
        QScrollArea* _pipelinePropertiesScrollArea;     ///< Scroll area for _pipelinePropertiesWidget
102

103
    protected:
104
105
        QPushButton* _btnCancel;
        QPushButton* _btnLoadFile;
106
        StringProperty _fileName;
107
        PropertyCollectionWidget* _propCollectionWidget;    ///< Widget for browsing the PropertyCollection of the selected pipeline/processor
108
109

        GenericImageReader *_imgReader;
110
        DataContainerInspectorWidget* _parent;
111
        
112
        static const std::string loggerCat_;
113
114
115

    private:

116
117
118
    };
}

119
#endif // DATACONTAINERFILELOADERWIDGET_H