diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-11-06 14:27:18 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-11-06 14:27:18 +0000 |
commit | 606115b399b010b8ebfbf13f6a8ca2b1c1bf17cd (patch) | |
tree | f13206921b7b77ca3d2cc66c4ed612300bdaebd8 /src/Contraction/example/Garland_heckbert.cpp | |
parent | dd2a15d1a8d2607848527513210330baebce9e8e (diff) | |
parent | 72f647ad4b802d08072925a374324e7ace4b2c4d (diff) |
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bitmap@889 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: d90cb012ff7f3a9070ea19e3c6651cc455bebdad
Diffstat (limited to 'src/Contraction/example/Garland_heckbert.cpp')
-rw-r--r-- | src/Contraction/example/Garland_heckbert.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index a41f65aa..70f29b6a 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -1,7 +1,4 @@ -/* - * Garland_heckbert.h - * Created on: Feb 10, 2015 - * This file is part of the Gudhi Library. The Gudhi library +/* This file is part of the Gudhi Library. The Gudhi library * (Geometric Understanding in Higher Dimensions) is a generic C++ * library for computational topology. * @@ -28,12 +25,13 @@ #ifndef GARLAND_HECKBERT_H_ #define GARLAND_HECKBERT_H_ +#include <gudhi/Point.h> +#include <gudhi/Edge_contraction.h> +#include <gudhi/Skeleton_blocker.h> +#include <gudhi/Off_reader.h> + #include <boost/timer/timer.hpp> #include <iostream> -#include "gudhi/Point.h" -#include "gudhi/Edge_contraction.h" -#include "gudhi/Skeleton_blocker.h" -#include "gudhi/Off_reader.h" #include "Garland_heckbert/Error_quadric.h" @@ -51,7 +49,6 @@ struct Geometry_trait { */ struct Garland_heckbert_traits : public Skeleton_blocker_simple_geometric_traits<Geometry_trait> { public: - struct Garland_heckbert_vertex : public Simple_geometric_vertex { Error_quadric<Geometry_trait::Point> quadric; }; @@ -68,6 +65,7 @@ typedef Skeleton_blocker_contractor<Complex> Complex_contractor; */ class GH_placement : public Gudhi::contraction::Placement_policy<EdgeProfile> { Complex& complex_; + public: typedef Gudhi::contraction::Placement_policy<EdgeProfile>::Placement_type Placement_type; @@ -91,8 +89,8 @@ class GH_placement : public Gudhi::contraction::Placement_policy<EdgeProfile> { */ class GH_cost : public Gudhi::contraction::Cost_policy<EdgeProfile> { Complex& complex_; - public: + public: typedef Gudhi::contraction::Cost_policy<EdgeProfile>::Cost_type Cost_type; GH_cost(Complex& complex) : complex_(complex) { } @@ -115,13 +113,13 @@ class GH_cost : public Gudhi::contraction::Cost_policy<EdgeProfile> { */ class GH_visitor : public Gudhi::contraction::Contraction_visitor<EdgeProfile> { Complex& complex_; - public: + public: GH_visitor(Complex& complex) : complex_(complex) { } - //Compute quadrics for every vertex v - //The quadric of v consists in the sum of quadric - //of every triangles passing through v weighted by its area + // Compute quadrics for every vertex v + // The quadric of v consists in the sum of quadric + // of every triangles passing through v weighted by its area void on_started(Complex & complex) override { for (auto v : complex.vertex_range()) { @@ -147,7 +145,8 @@ 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; } @@ -172,8 +171,7 @@ 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); @@ -183,7 +181,7 @@ int main(int argc, char *argv[]) { 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; @@ -191,4 +189,4 @@ int main(int argc, char *argv[]) { -#endif /* GARLAND_HECKBERT_H_ */ +#endif // GARLAND_HECKBERT_H_ |