Skip to content
Snippets Groups Projects
Commit fb5a1bc7 authored by Philip Trettner's avatar Philip Trettner
Browse files

add a comment for views

parent 2ee20575
Branches
No related tags found
No related merge requests found
......@@ -5,6 +5,19 @@
namespace polymesh
{
/**
* Builds a non-owning view on an attribute
* Does preserve references where possible
*
* Usage:
*
* pm::Mesh m;
* auto pos = m.vertices().make_attribute<tg::pos3>();
*
* // does NOT allocate memory, is only a view on pos
* auto z_view = pos.view([](tg::pos3& p) -> float& { return p.z; });
* z_view[v] = 8; // writes through to pos
*/
template <class CollectionT, class FuncT>
struct attribute_view
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment