diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-19 10:57:11 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-19 10:57:11 +0000 |
commit | 2a3afe37fa9423890f4747373c955d7195ce8f72 (patch) | |
tree | 306e91cc87c3380154eba272a2d1b2e86fffeb30 | |
parent | 9e7a221884346501d5bcb06ad184e08f96938315 (diff) |
Commit before changing example file name
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@628 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 3e03055a89514f6308e6aed58a9bcb1d64c95a83
-rw-r--r-- | src/Alpha_complex/example/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp | 28 |
2 files changed, 13 insertions, 20 deletions
diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index 9129fdcf..04c0ba58 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -15,9 +15,8 @@ if(CGAL_FOUND) include( ${EIGEN3_USE_FILE} ) #add_definitions(-DDEBUG_TRACES) - add_executable ( stfromdt Simplex_tree_from_delaunay_triangulation.cpp ) - target_link_libraries(stfromdt ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - + add_executable ( alphaoffreader Alpha_complex_from_off.cpp ) + target_link_libraries(alphaoffreader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") endif() 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 1523372a..d129ebf7 100644 --- a/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp +++ b/src/Alpha_complex/example/Simplex_tree_from_delaunay_triangulation.cpp @@ -24,13 +24,6 @@ #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 <iostream> -#include <iterator> - #include <stdio.h> #include <stdlib.h> #include <string> @@ -49,23 +42,24 @@ int main(int argc, char **argv) { std::string off_file_name(argv[1]); // ---------------------------------------------------------------------------- - // - // Init of an alpha-complex from an OFF file - // + // Init of an alpha complex from an OFF file // ---------------------------------------------------------------------------- - Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_name); + Gudhi::alphacomplex::Alpha_complex<> alpha_complex_from_file(off_file_name); - std::cout << "alpha_complex_from_file.dimension()=" << alpha_complex_from_file.dimension() << std::endl; - 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; + // ---------------------------------------------------------------------------- + // Display information about the alpha complex + // ---------------------------------------------------------------------------- + std::cout << "Alpha complex is of dimension " << alpha_complex_from_file.dimension() << + " - " << alpha_complex_from_file.num_simplices() << " simplices - " << + alpha_complex_from_file.num_vertices() << " vertices." << std::endl; - std::cout << "Iterator on Simplices in the filtration order, with [filtration value]:" << std::endl; + std::cout << "Iterator on alpha complex 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) << "] "; + std::cout << " ( "; for (auto vertex : alpha_complex_from_file.simplex_vertex_range(f_simplex)) { std::cout << vertex << " "; } + std::cout << ") -> " << "[" << alpha_complex_from_file.filtration(f_simplex) << "] "; std::cout << std::endl; } return 0; |