summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp')
-rw-r--r--src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp b/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp
index f09e6121..1523372a 100644
--- a/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp
+++ b/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp
@@ -21,19 +21,13 @@
*/
// to construct a Delaunay_triangulation from a OFF file
-#include "gudhi/Alpha_shapes/Delaunay_triangulation_off_io.h"
+#include "gudhi/Delaunay_triangulation_off_io.h"
#include "gudhi/Alpha_complex.h"
// to construct a simplex_tree from Delaunay_triangulation
#include "gudhi/graph_simplicial_complex.h"
#include "gudhi/Simplex_tree.h"
-#include <CGAL/Delaunay_triangulation.h>
-#include <CGAL/Epick_d.h>
-#include <CGAL/point_generators_d.h>
-#include <CGAL/algorithm.h>
-#include <CGAL/assertions.h>
-
#include <iostream>
#include <iterator>
@@ -41,12 +35,6 @@
#include <stdlib.h>
#include <string>
-// Use dynamic_dimension_tag for the user to be able to set dimension
-typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > K;
-typedef CGAL::Delaunay_triangulation<K> T;
-// The triangulation uses the default instanciation of the
-// TriangulationDataStructure template parameter
-
void usage(char * const progName) {
std::cerr << "Usage: " << progName << " filename.off" << std::endl;
exit(-1); // ----- >>
@@ -62,7 +50,7 @@ int main(int argc, char **argv) {
// ----------------------------------------------------------------------------
//
- // Init of an alpha-complex from a OFF file
+ // Init of an alpha-complex from an OFF file
//
// ----------------------------------------------------------------------------
Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_name);
@@ -71,7 +59,14 @@ int main(int argc, char **argv) {
std::cout << "alpha_complex_from_file.filtration()=" << alpha_complex_from_file.filtration() << std::endl;
std::cout << "alpha_complex_from_file.num_simplices()=" << alpha_complex_from_file.num_simplices() << std::endl;
std::cout << "alpha_complex_from_file.num_vertices()=" << alpha_complex_from_file.num_vertices() << std::endl;
- std::cout << alpha_complex_from_file << std::endl;
-
+
+ std::cout << "Iterator on Simplices in the filtration order, with [filtration value]:" << std::endl;
+ for (auto f_simplex : alpha_complex_from_file.filtration_simplex_range()) {
+ std::cout << " " << "[" << alpha_complex_from_file.filtration(f_simplex) << "] ";
+ for (auto vertex : alpha_complex_from_file.simplex_vertex_range(f_simplex)) {
+ std::cout << vertex << " ";
+ }
+ std::cout << std::endl;
+ }
return 0;
} \ No newline at end of file