Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLLayoutManager Class Reference

#include <Libs/MRML/Widgets/qMRMLLayoutManager.h>

Inheritance diagram for qMRMLLayoutManager:
Collaboration diagram for qMRMLLayoutManager:

Public Types

typedef ctkLayoutFactory Superclass
 Superclass typedef.
 

Properties

bool enabled
 
int layout
 
int plotViewCount
 
int tableViewCount
 
int threeDViewCount
 

Public Slots

void addMaximizedViewNode (vtkMRMLAbstractViewNode *viewNode)
 
void pauseRender ()
 
void removeAllMaximizedViewNodes ()
 Restore original (non-maximized) view layouts in all viewports.
 
void removeMaximizedViewNode (vtkMRMLAbstractViewNode *viewNode)
 Restores the original (non-maximized) layout of the viewport.
 
void resetSliceViews ()
 
void resetThreeDViews ()
 
void resumeRender ()
 
void setEnabled (bool enable)
 
void setLayout (int newLayout)
 
void setLayoutNumberOfCompareViewColumns (int num)
 
void setLayoutNumberOfCompareViewRows (int num)
 
void setMRMLScene (vtkMRMLScene *scene)
 
void setRenderPaused (bool pause)
 

Signals

void activeMRMLPlotViewNodeChanged (vtkMRMLPlotViewNode *newActiveMRMLPlotViewNode)
 
void activeMRMLTableViewNodeChanged (vtkMRMLTableViewNode *newActiveMRMLTableViewNode)
 
void activeMRMLThreeDViewNodeChanged (vtkMRMLViewNode *newActiveMRMLThreeDViewNode)
 
void activePlotRendererChanged (vtkRenderer *newRenderer)
 
void activeTableRendererChanged (vtkRenderer *newRenderer)
 
void activeThreeDRendererChanged (vtkRenderer *newRenderer)
 
void layoutChanged (int)
 
void nodeAboutToBeEdited (vtkMRMLNode *node)
 Signal emitted when editing of a node is requested from within the layout.
 

Public Member Functions

Q_INVOKABLE vtkMRMLPlotViewNodeactiveMRMLPlotViewNode () const
 
Q_INVOKABLE vtkMRMLTableViewNodeactiveMRMLTableViewNode () const
 
Q_INVOKABLE vtkMRMLViewNodeactiveMRMLThreeDViewNode () const
 
Q_INVOKABLE vtkRenderer * activePlotRenderer () const
 
Q_INVOKABLE vtkRenderer * activeTableRenderer () const
 
Q_INVOKABLE vtkRenderer * activeThreeDRenderer () const
 
int allViewsPauseRenderCount ()
 
bool isEnabled () const
 
int layout () const
 
Q_INVOKABLE vtkMRMLLayoutLogiclayoutLogic () const
 
Q_INVOKABLE vtkMRMLColorLogicmrmlColorLogic () const
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
Q_INVOKABLE vtkCollection * mrmlSliceLogics () const
 
Q_INVOKABLE QList< qMRMLLayoutViewFactory * > mrmlViewFactories () const
 
Q_INVOKABLE qMRMLLayoutViewFactorymrmlViewFactory (const QString &viewClassName) const
 
Q_INVOKABLE vtkCollection * mrmlViewLogics () const
 
int plotViewCount () const
 Return the number of table views.
 
Q_INVOKABLE qMRMLPlotWidgetplotWidget (int id) const
 
 qMRMLLayoutManager (QObject *parent=nullptr)
 Constructors.
 
 qMRMLLayoutManager (QWidget *viewport, QObject *parent)
 
virtual Q_INVOKABLE void registerViewFactory (ctkLayoutViewFactory *viewFactory)
 
Q_INVOKABLE void setMRMLColorLogic (vtkMRMLColorLogic *colorLogic)
 
Q_INVOKABLE QStringList sliceViewNames () const
 
Q_INVOKABLE qMRMLSliceWidgetsliceWidget (const QString &name) const
 Get slice view widget identified by name.
 
int tableViewCount () const
 Return the number of plot views.
 
Q_INVOKABLE qMRMLTableWidgettableWidget (int id) const
 
int threeDViewCount () const
 Return the number of instantiated ThreeDRenderView.
 
Q_INVOKABLE qMRMLThreeDWidgetthreeDWidget (const QString &name) const
 Get 3D widget identified by name.
 
Q_INVOKABLE qMRMLThreeDWidgetthreeDWidget (int id) const
 
int viewCount () const
 Return the total number of views.
 
Q_INVOKABLE QWidget * viewWidget (vtkMRMLNode *n) const
 
Q_INVOKABLE QList< QWidget * > viewWidgets () const
 Get a list of all QWidgets for all views in the layout manager.
 
 ~qMRMLLayoutManager () override
 

Protected Member Functions

QWidget * createViewport (const QDomElement &layoutElement, const QString &viewportName) override
 
void onViewportChanged () override
 
void onViewportUsageChanged (const QString &viewportName) override
 
 qMRMLLayoutManager (qMRMLLayoutManagerPrivate *obj, QWidget *viewport, QObject *parent)
 

Protected Attributes

QScopedPointer< qMRMLLayoutManagerPrivate > d_ptr
 

Detailed Description

MRML layout manager that instantiates the Qt widgets and layouts from the layout node and the view nodes in the scene. The management (creation, configuration and deletion) of the view widgets are delegated to qMRMLLayoutViewFactory. Example to change a default factory:

qMRMLLayoutSliceViewFactory* mrmlSliceViewFactory =
qobject_cast<qMRMLLayoutSliceViewFactory*>(
app->layoutManager()->mrmlViewFactory("vtkMRMLSliceNode"));
MySliceViewFactory* mySliceViewFactory =
new MySliceViewFactory(app->layoutManager());
mySliceViewFactory->setSliceLogics(mrmlSliceViewFactory->sliceLogics());
app->layoutManager()->unregisterViewFactory(mrmlSliceViewFactory);
app->layoutManager()->registerViewFactory(mySliceViewFactory);

You can also register ctkLayoutViewFactories that are not related to MRML view nodes.

See also
ctkLayoutFactory, ctkLayoutManager, qMRMLLayoutViewFactory

Definition at line 73 of file qMRMLLayoutManager.h.

Member Typedef Documentation

◆ Superclass

typedef ctkLayoutFactory qMRMLLayoutManager::Superclass

Superclass typedef.

Definition at line 92 of file qMRMLLayoutManager.h.

Property Documentation

◆ enabled

bool qMRMLLayoutManager::enabled
readwrite

This property controls whether the layout manager reacts to layout node changes or note. When enabled (default), the layout is updated each time the layout node is modified and when the scene leaves batch-process state. It can be useful to temporarily disable the manager when loading a scene, it could otherwise change the layout.

See also
isEnabled(), setEnabled(), setMRMLScene()

Definition at line 83 of file qMRMLLayoutManager.h.

◆ layout

int qMRMLLayoutManager::layout
readwrite

Definition at line 85 of file qMRMLLayoutManager.h.

◆ plotViewCount

int qMRMLLayoutManager::plotViewCount
read

Definition at line 88 of file qMRMLLayoutManager.h.

◆ tableViewCount

int qMRMLLayoutManager::tableViewCount
read

Definition at line 87 of file qMRMLLayoutManager.h.

◆ threeDViewCount

int qMRMLLayoutManager::threeDViewCount
read

Definition at line 86 of file qMRMLLayoutManager.h.

Constructor & Destructor Documentation

◆ qMRMLLayoutManager() [1/3]

qMRMLLayoutManager::qMRMLLayoutManager ( QObject * parent = nullptr)
explicit

Constructors.

◆ qMRMLLayoutManager() [2/3]

qMRMLLayoutManager::qMRMLLayoutManager ( QWidget * viewport,
QObject * parent )
explicit

◆ ~qMRMLLayoutManager()

qMRMLLayoutManager::~qMRMLLayoutManager ( )
override

◆ qMRMLLayoutManager() [3/3]

qMRMLLayoutManager::qMRMLLayoutManager ( qMRMLLayoutManagerPrivate * obj,
QWidget * viewport,
QObject * parent )
protected

Member Function Documentation

◆ activeMRMLPlotViewNode()

Q_INVOKABLE vtkMRMLPlotViewNode * qMRMLLayoutManager::activeMRMLPlotViewNode ( ) const

Return the view node of the active plot view.

Todo
For now the active view is the first plot view.
See also
activePlotRenderer(), activeMRMLThreeDViewNode(), activeThreeDRenderer()

◆ activeMRMLPlotViewNodeChanged

void qMRMLLayoutManager::activeMRMLPlotViewNodeChanged ( vtkMRMLPlotViewNode * newActiveMRMLPlotViewNode)
signal

◆ activeMRMLTableViewNode()

Q_INVOKABLE vtkMRMLTableViewNode * qMRMLLayoutManager::activeMRMLTableViewNode ( ) const

Return the view node of the active table view.

Todo
For now the active view is the first table view.
See also
activeTableRenderer(), activeMRMLThreeDViewNode(), activeThreeDRenderer()

◆ activeMRMLTableViewNodeChanged

void qMRMLLayoutManager::activeMRMLTableViewNodeChanged ( vtkMRMLTableViewNode * newActiveMRMLTableViewNode)
signal

◆ activeMRMLThreeDViewNode()

Q_INVOKABLE vtkMRMLViewNode * qMRMLLayoutManager::activeMRMLThreeDViewNode ( ) const

Return the view node of the active 3D view.

Todo
For now the active view is the first 3D view.
See also
activeThreeDRenderer(), activeMRMLPlotViewNode(), activePlotRenderer()

◆ activeMRMLThreeDViewNodeChanged

void qMRMLLayoutManager::activeMRMLThreeDViewNodeChanged ( vtkMRMLViewNode * newActiveMRMLThreeDViewNode)
signal

◆ activePlotRenderer()

Q_INVOKABLE vtkRenderer * qMRMLLayoutManager::activePlotRenderer ( ) const

Return the renderer of the active plot view.

Todo
For now the active view is the first plot view.
See also
activeMRMLPlotViewNode(), activeMRMLThreeDViewNode(), activeThreeDRenderer()

◆ activePlotRendererChanged

void qMRMLLayoutManager::activePlotRendererChanged ( vtkRenderer * newRenderer)
signal

◆ activeTableRenderer()

Q_INVOKABLE vtkRenderer * qMRMLLayoutManager::activeTableRenderer ( ) const

Return the renderer of the active table view.

Todo
For now the active view is the first table view.
See also
activeMRMLTableViewNode(), activeMRMLThreeDViewNode(), activeThreeDRenderer()

◆ activeTableRendererChanged

void qMRMLLayoutManager::activeTableRendererChanged ( vtkRenderer * newRenderer)
signal

◆ activeThreeDRenderer()

Q_INVOKABLE vtkRenderer * qMRMLLayoutManager::activeThreeDRenderer ( ) const

Return the renderer of the active 3D view.

Todo
For now the active view is the first 3D view.
See also
activeThreeDRenderer(), activeMRMLPlotViewNode(), activePlotRenderer()

◆ activeThreeDRendererChanged

void qMRMLLayoutManager::activeThreeDRendererChanged ( vtkRenderer * newRenderer)
signal

◆ addMaximizedViewNode

void qMRMLLayoutManager::addMaximizedViewNode ( vtkMRMLAbstractViewNode * viewNode)
slot

Makes a view displayed maximized (taking the entire area) of its viewport. Calling removeMaximizedViewNode() with the same view node restores the original view layout.

◆ allViewsPauseRenderCount()

int qMRMLLayoutManager::allViewsPauseRenderCount ( )

Returns the number of global pause render counts that have been called on the layout manager. This value does not include pauseRender counts that have been called on each view individually, and is used to set the pause render state when new views are created.

See also
pauseRender(), resumeRender(), setRenderPaused()

◆ createViewport()

QWidget * qMRMLLayoutManager::createViewport ( const QDomElement & layoutElement,
const QString & viewportName )
overrideprotected

◆ isEnabled()

bool qMRMLLayoutManager::isEnabled ( ) const

Return the enabled property value.

See also
enabled

◆ layout()

int qMRMLLayoutManager::layout ( ) const

Returns the current layout. it's the same value than vtkMRMLLayoutNode::ViewArrangement

See also
vtkMRMLLayoutNode::SlicerLayout, layoutLogic()

◆ layoutChanged

void qMRMLLayoutManager::layoutChanged ( int )
signal

◆ layoutLogic()

Q_INVOKABLE vtkMRMLLayoutLogic * qMRMLLayoutManager::layoutLogic ( ) const

Return the layout logic instantiated and used by the manager.

See also
setLayout(), layout()

◆ mrmlColorLogic()

Q_INVOKABLE vtkMRMLColorLogic * qMRMLLayoutManager::mrmlColorLogic ( ) const

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene * qMRMLLayoutManager::mrmlScene ( ) const

Return the mrml scene of the layout manager. It is the scene that is set by setMRMLScene().

See also
setMRMLScene(), enabled

◆ mrmlSliceLogics()

Q_INVOKABLE vtkCollection * qMRMLLayoutManager::mrmlSliceLogics ( ) const

Return the up-to-date list of vtkMRMLSliceLogics associated to the slice views. The returned collection object is owned by the layout manager.

◆ mrmlViewFactories()

Q_INVOKABLE QList< qMRMLLayoutViewFactory * > qMRMLLayoutManager::mrmlViewFactories ( ) const

Return the list of registered MRML view factories.

See also
registeredViewFactories(), registerViewFactory(), unregisterViewFactory()

◆ mrmlViewFactory()

Q_INVOKABLE qMRMLLayoutViewFactory * qMRMLLayoutManager::mrmlViewFactory ( const QString & viewClassName) const

Return the view factory that handles the viewClassName view nodes. This can be used to replace a view factory with another one.

See also
mrmlViewFactories(), registerViewFactory(), unregisterViewFactory()

◆ mrmlViewLogics()

Q_INVOKABLE vtkCollection * qMRMLLayoutManager::mrmlViewLogics ( ) const

Return the up-to-date list of vtkMRMLViewLogics associated to the threeD views. The returned collection object is owned by the layout manager.

◆ nodeAboutToBeEdited

void qMRMLLayoutManager::nodeAboutToBeEdited ( vtkMRMLNode * node)
signal

Signal emitted when editing of a node is requested from within the layout.

◆ onViewportChanged()

void qMRMLLayoutManager::onViewportChanged ( )
overrideprotected

◆ onViewportUsageChanged()

void qMRMLLayoutManager::onViewportUsageChanged ( const QString & viewportName)
overrideprotected

◆ pauseRender

void qMRMLLayoutManager::pauseRender ( )
slot

Equivalent to setRenderPaused(true)

See also
setRenderPaused

◆ plotViewCount()

int qMRMLLayoutManager::plotViewCount ( ) const

Return the number of table views.

◆ plotWidget()

Q_INVOKABLE qMRMLPlotWidget * qMRMLLayoutManager::plotWidget ( int id) const

◆ registerViewFactory()

virtual Q_INVOKABLE void qMRMLLayoutManager::registerViewFactory ( ctkLayoutViewFactory * viewFactory)
virtual

Reimplemented for internal reasons. If the registered view factory is a qMRMLLayoutViewFactory, then set its layoutManager and its mrmlScene.

See also
ctkLayoutFactory::registerViewFactory(), unregisterViewFactory()

◆ removeAllMaximizedViewNodes

void qMRMLLayoutManager::removeAllMaximizedViewNodes ( )
slot

Restore original (non-maximized) view layouts in all viewports.

◆ removeMaximizedViewNode

void qMRMLLayoutManager::removeMaximizedViewNode ( vtkMRMLAbstractViewNode * viewNode)
slot

Restores the original (non-maximized) layout of the viewport.

◆ resetSliceViews

void qMRMLLayoutManager::resetSliceViews ( )
slot

◆ resetThreeDViews

void qMRMLLayoutManager::resetThreeDViews ( )
slot

Reset focal view around volumes

See also
ctkVTKRenderView::resetFocalPoint(), ctkVTKRenderView::resetCamera()

◆ resumeRender

void qMRMLLayoutManager::resumeRender ( )
slot

Equivalent to setRenderPaused(false)

See also
setRenderPaused

◆ setEnabled

void qMRMLLayoutManager::setEnabled ( bool enable)
slot

Set the enabled property value

See also
enabled

◆ setLayout

void qMRMLLayoutManager::setLayout ( int newLayout)
slot

Change the current layout (see vtkMRMLLayoutNode::SlicerLayout) It creates views if needed.

◆ setLayoutNumberOfCompareViewColumns

void qMRMLLayoutManager::setLayoutNumberOfCompareViewColumns ( int num)
slot

◆ setLayoutNumberOfCompareViewRows

void qMRMLLayoutManager::setLayoutNumberOfCompareViewRows ( int num)
slot

Change the number of viewers in comparison modes It creates views if needed.

◆ setMRMLColorLogic()

Q_INVOKABLE void qMRMLLayoutManager::setMRMLColorLogic ( vtkMRMLColorLogic * colorLogic)

◆ setMRMLScene

void qMRMLLayoutManager::setMRMLScene ( vtkMRMLScene * scene)
slot

Set the MRML scene that should be listened for events

See also
mrmlScene(), enabled

◆ setRenderPaused

void qMRMLLayoutManager::setRenderPaused ( bool pause)
slot

Calls setPauseRender(pause) on all slice and 3D views Tracks the previous pause state which is restored using resumeRender() Each pauseRender(true) should always be accompanied by a corresponding pauseRender(false) call

See also
pauseRender

◆ sliceViewNames()

Q_INVOKABLE QStringList qMRMLLayoutManager::sliceViewNames ( ) const

Get the list of SliceWidgetNames All slice widget names are returned, even those from hidden and not currently used widgets.

◆ sliceWidget()

Q_INVOKABLE qMRMLSliceWidget * qMRMLLayoutManager::sliceWidget ( const QString & name) const

Get slice view widget identified by name.

◆ tableViewCount()

int qMRMLLayoutManager::tableViewCount ( ) const

Return the number of plot views.

◆ tableWidget()

Q_INVOKABLE qMRMLTableWidget * qMRMLLayoutManager::tableWidget ( int id) const

◆ threeDViewCount()

int qMRMLLayoutManager::threeDViewCount ( ) const

Return the number of instantiated ThreeDRenderView.

◆ threeDWidget() [1/2]

Q_INVOKABLE qMRMLThreeDWidget * qMRMLLayoutManager::threeDWidget ( const QString & name) const

Get 3D widget identified by name.

◆ threeDWidget() [2/2]

Q_INVOKABLE qMRMLThreeDWidget * qMRMLLayoutManager::threeDWidget ( int id) const

Get ThreeDWidget identified by id where id is an integer ranging from 0 to N-1 with N being the number of instantiated qMRMLThreeDView (that should also be equal to the number of vtkMRMLViewNode)

◆ viewCount()

int qMRMLLayoutManager::viewCount ( ) const

Return the total number of views.

◆ viewWidget()

Q_INVOKABLE QWidget * qMRMLLayoutManager::viewWidget ( vtkMRMLNode * n) const

Get the view widget representing a particular node (can be used for SliceNodes or ViewNodes, returning qMRMLSliceWidget or qMRMLThreeDWidget respectively).

◆ viewWidgets()

Q_INVOKABLE QList< QWidget * > qMRMLLayoutManager::viewWidgets ( ) const

Get a list of all QWidgets for all views in the layout manager.

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLLayoutManagerPrivate> qMRMLLayoutManager::d_ptr
protected

Definition at line 280 of file qMRMLLayoutManager.h.


The documentation for this class was generated from the following file: