Commit fb5a1bc7 authored by Philip Trettner's avatar Philip Trettner
Browse files

add a comment for views

parent 2ee20575
......@@ -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
{
......
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