int Geometry<3>::faceNeighbourhood(const vertex_t *v, int m_id, int depth, T result) const { tagable::tag_begin(); int r = 0; const std::vector<const face_t *> &vertex_faces = connectivity.vertex_to_face[vertexToIndex_fast(v)]; for (size_t i = 0; i < vertex_faces.size(); ++i) { face_t *f = vertex_faces[i]; if (f && f->manifold_id == m_id) { r += _faceNeighbourhood(f, depth, &result); } } return r; }
int Geometry<3>::faceNeighbourhood(const edge_t *e, int m_id, int depth, T result) const { tagable::tag_begin(); int r = 0; const std::vector<const face_t *> &edge_faces = connectivity.edge_to_face[(size_t)edgeToIndex_fast(e)]; for (size_t i = 0; i < edge_faces.size(); ++i) { const face_t *f = edge_faces[i]; if (f && f->manifold_id == m_id) { r += _faceNeighbourhood(f, depth, &result); } } return r; }
int Geometry<3>::_faceNeighbourhood(const face_t *f, int depth, T *result) const { if (depth < 0 || f->is_tagged()) return 0; f->tag(); *(*result)++ = f; int r = 1; for (size_t i = 0; i < f->nEdges(); ++i) { const face_t *f2 = connectedFace(f, f->edge(i)); if (f2) { r += _faceNeighbourhood(f2, depth - 1, (*result)); } } return r; }
int Geometry<3>::_faceNeighbourhood(const face_t *f, int depth, T *result) const { if (depth < 0 || f->is_tagged()) return 0; f->tag(); *(*result)++ = f; int r = 1; for (size_t i = 0; i < f->edges.size(); ++i) { const std::vector<const face_t *> &edge_faces = connectivity.edge_to_face[edgeToIndex_fast(f->edges[i])]; const face_t *f2 = connectedFace(f, f->edges[i]); if (f2) { r += _faceNeighbourhood(f2, depth - 1, (*result)); } } return r; }
int Geometry<3>::faceNeighbourhood(const face_t *f, int depth, T result) const { tagable::tag_begin(); return _faceNeighbourhood(f, depth, &result); }