Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
polymesh
Commits
483f4652
Commit
483f4652
authored
Jul 17, 2018
by
Philip Trettner
Browse files
added to_vector
parent
38b326c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/polymesh/attributes.hh
View file @
483f4652
...
...
@@ -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
;
...
...
src/polymesh/impl/impl_attributes.hh
View file @
483f4652
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment