22 #ifndef SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_
23 #define SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_
33 template<
typename SimplexHandle>
34 std::list<SimplexHandle> subfaces(SimplexHandle top_face) {
35 std::list<SimplexHandle> res;
36 if (top_face.dimension() == -1)
return res;
37 if (top_face.dimension() == 0) {
38 res.push_back(top_face);
41 auto first_vertex = top_face.first_vertex();
42 top_face.remove_vertex(first_vertex);
43 res = subfaces(top_face);
44 std::list<SimplexHandle> copy = res;
45 for (
auto& simplex : copy) {
46 simplex.add_vertex(first_vertex);
48 res.push_back(SimplexHandle(first_vertex));
49 res.splice(res.end(), copy);
57 template<
typename SimplexHandle>
58 void register_faces(std::vector< std::set<SimplexHandle> >& simplices_per_dimension,
59 const SimplexHandle& top_face) {
60 std::list<SimplexHandle> subfaces_list = subfaces(top_face);
61 for (
auto& simplex : subfaces_list) {
62 simplices_per_dimension[simplex.dimension()].insert(simplex);
70 #endif // SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_