Commit 43a4968a authored by Philip Trettner's avatar Philip Trettner
Browse files

farthest point

parent d1c71af7
......@@ -4,19 +4,22 @@
#include "../Mesh.hh"
namespace polymesh {
namespace polymesh
{
/// Given a face handle, returns the topologically farthest (but finite) face
/// (i.e. the last face that would be visited in a BFS)
face_handle farthest_face(face_handle f);
/// ======== IMPLEMENTATION ========
/*inline face_handle farthest_face(face_handle f)
inline face_handle farthest_face(face_handle f)
{
std::vector<face_index> q_curr;
std::vector<face_index> q_next;
auto const& m = *f.mesh;
auto visited = m.faces().make_attribute_with_default(false);
q_curr.push_back(f.idx);
face_handle last_f = f;
......@@ -24,14 +27,21 @@ face_handle farthest_face(face_handle f);
while (!q_curr.empty())
{
for (auto f : q_curr)
{
// TODO
}
// visit neighbors
for (auto ff : m[f].adjacent_faces())
if (ff.is_valid())
{
if (visited[ff])
continue;
visited[ff] = true;
last_f = ff;
q_next.push_back(ff);
}
std::swap(q_curr, q_next);
}
return last_f;
}*/
}
}
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