Slicer  5.3
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 Slots | Protected Attributes
qMRMLCoordinatesWidget Class Reference

Extend the ctkCoordinatesWidget to integrate units support. More...

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

Inheritance diagram for qMRMLCoordinatesWidget:
Inheritance graph
Collaboration diagram for qMRMLCoordinatesWidget:
Collaboration graph

Public Types

typedef ctkCoordinatesWidget Superclass
enum  UnitAwareProperty {
  None = 0x00, Prefix = 0x01, Suffix = 0x02, Precision = 0x04,
  MinimumValue = 0x08, MaximumValue = 0x10, Scaling = 0x20, All = Prefix | Suffix | Precision | MinimumValue | MaximumValue | Scaling


QString quantity
UnitAwareProperties unitAwareProperties

Public Slots

virtual void setMRMLScene (vtkMRMLScene *scene)
void setQuantity (const QString &baseName)
void setUnitAwareProperties (UnitAwareProperties flags)


void mrmlSceneChanged (vtkMRMLScene *)
void quantityChanged (const QString &)

Public Member Functions

Q_INVOKABLE vtkMRMLScenemrmlScene () const
 qMRMLCoordinatesWidget (QWidget *parent=nullptr)
 Construct an empty qMRMLSliderWidget with a null scene. More...
QString quantity () const
UnitAwareProperties unitAwareProperties () const
 ~qMRMLCoordinatesWidget () override

Protected Slots

void updateWidgetFromUnitNode ()

Protected Attributes

QScopedPointer< qMRMLCoordinatesWidgetPrivate > d_ptr

Detailed Description

Extend the ctkCoordinatesWidget to integrate units support.

To allow even more customisation, one can set which properties of the widget are updated by units and which aren't.

See also
qMRMLSliderWidget, qMRMLSpinBox

This custom widgets extends the ctkCoordinates widget to integrate the unit support within Slicer. By default, this widget behaves just like a normal ctkCoordinatesWidget.

To use the units, one needs to set what kind of quantity this widget should look for. For example, when dealing with world positions, the quantity is probably going to be "length". Once a scene is set to this widget, it listens to the changes made upon the selection node to extract the unit properties related to its quantity and update accordingly.

Definition at line 58 of file qMRMLCoordinatesWidget.h.

Member Typedef Documentation

◆ Superclass

typedef ctkCoordinatesWidget qMRMLCoordinatesWidget::Superclass

Definition at line 79 of file qMRMLCoordinatesWidget.h.

Member Enumeration Documentation

◆ UnitAwareProperty


Definition at line 85 of file qMRMLCoordinatesWidget.h.

Property Documentation

◆ quantity

QString qMRMLCoordinatesWidget::quantity

Get/Set the quantity is used to determine what unit the spinboxes are in. This determines the spinboxes properties like minimum, maximum, single step, prefix and suffix.

Definition at line 67 of file qMRMLCoordinatesWidget.h.

◆ unitAwareProperties

UnitAwareProperties qMRMLCoordinatesWidget::unitAwareProperties

Get/Set the properties that will be determined by units. If a property is aware of units, it will update itself to the unit's property value automatically. Otherwise, this property is left to be changed by its accessors. All flags are on by default.

See also
setQuantity(), quantity()

Definition at line 76 of file qMRMLCoordinatesWidget.h.

Constructor & Destructor Documentation

◆ qMRMLCoordinatesWidget()

qMRMLCoordinatesWidget::qMRMLCoordinatesWidget ( QWidget *  parent = nullptr)

Construct an empty qMRMLSliderWidget with a null scene.

◆ ~qMRMLCoordinatesWidget()

qMRMLCoordinatesWidget::~qMRMLCoordinatesWidget ( )

Member Function Documentation

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qMRMLCoordinatesWidget::mrmlScene ( ) const

Get MRML scene that has been set by setMRMLScene(). Default is no scene.

See also

◆ mrmlSceneChanged

void qMRMLCoordinatesWidget::mrmlSceneChanged ( vtkMRMLScene )

◆ quantity()

QString qMRMLCoordinatesWidget::quantity ( ) const

◆ quantityChanged

void qMRMLCoordinatesWidget::quantityChanged ( const QString &  )

◆ setMRMLScene

virtual void qMRMLCoordinatesWidget::setMRMLScene ( vtkMRMLScene scene)

Set the scene the spinboxes listens to.

See also

◆ setQuantity

void qMRMLCoordinatesWidget::setQuantity ( const QString &  baseName)

◆ setUnitAwareProperties

void qMRMLCoordinatesWidget::setUnitAwareProperties ( UnitAwareProperties  flags)

◆ unitAwareProperties()

UnitAwareProperties qMRMLCoordinatesWidget::unitAwareProperties ( ) const

◆ updateWidgetFromUnitNode

void qMRMLCoordinatesWidget::updateWidgetFromUnitNode ( )

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLCoordinatesWidgetPrivate> qMRMLCoordinatesWidget::d_ptr

Definition at line 123 of file qMRMLCoordinatesWidget.h.

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