Slicer  5.3
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  Q_PROPERTY(bool showMaximizeViewButton READ showMaximizeViewButton WRITE setShowMaximizeViewButton)
61 
62 public:
65 
67  explicit qMRMLViewControllerBar(QWidget* parent = nullptr);
68  ~qMRMLViewControllerBar() override;
69 
71  Popup=0,
72  Panel
73  };
74 
78  Q_INVOKABLE void setLayoutBehavior(LayoutBehavior behavior);
79 
83  Q_INVOKABLE QLayout* barLayout();
84 
88  Q_INVOKABLE QWidget* barWidget();
89 
91  Q_INVOKABLE QToolButton* pinButton();
92 
94  Q_INVOKABLE QLabel* viewLabel();
95 
96  bool showMaximizeViewButton()const;
97 
98 public slots:
99  void maximizeView();
100 
101  void setShowMaximizeViewButton(bool show);
102 
103 protected slots:
104  virtual void updateWidgetFromMRMLView();
105 
106 protected:
107  QScopedPointer<qMRMLViewControllerBarPrivate> d_ptr;
108  qMRMLViewControllerBar(qMRMLViewControllerBarPrivate* pimpl, QWidget* parent = nullptr);
109 
110  virtual void setMRMLViewNode(vtkMRMLAbstractViewNode* viewNode);
111  virtual vtkMRMLAbstractViewNode* mrmlViewNode() const;
112 
113 private:
114  Q_DECLARE_PRIVATE(qMRMLViewControllerBar);
115  Q_DISABLE_COPY(qMRMLViewControllerBar);
116 };
117 
118 #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.