Commit 483f4652 authored by Philip Trettner's avatar Philip Trettner
Browse files

added to_vector

parent 38b326c2
......@@ -71,6 +71,9 @@ public:
/// copies as much data as possible from the given attribute
void copy_from(attribute<AttrT> const& data);
/// Saves ALL data into a vector (includes possibly removed ones)
std::vector<AttrT> to_vector() const;
// data
protected:
attribute_data<AttrT> mData;
......
......@@ -78,6 +78,16 @@ void primitive_attribute<tag, AttrT>::copy_from(attribute<AttrT> const &data)
this->mData[i] = data.mData[i];
}
template <class tag, class AttrT>
std::vector<AttrT> primitive_attribute<tag, AttrT>::to_vector() const
{
auto s = this->size();
std::vector<AttrT> r(s);
for (auto i = 0; i < s; ++i)
r[i] = this->mData[i];
return r;
}
template <class tag, class AttrT>
void primitive_attribute<tag, AttrT>::apply_remapping(const std::vector<int> &map)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment