21 #ifndef __qMRMLUnitWidget_h 22 #define __qMRMLUnitWidget_h 25 #include <ctkVTKObject.h> 38 #include "qSlicerUnitsModuleWidgetsExport.h" 39 class qMRMLUnitWidgetPrivate;
48 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
51 Q_PROPERTY(QString quantity READ quantity WRITE setQuantity NOTIFY quantityChanged)
54 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix NOTIFY prefixChanged)
57 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix NOTIFY suffixChanged)
60 Q_PROPERTY(
int precision READ precision WRITE setPrecision NOTIFY precisionChanged)
63 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum NOTIFY minimumChanged)
66 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum NOTIFY maximumChanged)
69 Q_PROPERTY(
double coefficient READ coefficient WRITE setCoefficient NOTIFY coefficientChanged)
72 Q_PROPERTY(
double offset READ offset WRITE setOffset NOTIFY offsetChanged)
78 Q_PROPERTY(UnitProperties displayedProperties READ displayedProperties WRITE setDisplayedProperties)
82 Q_PROPERTY(UnitProperties editableProperties READ editableProperties WRITE setEditableProperties)
96 QString quantity() const;
99 QString prefix() const;
102 QString suffix() const;
105 int precision() const;
108 double minimum() const;
111 double maximum() const;
114 double coefficient() const;
117 double offset() const;
134 Q_DECLARE_FLAGS(UnitProperties, UnitProperty)
137 UnitProperties displayedProperties()
const;
141 UnitProperties editableProperties()
const;
153 void setName(
const QString &);
156 void setQuantity(
const QString &);
159 void setPrefix(
const QString &);
162 void setSuffix(
const QString &);
165 void setPrecision(
int);
168 void setMinimum(
double);
171 void setMaximum(
double);
174 void setCoefficient(
double);
177 void setOffset(
double);
184 void setDisplayedProperties(UnitProperties properties);
187 void setEditableProperties(UnitProperties properties);
190 void updateWidgetFromNode();
193 void nameChanged(QString);
194 void quantityChanged(QString);
195 void prefixChanged(QString);
196 void suffixChanged(QString);
197 void precisionChanged(
int);
198 void minimumChanged(
double);
199 void maximumChanged(
double);
200 void coefficientChanged(
double);
201 void offsetChanged(
double);
204 QScopedPointer<qMRMLUnitWidgetPrivate>
d_ptr;
211 Q_DECLARE_OPERATORS_FOR_FLAGS(qMRMLUnitWidget::UnitProperties)
A set of MRML Nodes that supports serialization and undo/redo.
Combobox that automatically displays all the nodes of the scene that match filtering criteria...
Slicer logic for unit manipulation.
Abstract Superclass for all specific types of MRML nodes.