From 35fee4017481fd3f62fceb76a1b2bc8cd0f15b95 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 7 Sep 2018 14:17:13 +0000 Subject: Code review : rearrange documentation and examples according to making choices more orthogonal Rename Alpha_complex_3d_options.h Alpha_complex_options.h as it can be used by Alpha complex dD git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@3875 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 6c5b105248e4766a44438a187bb130a3722b310f --- .../Weighted_alpha_complex_3d_from_points.cpp | 26 +++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp') diff --git a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp index 1b60ccd8..61ceab6d 100644 --- a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp +++ b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp @@ -1,5 +1,4 @@ #include -#include // to construct a simplex_tree from alpha complex #include @@ -9,8 +8,9 @@ #include // for numeric limits using Weighted_alpha_complex_3d = Gudhi::alpha_complex::Alpha_complex_3d; -using Point = Weighted_alpha_complex_3d::Point_3 ; -using Vector_of_points = std::vector; +using Point = Weighted_alpha_complex_3d::Point_3; +using Weighted_point = Weighted_alpha_complex_3d::Triangulation_3::Weighted_point; +using Vector_of_weighted_points = std::vector; using Vector_of_weights = std::vector; int main(int argc, char **argv) { @@ -23,23 +23,17 @@ int main(int argc, char **argv) { // ---------------------------------------------------------------------------- // Init of a list of points and weights from a small molecule // ---------------------------------------------------------------------------- - Vector_of_points points; - Vector_of_weights weights; - points.push_back(Point(1, -1, -1)); - weights.push_back(4.); - points.push_back(Point(-1, 1, -1)); - weights.push_back(4.); - points.push_back(Point(-1, -1, 1)); - weights.push_back(4.); - points.push_back(Point(1, 1, 1)); - weights.push_back(4.); - points.push_back(Point(2, 2, 2)); - weights.push_back(1.); + Vector_of_weighted_points weighted_points; + weighted_points.push_back(Weighted_point(Point(1, -1, -1), 4.)); + weighted_points.push_back(Weighted_point(Point(-1, 1, -1), 4.)); + weighted_points.push_back(Weighted_point(Point(-1, -1, 1), 4.)); + weighted_points.push_back(Weighted_point(Point(1, 1, 1), 4.)); + weighted_points.push_back(Weighted_point(Point(2, 2, 2), 1.)); // ---------------------------------------------------------------------------- // Init of an alpha complex from the list of points // ---------------------------------------------------------------------------- - Weighted_alpha_complex_3d alpha_complex_from_points(points, weights); + Weighted_alpha_complex_3d alpha_complex_from_points(weighted_points); Gudhi::Simplex_tree<> simplex; if (alpha_complex_from_points.create_complex(simplex)) { -- cgit v1.2.3