Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLLayoutManager.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 __qMRMLLayoutManager_h
22#define __qMRMLLayoutManager_h
23
24// Qt includes
25#include <QStringList>
26class QWidget;
27
28// CTK includes
29#include <ctkLayoutFactory.h>
30
31// qMRML includes
32#include "qMRMLWidgetsExport.h"
33
34class qMRMLPlotWidget;
38class qMRMLLayoutManagerPrivate;
40
44class vtkMRMLScene;
45class vtkMRMLNode;
48class vtkMRMLViewNode;
50
51class vtkCollection;
52class vtkRenderer;
53
73class QMRML_WIDGETS_EXPORT qMRMLLayoutManager : public ctkLayoutFactory
74{
75 Q_OBJECT
76
83 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
84 // The following properties are exposed so that they are available within python
85 Q_PROPERTY(int layout READ layout WRITE setLayout NOTIFY layoutChanged DESIGNABLE false)
86 Q_PROPERTY(int threeDViewCount READ threeDViewCount DESIGNABLE false)
87 Q_PROPERTY(int tableViewCount READ tableViewCount DESIGNABLE false)
88 Q_PROPERTY(int plotViewCount READ plotViewCount DESIGNABLE false)
89
90public:
92 typedef ctkLayoutFactory Superclass;
93
95 explicit qMRMLLayoutManager(QObject* parent=nullptr);
96 explicit qMRMLLayoutManager(QWidget* viewport, QObject* parent);
97 ~qMRMLLayoutManager() override;
98
101 bool isEnabled()const;
102
107 Q_INVOKABLE virtual void registerViewFactory(ctkLayoutViewFactory* viewFactory);
108
112 Q_INVOKABLE QList<qMRMLLayoutViewFactory*> mrmlViewFactories()const;
113
117 Q_INVOKABLE qMRMLLayoutViewFactory* mrmlViewFactory(const QString& viewClassName)const;
118
122 Q_INVOKABLE vtkMRMLScene* mrmlScene()const;
123
127 Q_INVOKABLE QWidget* viewWidget(vtkMRMLNode* n) const;
128
130 Q_INVOKABLE QList<QWidget*> viewWidgets() const;
131
133 Q_INVOKABLE qMRMLSliceWidget* sliceWidget(const QString& name)const;
134
136 Q_INVOKABLE qMRMLThreeDWidget* threeDWidget(const QString& name)const;
137
141 Q_INVOKABLE QStringList sliceViewNames() const;
142
144 int threeDViewCount()const;
146 int tableViewCount()const;
148 int plotViewCount()const;
150 int viewCount() const;
151
156 Q_INVOKABLE qMRMLThreeDWidget* threeDWidget(int id)const;
157 Q_INVOKABLE qMRMLTableWidget* tableWidget(int id)const;
158 Q_INVOKABLE qMRMLPlotWidget* plotWidget(int id)const;
159
162 Q_INVOKABLE vtkCollection* mrmlSliceLogics()const;
163
166 Q_INVOKABLE vtkCollection* mrmlViewLogics()const;
167
168 Q_INVOKABLE void setMRMLColorLogic(vtkMRMLColorLogic* colorLogic);
169 Q_INVOKABLE vtkMRMLColorLogic* mrmlColorLogic()const;
170
174 int layout()const;
175
178 Q_INVOKABLE vtkMRMLLayoutLogic* layoutLogic()const;
179
184 Q_INVOKABLE vtkMRMLViewNode* activeMRMLThreeDViewNode()const;
189 Q_INVOKABLE vtkRenderer* activeThreeDRenderer()const;
194 Q_INVOKABLE vtkMRMLTableViewNode* activeMRMLTableViewNode()const;
199 Q_INVOKABLE vtkRenderer* activeTableRenderer()const;
204 Q_INVOKABLE vtkMRMLPlotViewNode* activeMRMLPlotViewNode()const;
209 Q_INVOKABLE vtkRenderer* activePlotRenderer()const;
210
215 int allViewsPauseRenderCount();
216
217public slots:
220 void setEnabled(bool enable);
221
224 void setMRMLScene(vtkMRMLScene* scene);
225
228 void setLayout(int newLayout);
229
232 void addMaximizedViewNode(vtkMRMLAbstractViewNode* viewNode);
233
235 void removeMaximizedViewNode(vtkMRMLAbstractViewNode* viewNode);
236
238 void removeAllMaximizedViewNodes();
239
242 void setLayoutNumberOfCompareViewRows(int num);
243 void setLayoutNumberOfCompareViewColumns(int num);
244
247 void resetThreeDViews();
248
251 void resetSliceViews();
252
257 void setRenderPaused(bool pause);
258
261 void pauseRender();
262
265 void resumeRender();
266
267signals:
268 void activeMRMLThreeDViewNodeChanged(vtkMRMLViewNode* newActiveMRMLThreeDViewNode);
269 void activeMRMLTableViewNodeChanged(vtkMRMLTableViewNode* newActiveMRMLTableViewNode);
270 void activeMRMLPlotViewNodeChanged(vtkMRMLPlotViewNode* newActiveMRMLPlotViewNode);
271 void activeThreeDRendererChanged(vtkRenderer* newRenderer);
272 void activeTableRendererChanged(vtkRenderer* newRenderer);
273 void activePlotRendererChanged(vtkRenderer* newRenderer);
274 void layoutChanged(int);
275
277 void nodeAboutToBeEdited(vtkMRMLNode* node);
278
279protected:
280 QScopedPointer<qMRMLLayoutManagerPrivate> d_ptr;
281 qMRMLLayoutManager(qMRMLLayoutManagerPrivate* obj, QWidget* viewport, QObject* parent);
282
283 QWidget* createViewport(const QDomElement& layoutElement, const QString& viewportName) override;
284 void onViewportChanged() override;
285 void onViewportUsageChanged(const QString& viewportName) override;
286
287 using ctkLayoutManager::setLayout;
288private:
289 Q_DECLARE_PRIVATE(qMRMLLayoutManager);
290 Q_DISABLE_COPY(qMRMLLayoutManager);
291};
292
293#endif
ctkLayoutFactory Superclass
Superclass typedef.
qMRMLPlotWidget is the top-level Plotting widget that can be packed in a layout.
qMRMLTableWidget is the top-level table widget that can be packed in a layout.
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
MRML logic class for color manipulation.
MRML logic class for layout manipulation.
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent Plot view parameters.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a table object.
MRML node to represent table view parameters.
MRML node to represent a 3D view.