29 :
PropertyEditor(boolProp), m_BoolProperty(boolProp), m_ComboBox(combo)
34 virtual ~_UGCombinedBoolPropEditor() {}
35 bool IsEnabled()
const {
return enabled; }
36 void SetEnabled(
bool enable)
39 m_BoolProperty->SetValue(enable);
47 enabled = m_BoolProperty->GetValue();
51 m_ComboBox->IsVolumeChanged(enabled);
57 m_BoolProperty =
nullptr;
72 :
PropertyEditor(property), m_EnumerationProperty(property), m_ComboBox(combo), m_IsVolumeProp(isVolumeProp)
76 ~_UGCombinedEnumPropEditor() { m_EnumerationProperty =
nullptr; }
77 void IndexChanged(
int enumId)
80 m_EnumerationProperty->SetValue(enumId);
86 if (m_EnumerationProperty)
90 m_ComboBox->SetGridVolumeId(m_EnumerationProperty->GetValueAsId());
94 m_ComboBox->SetGridRepresentationId(m_EnumerationProperty->GetValueAsId());
102 m_EnumerationProperty =
nullptr;
108 QHash<int, int> m_EnumIdToItemIndex;
114 gridRepPropEditor(nullptr),
115 volumeMapperPropEditor(nullptr),
116 volumePropEditor(nullptr),
119 m_FirstVolumeRepId(0)
121 connect(
this, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
OnIndexChanged(
int)));
154 this->setEnabled(
true);
159 if (!gridRepProp && !gridVolProp)
167 for (
auto it = repStrings.begin(); it != repStrings.end(); ++it, ++i)
170 this->addItem(QString::fromStdString(it->first), it->second);
178 for (
auto it = volStrings.begin(); it != volStrings.end(); ++it, ++i)
181 this->addItem(QString(
"Volume (") + QString::fromStdString(it->first) +
")", it->second);
210 int enumIndex = this->itemData(index, Qt::UserRole).toInt();
virtual void PropertyRemoved()=0
const EnumStringsContainerType & GetEnumStrings() const
mitk::BaseProperty * m_Property
PropertyEditor(mitk::BaseProperty *)
virtual void PropertyChanged()=0
void BeginModifyProperty()
std::map< std::string, IdType > EnumStringsContainerType
virtual IdType GetValueAsId() const