summaryrefslogtreecommitdiff
path: root/src/Contraction/example/Garland_heckbert.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-08 15:24:27 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-08 15:24:27 +0000
commit58e633f51ffa06aa219231cd1c08eab59457a12f (patch)
tree83fd798e34b61df36c991de7eccf860ed9194564 /src/Contraction/example/Garland_heckbert.cpp
parent6dd03d72142c98c4348e1b95d538de3b184bbc59 (diff)
Fix cpplint on examples.
Bug fix on persistence_from_simple_simplex_tree. Add persistence examples tests. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@843 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 9b7b73abb4a5d6bb110376deb689247bfdae035c
Diffstat (limited to 'src/Contraction/example/Garland_heckbert.cpp')
-rw-r--r--src/Contraction/example/Garland_heckbert.cpp36
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_