From 9899ae167f281d10b1684dfcd02c6838c5bf28df Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Fri, 2 Feb 2018 13:51:45 +0100 Subject: GUDHI 2.1.0 as released by upstream in a tarball. --- utilities/Alpha_complex/alpha_complex_3d_helper.h | 74 +++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 utilities/Alpha_complex/alpha_complex_3d_helper.h (limited to 'utilities/Alpha_complex/alpha_complex_3d_helper.h') diff --git a/utilities/Alpha_complex/alpha_complex_3d_helper.h b/utilities/Alpha_complex/alpha_complex_3d_helper.h new file mode 100644 index 00000000..a59f0654 --- /dev/null +++ b/utilities/Alpha_complex/alpha_complex_3d_helper.h @@ -0,0 +1,74 @@ +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. + * + * Author(s): Vincent Rouvreau + * + * Copyright (C) 2014 INRIA Saclay (France) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ALPHA_COMPLEX_3D_HELPER_H_ +#define ALPHA_COMPLEX_3D_HELPER_H_ + +template +Vertex_list from_cell(const Cell_handle& ch) { + Vertex_list the_list; + for (auto i = 0; i < 4; i++) { +#ifdef DEBUG_TRACES + std::cout << "from cell[" << i << "]=" << ch->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(ch->vertex(i)); + } + return the_list; +} + +template +Vertex_list from_facet(const Facet& fct) { + Vertex_list the_list; + for (auto i = 0; i < 4; i++) { + if (fct.second != i) { +#ifdef DEBUG_TRACES + std::cout << "from facet=[" << i << "]" << fct.first->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(fct.first->vertex(i)); + } + } + return the_list; +} + +template +Vertex_list from_edge(const Edge_3& edg) { + Vertex_list the_list; + for (auto i : {edg.second, edg.third}) { +#ifdef DEBUG_TRACES + std::cout << "from edge[" << i << "]=" << edg.first->vertex(i)->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(edg.first->vertex(i)); + } + return the_list; +} + +template +Vertex_list from_vertex(const Vertex_handle& vh) { + Vertex_list the_list; +#ifdef DEBUG_TRACES + std::cout << "from vertex=" << vh->point() << std::endl; +#endif // DEBUG_TRACES + the_list.push_back(vh); + return the_list; +} + +#endif // ALPHA_COMPLEX_3D_HELPER_H_ -- cgit v1.2.3