21 template <
typename DATATYPE>
22 bool VectorProperty<DATATYPE>::IsEqual(
const BaseProperty &property)
const
24 return this->m_PropertyContent ==
static_cast<const Self &
>(property).m_PropertyContent;
27 template <
typename DATATYPE>
28 bool VectorProperty<DATATYPE>::Assign(
const BaseProperty &property)
30 this->m_PropertyContent =
static_cast<const Self &
>(property).m_PropertyContent;
34 template <
typename DATATYPE>
41 template <
typename DATATYPE>
44 const size_t displayBlockLength = 3;
45 size_t beginningElementsCount = displayBlockLength;
46 size_t endElementsCount = displayBlockLength;
48 if (m_PropertyContent.size() <= 2 * displayBlockLength)
50 beginningElementsCount = m_PropertyContent.size();
59 std::stringstream string_collector;
60 for (
size_t i = 0; i < beginningElementsCount; i++)
61 string_collector << m_PropertyContent[i] <<
"\n";
63 string_collector <<
"[... " << m_PropertyContent.size() - 2 * displayBlockLength <<
" more]\n";
64 for (
size_t i = m_PropertyContent.size() - endElementsCount; i < m_PropertyContent.size(); ++i)
65 string_collector << m_PropertyContent[i] <<
"\n";
67 std::string return_value = string_collector.str();
70 if (!return_value.empty())
71 return_value.erase(return_value.size() - 1);
76 template <
typename DATATYPE>
79 m_PropertyContent = newValue;
82 template <
typename DATATYPE>
85 return m_PropertyContent;
itk::SmartPointer< Self > Pointer
virtual void SetValue(const VectorType ¶meter_vector)
sets the content vector
DataCollection - Class to facilitate loading/accessing structured data.
virtual 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