Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLViewControllerBar.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLViewControllerBar_h
22 #define __qMRMLViewControllerBar_h
23 
24 // Qt includes
25 class QLabel;
26 class QLayout;
27 class QToolButton;
28 
29 // CTK includes
30 #include <ctkVTKObject.h>
31 
32 // qMRMLWidget includes
33 #include "qMRMLWidget.h"
34 #include "qMRMLWidgetsExport.h"
35 class qMRMLViewControllerBarPrivate;
37 
43 //
44 // Widget layout:
45 // VBoxLayout (ControllerLayout)
46 // Widget (BarWidget)
47 // HBoxLayout (BarLayout)
48 // Optional PopupWidget (can be statically displayed under BarWidget if ControllerBar is a panel)
49 //
50 //
51 // To add widgets to the "bar" section, add them to the barLayout().
52 // To add widgets to the "controller" section (when not using a
53 // popup), add them to the layout().
54 //
55 class QMRML_WIDGETS_EXPORT qMRMLViewControllerBar
56  : public qMRMLWidget
57 {
58  Q_OBJECT
59  QVTK_OBJECT
60 
61 public:
64 
66  explicit qMRMLViewControllerBar(QWidget* parent = nullptr);
67  ~qMRMLViewControllerBar() override;
68 
70  Popup=0,
71  Panel
72  };
73 
77  Q_INVOKABLE void setLayoutBehavior(LayoutBehavior behavior);
78 
82  Q_INVOKABLE QLayout* barLayout();
83 
87  Q_INVOKABLE QWidget* barWidget();
88 
90  Q_INVOKABLE QToolButton* pinButton();
91 
93  Q_INVOKABLE QLabel* viewLabel();
94 
95 public slots:
96  void maximizeView();
97 
98 protected slots:
99  virtual void updateWidgetFromMRMLView();
100 
101 protected:
102  QScopedPointer<qMRMLViewControllerBarPrivate> d_ptr;
103  qMRMLViewControllerBar(qMRMLViewControllerBarPrivate* pimpl, QWidget* parent = nullptr);
104 
105  virtual void setMRMLViewNode(vtkMRMLAbstractViewNode* viewNode);
106  virtual vtkMRMLAbstractViewNode* mrmlViewNode() const;
107 
108 private:
109  Q_DECLARE_PRIVATE(qMRMLViewControllerBar);
110  Q_DISABLE_COPY(qMRMLViewControllerBar);
111 };
112 
113 #endif
QScopedPointer< qMRMLViewControllerBarPrivate > d_ptr
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
qMRMLWidget Superclass
Superclass typedef.