summaryrefslogtreecommitdiff
path: root/src/Coxeter_triangulation/include/gudhi/IO
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-11-10 15:02:29 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-11-10 15:02:29 +0100
commitb118b86b7f2e7ae9ee7f080ec89d956b161aedfd (patch)
tree94811a60c52f3dddfdca8eb077f74fe0e5a4e181 /src/Coxeter_triangulation/include/gudhi/IO
parenteb8164b76a062fe510a9281bfebfa34f66c72163 (diff)
Modify debug traces for coxeter to use gudhi DEBUG_TRACES mechanism
Diffstat (limited to 'src/Coxeter_triangulation/include/gudhi/IO')
-rw-r--r--src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h17
-rw-r--r--src/Coxeter_triangulation/include/gudhi/IO/output_debug_traces_to_html.h9
2 files changed, 15 insertions, 11 deletions
diff --git a/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h b/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h
index 0dc98f95..c794cfa4 100644
--- a/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h
+++ b/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h
@@ -11,6 +11,7 @@
#ifndef IO_BUILD_MESH_FROM_CELL_COMPLEX_H_
#define IO_BUILD_MESH_FROM_CELL_COMPLEX_H_
+#include <gudhi/IO/output_debug_traces_to_html.h> // for DEBUG_TRACES
#include <gudhi/IO/Mesh_medit.h>
#include <Eigen/Dense>
@@ -58,7 +59,7 @@ void populate_mesh(Mesh_medit& output, Simplex_cell_map& sc_map, Configuration c
for (const std::size_t& v : vertex_indices) barycenter += output.vertex_points[v - 1];
ci_map.emplace(std::make_pair(cell, index++));
output.vertex_points.emplace_back((1. / vertex_indices.size()) * barycenter);
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
std::string vlist = " (" + std::to_string(index - 1) + ")";
for (const std::size_t& v : vertex_indices) vlist += " " + std::to_string(v);
cell_vlist_map.emplace(std::make_pair(to_string(cell), vlist));
@@ -66,12 +67,12 @@ void populate_mesh(Mesh_medit& output, Simplex_cell_map& sc_map, Configuration c
}
if (configuration.toggle_edges && sc_map.size() >= 2)
- for (const auto& sc_map : sc_map[1]) {
- Hasse_cell* edge_cell = sc_map.second;
+ for (const auto& sc_pair : sc_map[1]) {
+ Hasse_cell* edge_cell = sc_pair.second;
Mesh_element_vertices edge;
for (const auto& vi_pair : edge_cell->get_boundary()) edge.push_back(vi_map[vi_pair.first]);
output.edges.emplace_back(std::make_pair(edge, configuration.ref_edges));
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
std::string vlist;
for (const std::size_t& v : edge) vlist += " " + std::to_string(v);
cell_vlist_map.emplace(std::make_pair(to_string(edge_cell), vlist));
@@ -97,7 +98,7 @@ void populate_mesh(Mesh_medit& output, Simplex_cell_map& sc_map, Configuration c
for (const auto& vi_pair : ei_pair.first->get_boundary()) vertex_indices.emplace(vi_map[vi_pair.first]);
for (const std::size_t& v : vertex_indices) barycenter += output.vertex_points[v - 1];
output.vertex_points.emplace_back((1. / vertex_indices.size()) * barycenter);
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
std::string vlist = " (" + std::to_string(index) + ")";
for (const std::size_t& v : vertex_indices) vlist += " " + std::to_string(v);
cell_vlist_map.emplace(std::make_pair(to_string(cell), vlist));
@@ -126,7 +127,7 @@ Mesh_medit build_mesh_from_cell_complex(const Cell_complex& cell_complex,
std::size_t amb_d = std::min((int)cell_complex.cell_point_map().begin()->second.size(), 3);
for (const auto& cp_pair : cell_complex.cell_point_map()) {
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
std::string vlist;
vlist += " " + std::to_string(index);
cell_vlist_map.emplace(std::make_pair(to_string(cp_pair.first), vlist));
@@ -137,7 +138,7 @@ Mesh_medit build_mesh_from_cell_complex(const Cell_complex& cell_complex,
}
populate_mesh(output, cell_complex.interior_simplex_cell_maps(), i_configuration, amb_d, vi_map);
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
for (const auto& sc_map : cell_complex.interior_simplex_cell_maps())
for (const auto& sc_pair : sc_map) {
std::string simplex = "I" + to_string(sc_pair.first);
@@ -147,7 +148,7 @@ Mesh_medit build_mesh_from_cell_complex(const Cell_complex& cell_complex,
}
#endif
populate_mesh(output, cell_complex.boundary_simplex_cell_maps(), b_configuration, amb_d, vi_map);
-#ifdef GUDHI_COX_OUTPUT_TO_HTML
+#ifdef DEBUG_TRACES
for (const auto& sc_map : cell_complex.boundary_simplex_cell_maps())
for (const auto& sc_pair : sc_map) {
std::string simplex = "B" + to_string(sc_pair.first);
diff --git a/src/Coxeter_triangulation/include/gudhi/IO/output_debug_traces_to_html.h b/src/Coxeter_triangulation/include/gudhi/IO/output_debug_traces_to_html.h
index 147ab908..1d5ee4cd 100644
--- a/src/Coxeter_triangulation/include/gudhi/IO/output_debug_traces_to_html.h
+++ b/src/Coxeter_triangulation/include/gudhi/IO/output_debug_traces_to_html.h
@@ -1,5 +1,7 @@
-#ifdef GUDHI_DEBUG
-#define GUDHI_COX_OUTPUT_TO_HTML
+#ifndef IO_OUTPUT_DEBUG_TRACES_TO_HTML_H_
+#define IO_OUTPUT_DEBUG_TRACES_TO_HTML_H_
+
+#ifdef DEBUG_TRACES // All this part of code can be skipped if DEBUG_TRACES are not ON - cmake -DDEBUG_TRACES=ON .
#include <sstream>
#include <fstream>
@@ -544,4 +546,5 @@ void write_to_html(std::string file_name) {
} // namespace Gudhi
-#endif
+#endif // DEBUG_TRACES
+#endif // IO_OUTPUT_DEBUG_TRACES_TO_HTML_H_