25 class EqualDoseFunctor
30 EqualDoseFunctor(
const DoseValueType& refValue) : m_refValue(refValue)
33 bool operator () (
const IsoDoseLevel* level)
35 return level->GetDoseValue() == m_refValue;
39 DoseValueType m_refValue;
53 this->m_IsoLevels = other.m_IsoLevels;
59 if (index < this->m_IsoLevels.size())
61 return *(this->m_IsoLevels[index].GetPointer());
65 mitkThrow() <<
"Try to access non existing dose iso level.";
71 auto pos = std::find_if(this->m_IsoLevels.begin(), this->m_IsoLevels.end(), EqualDoseFunctor(value));
73 if (pos != this->m_IsoLevels.end())
75 return *(pos->GetPointer());
79 mitkThrow() <<
"Try to access non existing dose iso level.";
87 mitkThrow() <<
"Cannot set iso level. Passed null pointer.";
92 this->m_IsoLevels.push_back(level->Clone());
99 return index < this->m_IsoLevels.size();
105 auto pos = std::find_if(this->m_IsoLevels.begin(), this->m_IsoLevels.end(), EqualDoseFunctor(value));
106 return pos != this->m_IsoLevels.end();
111 auto pos = std::find_if(this->m_IsoLevels.begin(), this->m_IsoLevels.end(), EqualDoseFunctor(value));
113 if (pos != this->m_IsoLevels.end())
115 this->m_IsoLevels.erase(pos);
121 if (DoseLevelExists(index))
123 this->m_IsoLevels.erase(this->m_IsoLevels.begin()+index);
139 return this->m_IsoLevels.size();
144 this->m_IsoLevels.clear();
Stores values needed for the representation/visualization of dose iso levels.
ConstIterator Begin(void) const
virtual DoseValueType GetDoseValue() const
void SetIsoDoseLevel(const IsoDoseLevel *)
size_type IsoLevelIndexType
bool lesserIsoDoseLevel(const IsoDoseLevel *first, const IsoDoseLevel *second)
ConstIterator End(void) const
DataCollection - Class to facilitate loading/accessing structured data.
bool DoseLevelExists(IsoLevelIndexType) const
Stores values needed for the representation/visualization of dose iso levels.
void DeleteIsoDoseLevel(DoseValueType)
IsoLevelIndexType Size(void) const
IsoDoseLevel::DoseValueType DoseValueType
DoseValueRel DoseValueType
const IsoDoseLevel & GetIsoDoseLevel(IsoLevelIndexType) const