Skip to content
GitLab
Menu
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
232e4774
Commit
232e4774
authored
Aug 03, 2018
by
Philip Trettner
Browse files
added mesh copy to
parent
dbbc28a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/polymesh/attributes.hh
View file @
232e4774
...
@@ -91,6 +91,10 @@ public:
...
@@ -91,6 +91,10 @@ public:
/// copies as much data as possible from the given attribute
/// copies as much data as possible from the given attribute
void
copy_from
(
attribute
<
AttrT
>
const
&
data
);
void
copy_from
(
attribute
<
AttrT
>
const
&
data
);
/// copies all attribute data to another mesh
/// asserts that sizes are correct
attribute
<
AttrT
>
copy_to
(
Mesh
const
&
m
)
const
;
/// Saves ALL data into a vector (includes possibly removed ones)
/// Saves ALL data into a vector (includes possibly removed ones)
std
::
vector
<
AttrT
>
to_vector
()
const
;
std
::
vector
<
AttrT
>
to_vector
()
const
;
// TODO: specialized implementation of to_vector(FuncT&&)
// TODO: specialized implementation of to_vector(FuncT&&)
...
...
src/polymesh/impl/impl_attributes.hh
View file @
232e4774
...
@@ -78,6 +78,14 @@ void primitive_attribute<tag, AttrT>::copy_from(attribute<AttrT> const &data)
...
@@ -78,6 +78,14 @@ void primitive_attribute<tag, AttrT>::copy_from(attribute<AttrT> const &data)
this
->
mData
[
i
]
=
data
.
mData
[
i
];
this
->
mData
[
i
]
=
data
.
mData
[
i
];
}
}
template
<
class
tag
,
class
AttrT
>
auto
primitive_attribute
<
tag
,
AttrT
>::
copy_to
(
Mesh
const
&
m
)
const
->
attribute
<
AttrT
>
{
attribute
<
AttrT
>
new_attr
(
m
,
this
->
mDefaultValue
);
new_attr
.
copy_from
(
this
->
data
(),
this
->
size
());
return
new_attr
;
}
template
<
class
tag
,
class
AttrT
>
template
<
class
tag
,
class
AttrT
>
std
::
vector
<
AttrT
>
primitive_attribute
<
tag
,
AttrT
>::
to_vector
()
const
std
::
vector
<
AttrT
>
primitive_attribute
<
tag
,
AttrT
>::
to_vector
()
const
{
{
...
@@ -348,9 +356,8 @@ void primitive_attribute<tag, AttrT>::compute(FuncT &&f)
...
@@ -348,9 +356,8 @@ void primitive_attribute<tag, AttrT>::compute(FuncT &&f)
template
<
class
tag
,
class
AttrT
>
template
<
class
tag
,
class
AttrT
>
template
<
class
FuncT
>
template
<
class
FuncT
>
auto
primitive_attribute
<
tag
,
AttrT
>::
view
(
FuncT
&&
f
)
const
->
readonly_property
<
primitive_attribute
<
tag
,
AttrT
>
const
&
,
FuncT
>
auto
primitive_attribute
<
tag
,
AttrT
>::
view
(
FuncT
&&
f
)
const
->
readonly_property
<
primitive_attribute
<
tag
,
AttrT
>
const
&
,
FuncT
>
{
{
return
readonly_property
<
primitive_attribute
<
tag
,
AttrT
>
const
&
,
FuncT
>
(
*
this
,
f
);
return
readonly_property
<
primitive_attribute
<
tag
,
AttrT
>
const
&
,
FuncT
>
(
*
this
,
f
);
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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