Commit 12d5a6b4 authored by Alexander Dielen's avatar Alexander Dielen

Added halfface_opposite_vertex() convenience function

parent 9e05d46b
Pipeline #6505 passed with stage
in 4 minutes and 2 seconds
......@@ -577,6 +577,23 @@ std::vector<VertexHandle> TetrahedralMeshTopologyKernel::get_halfface_vertices(H
return vertices;
}
VertexHandle TetrahedralMeshTopologyKernel::halfface_opposite_vertex(HalfFaceHandle hfh) const
{
if (is_boundary(hfh)) {
return InvalidVertexHandle;
}
const std::vector<VertexHandle> base = get_halfface_vertices(hfh);
for (CellVertexIter it = cv_iter(incident_cell(hfh)); it.valid(); ++it) {
const VertexHandle vh = *it;
if (vh != base[0] && vh != base[1] && vh != base[2]) {
return vh;
}
}
return InvalidVertexHandle;
}
//========================================================================================
......
......@@ -95,6 +95,8 @@ public:
std::vector<VertexHandle> get_halfface_vertices(HalfFaceHandle hfh, VertexHandle vh) const;
std::vector<VertexHandle> get_halfface_vertices(HalfFaceHandle hfh, HalfEdgeHandle heh) const;
VertexHandle halfface_opposite_vertex(HalfFaceHandle hfh) const;
VertexHandle collapse_edge(HalfEdgeHandle _heh);
protected:
......
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