25 :
PropertyEditor(boolProp), m_BoolProperty(boolProp), m_ComboBox(combo)
30 ~_UGCombinedBoolPropEditor()
override {}
31 bool IsEnabled()
const {
return enabled; }
32 void SetEnabled(
bool enable)
35 m_BoolProperty->SetValue(enable);
43 enabled = m_BoolProperty->GetValue();
47 m_ComboBox->IsVolumeChanged(enabled);
53 m_BoolProperty =
nullptr;
68 : PropertyEditor(property), m_EnumerationProperty(property), m_ComboBox(combo), m_IsVolumeProp(isVolumeProp)
72 ~_UGCombinedEnumPropEditor()
override { m_EnumerationProperty =
nullptr; }
73 void IndexChanged(
int enumId)
75 this->BeginModifyProperty();
76 m_EnumerationProperty->SetValue(enumId);
77 this->EndModifyProperty();
80 void PropertyChanged()
override 82 if (m_EnumerationProperty)
86 m_ComboBox->SetGridVolumeId(m_EnumerationProperty->GetValueAsId());
90 m_ComboBox->SetGridRepresentationId(m_EnumerationProperty->GetValueAsId());
95 void PropertyRemoved()
override 98 m_EnumerationProperty =
nullptr;
104 QHash<int, int> m_EnumIdToItemIndex;
110 gridRepPropEditor(nullptr),
111 volumeMapperPropEditor(nullptr),
112 volumePropEditor(nullptr),
115 m_FirstVolumeRepId(0)
117 connect(
this, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
OnIndexChanged(
int)));
150 this->setEnabled(
true);
155 if (!gridRepProp && !gridVolProp)
163 for (
auto it = repStrings.begin(); it != repStrings.end(); ++it, ++i)
166 this->addItem(QString::fromStdString(it->first), it->second);
174 for (
auto it = volStrings.begin(); it != volStrings.end(); ++it, ++i)
177 this->addItem(QString(
"Volume (") + QString::fromStdString(it->first) +
")", it->second);
206 int enumIndex = this->itemData(index, Qt::UserRole).toInt();
virtual IdType GetValueAsId() const
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