Commit 6292e574 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge commit 'de48ee7e'

parents 8704b964 de48ee7e
...@@ -9,25 +9,25 @@ ...@@ -9,25 +9,25 @@
namespace polymesh namespace polymesh
{ {
template <class FuncT, class... Args> template <class FuncT, class... Args>
auto fbind(FuncT&& f, Args... args) auto fbind(FuncT&& f, Args... args) -> decltype(f(std::declval<face_handle>(), std::forward<Args>(args)...))
{ {
return [&](face_handle h) { return f(h, std::forward<Args>(args)...); }; return [&](face_handle h) { return f(h, std::forward<Args>(args)...); };
} }
template <class FuncT, class... Args> template <class FuncT, class... Args>
auto vbind(FuncT&& f, Args... args) auto vbind(FuncT&& f, Args... args) -> decltype(f(std::declval<vertex_handle>(), std::forward<Args>(args)...))
{ {
return [&](vertex_handle h) { return f(h, std::forward<Args>(args)...); }; return [&](vertex_handle h) { return f(h, std::forward<Args>(args)...); };
} }
template <class FuncT, class... Args> template <class FuncT, class... Args>
auto ebind(FuncT&& f, Args... args) auto ebind(FuncT&& f, Args... args) -> decltype(f(std::declval<edge_handle>(), std::forward<Args>(args)...))
{ {
return [&](edge_handle h) { return f(h, std::forward<Args>(args)...); }; return [&](edge_handle h) { return f(h, std::forward<Args>(args)...); };
} }
template <class FuncT, class... Args> template <class FuncT, class... Args>
auto hbind(FuncT&& f, Args... args) auto hbind(FuncT&& f, Args... args) -> decltype(f(std::declval<halfedge_handle>(), std::forward<Args>(args)...))
{ {
return [&](halfedge_handle h) { return f(h, std::forward<Args>(args)...); }; return [&](halfedge_handle h) { return f(h, std::forward<Args>(args)...); };
} }
......
...@@ -40,21 +40,21 @@ struct bfs_range ...@@ -40,21 +40,21 @@ struct bfs_range
return queue.empty() ? handle_t() : queue.front().of(mesh); return queue.empty() ? handle_t() : queue.front().of(mesh);
} }
template <class Enabled = typename std::enable_if<std::is_same<handle_t, vertex_handle>::value>::type> template <class handle = handle_t, class Enabled = typename std::enable_if<std::is_same<handle, vertex_handle>::value>::type>
void expand(vertex_handle v) void expand(vertex_handle v)
{ {
for (auto vv : v.adjacent_vertices()) for (auto vv : v.adjacent_vertices())
if (seen.insert(vv)) if (seen.insert(vv))
queue.push(vv); queue.push(vv);
} }
template <class Enabled = typename std::enable_if<std::is_same<handle_t, face_handle>::value>::type> template <class handle = handle_t, class Enabled = typename std::enable_if<std::is_same<handle, face_handle>::value>::type>
void expand(face_handle f) void expand(face_handle f)
{ {
for (auto ff : f.adjacent_faces()) for (auto ff : f.adjacent_faces())
if (ff.is_valid() && seen.insert(ff)) if (ff.is_valid() && seen.insert(ff))
queue.push(ff); queue.push(ff);
} }
template <class Enabled = typename std::enable_if<std::is_same<handle_t, edge_handle>::value>::type> template <class handle = handle_t, class Enabled = typename std::enable_if<std::is_same<handle, edge_handle>::value>::type>
void expand(edge_handle e) void expand(edge_handle e)
{ {
for (auto ee : e.vertexA().edges()) for (auto ee : e.vertexA().edges())
...@@ -65,7 +65,7 @@ struct bfs_range ...@@ -65,7 +65,7 @@ struct bfs_range
if (seen.insert(ee)) if (seen.insert(ee))
queue.push(ee); queue.push(ee);
} }
template <class Enabled = typename std::enable_if<std::is_same<handle_t, halfedge_handle>::value>::type> template <class handle = handle_t, class Enabled = typename std::enable_if<std::is_same<handle, halfedge_handle>::value>::type>
void expand(halfedge_handle h) void expand(halfedge_handle h)
{ {
for (auto hh : h.vertex_to().outgoing_halfedges()) for (auto hh : h.vertex_to().outgoing_halfedges())
......
Supports Markdown
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