alpha_complex_3d_helper.h
1 /* This file is part of the Gudhi Library. The Gudhi library
2  * (Geometric Understanding in Higher Dimensions) is a generic C++
3  * library for computational topology.
4  *
5  * Author(s): Vincent Rouvreau
6  *
7  * Copyright (C) 2014 Inria
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef ALPHA_COMPLEX_3D_HELPER_H_
24 #define ALPHA_COMPLEX_3D_HELPER_H_
25 
26 template <class Vertex_list, class Cell_handle>
27 Vertex_list from_cell(const Cell_handle& ch) {
28  Vertex_list the_list;
29  for (auto i = 0; i < 4; i++) {
30 #ifdef DEBUG_TRACES
31  std::cout << "from cell[" << i << "]=" << ch->vertex(i)->point() << std::endl;
32 #endif // DEBUG_TRACES
33  the_list.push_back(ch->vertex(i));
34  }
35  return the_list;
36 }
37 
38 template <class Vertex_list, class Facet>
39 Vertex_list from_facet(const Facet& fct) {
40  Vertex_list the_list;
41  for (auto i = 0; i < 4; i++) {
42  if (fct.second != i) {
43 #ifdef DEBUG_TRACES
44  std::cout << "from facet=[" << i << "]" << fct.first->vertex(i)->point() << std::endl;
45 #endif // DEBUG_TRACES
46  the_list.push_back(fct.first->vertex(i));
47  }
48  }
49  return the_list;
50 }
51 
52 template <class Vertex_list, class Edge_3>
53 Vertex_list from_edge(const Edge_3& edg) {
54  Vertex_list the_list;
55  for (auto i : {edg.second, edg.third}) {
56 #ifdef DEBUG_TRACES
57  std::cout << "from edge[" << i << "]=" << edg.first->vertex(i)->point() << std::endl;
58 #endif // DEBUG_TRACES
59  the_list.push_back(edg.first->vertex(i));
60  }
61  return the_list;
62 }
63 
64 template <class Vertex_list, class Vertex_handle>
65 Vertex_list from_vertex(const Vertex_handle& vh) {
66  Vertex_list the_list;
67 #ifdef DEBUG_TRACES
68  std::cout << "from vertex=" << vh->point() << std::endl;
69 #endif // DEBUG_TRACES
70  the_list.push_back(vh);
71  return the_list;
72 }
73 
74 #endif // ALPHA_COMPLEX_3D_HELPER_H_
GUDHI  Version 2.2.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : GPL v3 Generated on Tue Aug 21 2018 01:41:05 for GUDHI by Doxygen 1.8.13