17 template <
typename DATATYPE>
18 bool VectorProperty<DATATYPE>::IsEqual(
const BaseProperty &property)
const 20 return this->m_PropertyContent ==
static_cast<const Self &
>(property).m_PropertyContent;
23 template <
typename DATATYPE>
24 bool VectorProperty<DATATYPE>::Assign(
const BaseProperty &property)
26 this->m_PropertyContent =
static_cast<const Self &
>(property).m_PropertyContent;
30 template <
typename DATATYPE>
31 itk::LightObject::Pointer VectorProperty<DATATYPE>::InternalClone()
const 33 itk::LightObject::Pointer result(
new Self(*
this));
37 template <
typename DATATYPE>
40 const size_t displayBlockLength = 3;
41 size_t beginningElementsCount = displayBlockLength;
42 size_t endElementsCount = displayBlockLength;
44 if (m_PropertyContent.size() <= 2 * displayBlockLength)
46 beginningElementsCount = m_PropertyContent.size();
55 std::stringstream string_collector;
56 for (
size_t i = 0; i < beginningElementsCount; i++)
57 string_collector << m_PropertyContent[i] <<
"\n";
59 string_collector <<
"[... " << m_PropertyContent.size() - 2 * displayBlockLength <<
" more]\n";
60 for (
size_t i = m_PropertyContent.size() - endElementsCount; i < m_PropertyContent.size(); ++i)
61 string_collector << m_PropertyContent[i] <<
"\n";
63 std::string return_value = string_collector.str();
66 if (!return_value.empty())
67 return_value.erase(return_value.size() - 1);
72 template <
typename DATATYPE>
75 m_PropertyContent = newValue;
78 template <
typename DATATYPE>
81 return m_PropertyContent;
virtual void SetValue(const VectorType ¶meter_vector)
sets the content vector
DataCollection - Class to facilitate loading/accessing structured data.
std::string GetValueAsString() const override
virtual const VectorType & GetValue() const
returns a const reference to the contained vector
#define MITK_DEFINE_VECTOR_PROPERTY(TYPE)
This should be used in a .cpp file.
std::vector< DATATYPE > VectorType