diff options
author | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-10-04 09:55:48 +0000 |
---|---|---|
committer | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-10-04 09:55:48 +0000 |
commit | bb5705be2727f9e614950255ef4ae29942bb2668 (patch) | |
tree | 1d225050e50a10f58e0bfa0530a20487a340e7bb /src/Persistent_cohomology | |
parent | 8b1bcf1049ebb721df9a6b918b7ed1877885b3b4 (diff) |
hopefully I am adding now all the missing files....
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1615 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 076a4a371bbb8277d0f97df97a10a1e6567addc2
Diffstat (limited to 'src/Persistent_cohomology')
-rw-r--r-- | src/Persistent_cohomology/example/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp | 28 |
2 files changed, 13 insertions, 19 deletions
diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index b823d658..222606d6 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -74,8 +74,8 @@ endif(GMP_FOUND) message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") include( ${EIGEN3_USE_FILE} ) - add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) - target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + #add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) + #target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) diff --git a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp index 48fbb91a..20142ab2 100644 --- a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp +++ b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp @@ -22,11 +22,11 @@ #include <gudhi/Simplex_tree.h> #include <gudhi/Persistent_cohomology.h> -#include <gudhi/Points_3D_off_io.h> #include <boost/variant.hpp> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> -#include <CGAL/Delaunay_triangulation_3.h> +#include <CGAL/Regular_triangulation_3.h> +#include <CGAL/Regular_triangulation_euclidean_traits_3.h> #include <CGAL/Alpha_shape_3.h> #include <CGAL/iterator.h> @@ -41,10 +41,11 @@ // Alpha_shape_3 templates type definitions typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Alpha_shape_vertex_base_3<Kernel> Vb; -typedef CGAL::Alpha_shape_cell_base_3<Kernel> Fb; +typedef CGAL::Regular_triangulation_euclidean_traits_3<Kernel> Gt; +typedef CGAL::Alpha_shape_vertex_base_3<Gt> Vb; +typedef CGAL::Alpha_shape_cell_base_3<Gt> Fb; typedef CGAL::Triangulation_data_structure_3<Vb, Fb> Tds; -typedef CGAL::Delaunay_triangulation_3<Kernel, Tds> Triangulation_3; +typedef CGAL::Regular_triangulation_3<Gt, Tds> Triangulation_3; typedef CGAL::Alpha_shape_3<Triangulation_3> Alpha_shape_3; // From file type definition @@ -138,18 +139,11 @@ int main(int argc, char * const argv[]) { usage(argv[0]); } - // Read points from file - std::string offInputFile(argv[1]); - // Read the OFF file (input file name given as parameter) and triangulate points - Gudhi::Points_3D_off_reader<Point_3> off_reader(offInputFile); - // Check the read operation was correct - if (!off_reader.is_valid()) { - std::cerr << "Unable to read file " << offInputFile << std::endl; - usage(argv[0]); - } - - // Retrieve the triangulation - std::vector<Point_3> lp = off_reader.get_point_cloud(); + std::vector<Gt::Weighted_point> lp; + lp.emplace_back(Point_3(0,0,0),0); + lp.emplace_back(Point_3(0,0,1),0); + lp.emplace_back(Point_3(0,1,0),.2); + lp.emplace_back(Point_3(1,0,0),0); // alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode. Alpha_shape_3 as(lp.begin(), lp.end(), 0, Alpha_shape_3::GENERAL); |