Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
qMRMLLayoutManager Class Reference

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

Inheritance diagram for qMRMLLayoutManager:
Inheritance graph
Collaboration diagram for qMRMLLayoutManager:
Collaboration graph

Public Types

typedef ctkLayoutFactory Superclass
 Superclass typedef. More...


bool enabled
int layout
int plotViewCount
int tableViewCount
int threeDViewCount

Public Slots

void pauseRender ()
void resetSliceViews ()
void resetThreeDViews ()
void resumeRender ()
void setEnabled (bool enable)
void setLayout (int newLayout)
void setLayoutNumberOfCompareViewColumns (int num)
void setLayoutNumberOfCompareViewRows (int num)
void setMaximizedViewNode (vtkMRMLAbstractViewNode *viewNode)
void setMRMLScene (vtkMRMLScene *scene)
void setRenderPaused (bool pause)


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. More...

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
bool isEnabled () const
int layout () const
Q_INVOKABLE vtkMRMLLayoutLogiclayoutLogic () const
Q_INVOKABLE vtkMRMLAbstractViewNodemaximizedViewNode ()
 Return the view node that is temporarily shown maximized in the view layout. More...
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
Q_INVOKABLE qMRMLPlotWidgetplotWidget (int id) const
 qMRMLLayoutManager (QObject *parent=nullptr)
 Constructors. More...
 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. More...
int tableViewCount () const
Q_INVOKABLE qMRMLTableWidgettableWidget (int id) const
int threeDViewCount () const
 Return the number of instantiated ThreeDRenderView. More...
Q_INVOKABLE qMRMLThreeDWidgetthreeDWidget (const QString &name) const
 Get 3D widget identified by name. More...
Q_INVOKABLE qMRMLThreeDWidgetthreeDWidget (int id) const
Q_INVOKABLE QWidget * viewWidget (vtkMRMLNode *n) const
 ~qMRMLLayoutManager () override

Protected Member Functions

void onViewportChanged () 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 =
MySliceViewFactory* mySliceViewFactory =
new MySliceViewFactory(app->layoutManager());

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

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

Definition at line 85 of file qMRMLLayoutManager.h.

◆ plotViewCount

int qMRMLLayoutManager::plotViewCount

Definition at line 88 of file qMRMLLayoutManager.h.

◆ tableViewCount

int qMRMLLayoutManager::tableViewCount

Definition at line 87 of file qMRMLLayoutManager.h.

◆ threeDViewCount

int qMRMLLayoutManager::threeDViewCount

Definition at line 86 of file qMRMLLayoutManager.h.

Constructor & Destructor Documentation

◆ qMRMLLayoutManager() [1/3]

qMRMLLayoutManager::qMRMLLayoutManager ( QObject *  parent = nullptr)


◆ qMRMLLayoutManager() [2/3]

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

◆ ~qMRMLLayoutManager()

qMRMLLayoutManager::~qMRMLLayoutManager ( )

◆ qMRMLLayoutManager() [3/3]

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

Member Function Documentation

◆ activeMRMLPlotViewNode()

Q_INVOKABLE vtkMRMLPlotViewNode* qMRMLLayoutManager::activeMRMLPlotViewNode ( ) const

Return the view node of the active plot view.

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

◆ activeMRMLPlotViewNodeChanged

void qMRMLLayoutManager::activeMRMLPlotViewNodeChanged ( vtkMRMLPlotViewNode newActiveMRMLPlotViewNode)

◆ activeMRMLTableViewNode()

Q_INVOKABLE vtkMRMLTableViewNode* qMRMLLayoutManager::activeMRMLTableViewNode ( ) const

Return the view node of the active table view.

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

◆ activeMRMLTableViewNodeChanged

void qMRMLLayoutManager::activeMRMLTableViewNodeChanged ( vtkMRMLTableViewNode newActiveMRMLTableViewNode)

◆ activeMRMLThreeDViewNode()

Q_INVOKABLE vtkMRMLViewNode* qMRMLLayoutManager::activeMRMLThreeDViewNode ( ) const

Return the view node of the active 3D view.

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

◆ activeMRMLThreeDViewNodeChanged

void qMRMLLayoutManager::activeMRMLThreeDViewNodeChanged ( vtkMRMLViewNode newActiveMRMLThreeDViewNode)

◆ activePlotRenderer()

Q_INVOKABLE vtkRenderer* qMRMLLayoutManager::activePlotRenderer ( ) const

Return the renderer of the active plot view.

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

◆ activePlotRendererChanged

void qMRMLLayoutManager::activePlotRendererChanged ( vtkRenderer *  newRenderer)

◆ activeTableRenderer()

Q_INVOKABLE vtkRenderer* qMRMLLayoutManager::activeTableRenderer ( ) const

Return the renderer of the active table view.

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

◆ activeTableRendererChanged

void qMRMLLayoutManager::activeTableRendererChanged ( vtkRenderer *  newRenderer)

◆ activeThreeDRenderer()

Q_INVOKABLE vtkRenderer* qMRMLLayoutManager::activeThreeDRenderer ( ) const

Return the renderer of the active 3D view.

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

◆ activeThreeDRendererChanged

void qMRMLLayoutManager::activeThreeDRendererChanged ( vtkRenderer *  newRenderer)

◆ isEnabled()

bool qMRMLLayoutManager::isEnabled ( ) const

Return the enabled property value.

See also

◆ 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  )

◆ layoutLogic()

Q_INVOKABLE vtkMRMLLayoutLogic* qMRMLLayoutManager::layoutLogic ( ) const

Return the layout logic instantiated and used by the manager.

See also
setLayout(), layout()

◆ maximizedViewNode()

Q_INVOKABLE vtkMRMLAbstractViewNode* qMRMLLayoutManager::maximizedViewNode ( )

Return the view node that is temporarily shown maximized in the view 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 emitted when editing of a node is requested from within the layout.

◆ onViewportChanged()

void qMRMLLayoutManager::onViewportChanged ( )

◆ pauseRender

void qMRMLLayoutManager::pauseRender ( )

Equivalent to setRenderPaused(true)

See also

◆ plotViewCount()

int qMRMLLayoutManager::plotViewCount ( ) const

◆ plotWidget()

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

◆ registerViewFactory()

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

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

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

◆ resetSliceViews

void qMRMLLayoutManager::resetSliceViews ( )

◆ resetThreeDViews

void qMRMLLayoutManager::resetThreeDViews ( )

Reset focal view around volumes

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

◆ resumeRender

void qMRMLLayoutManager::resumeRender ( )

Equivalent to setRenderPaused(false)

See also

◆ setEnabled

void qMRMLLayoutManager::setEnabled ( bool  enable)

Set the enabled property value

See also

◆ setLayout

void qMRMLLayoutManager::setLayout ( int  newLayout)

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

◆ setLayoutNumberOfCompareViewColumns

void qMRMLLayoutManager::setLayoutNumberOfCompareViewColumns ( int  num)

◆ setLayoutNumberOfCompareViewRows

void qMRMLLayoutManager::setLayoutNumberOfCompareViewRows ( int  num)

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

◆ setMaximizedViewNode

void qMRMLLayoutManager::setMaximizedViewNode ( vtkMRMLAbstractViewNode viewNode)

Makes a view displayed maximized (taking the entire area) of the view layout. Setting the value to nullptr restores the original view layout.

◆ setMRMLColorLogic()

Q_INVOKABLE void qMRMLLayoutManager::setMRMLColorLogic ( vtkMRMLColorLogic colorLogic)

◆ setMRMLScene

void qMRMLLayoutManager::setMRMLScene ( vtkMRMLScene scene)

Set the MRML scene that should be listened for events

See also
mrmlScene(), enabled

◆ setRenderPaused

void qMRMLLayoutManager::setRenderPaused ( bool  pause)

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

◆ 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

◆ 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)

◆ 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).

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLLayoutManagerPrivate> qMRMLLayoutManager::d_ptr

Definition at line 265 of file qMRMLLayoutManager.h.

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