diff options
author | salinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-10-18 10:44:55 +0000 |
---|---|---|
committer | salinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-10-18 10:44:55 +0000 |
commit | 20cb0d7a919005ba20d0a76cca38a73d3a119480 (patch) | |
tree | 916a86bc61a19564c8ce8868db75419f857a60ce /src/Contraction | |
parent | ff6ad8b959f6c20380f3d68ebb1bbbf1224adcfd (diff) |
GH: dim3 restriction, skbl: num_simplices methods
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/skb_simplex_insertion_merge@865 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: e7f9d48c4e6af222b6f158e906a3a592027d39b8
Diffstat (limited to 'src/Contraction')
-rw-r--r-- | src/Contraction/example/Garland_heckbert.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 70f29b6a..681426e0 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -145,13 +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 typename Complex::Vertex_handle Vertex_handle; + // load the points Skeleton_blocker_off_reader<Complex> off_reader(argv[1], complex); if (!off_reader.is_valid()) { @@ -159,8 +159,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]); @@ -171,22 +175,25 @@ int main(int argc, char *argv[]) { new GH_cost(complex), new GH_placement(complex), contraction::make_link_valid_contraction<EdgeProfile>(), - new GH_visitor(complex)); + new GH_visitor(complex) + ); std::cout << "Contract " << num_contractions << " edges" << std::endl; contractor.contract_edges(num_contractions); 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 + //write simplified complex Skeleton_blocker_off_writer<Complex> off_writer(argv[2], complex); return EXIT_SUCCESS; } +#endif // GARLAND_HECKBERT_H_ + + -#endif // GARLAND_HECKBERT_H_ |