diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-11-23 16:35:23 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-11-23 16:35:23 +0000 |
commit | b3c3e0d75c717dbd94caf96c9ba827fb17b4d5b3 (patch) | |
tree | d4e706c81d54f54438aa681cd666e3854a80a37b /src/Contraction/example/Garland_heckbert.cpp | |
parent | fe78c077b00e91b3d316f1d64541008a615664e7 (diff) | |
parent | 061e43a2a48525bc5a69482a1ea80f20ff505e55 (diff) |
Backmerge of trunk
Add alpha complex in bibtex
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@929 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: c8975be439b3e9e91d1fd6ad988db12c75d0395b
Diffstat (limited to 'src/Contraction/example/Garland_heckbert.cpp')
-rw-r--r-- | src/Contraction/example/Garland_heckbert.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 70f29b6a..b545a066 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -145,12 +145,13 @@ class GH_visitor : public Gudhi::contraction::Contraction_visitor<EdgeProfile> { int main(int argc, char *argv[]) { if (argc != 4) { - std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save " - << "the result to output.off.\n"; + std::cerr << "Usage " << argv[0] << + " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; return EXIT_FAILURE; } Complex complex; + typedef Complex::Vertex_handle Vertex_handle; // load the points Skeleton_blocker_off_reader<Complex> off_reader(argv[1], complex); @@ -159,8 +160,12 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; + if (!complex.empty() && !(complex.point(Vertex_handle(0)).dimension() == 3)) { + std::cerr << "Only points of dimension 3 are supported." << std::endl; + return EXIT_FAILURE; + } + std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; int num_contractions = atoi(argv[3]); @@ -178,7 +183,7 @@ int main(int argc, char *argv[]) { std::cout << "Final complex has " << complex.num_vertices() << " vertices, " << - complex.num_edges() << " edges and" << + complex.num_edges() << " edges and " << complex.num_triangles() << " triangles." << std::endl; // write simplified complex @@ -187,6 +192,8 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } +#endif // GARLAND_HECKBERT_H_ + + -#endif // GARLAND_HECKBERT_H_ |