summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/example
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-06-15 08:13:42 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-06-15 08:13:42 +0000
commita99cac04ca5b61d1f9a1c5246829d017a6cf278d (patch)
treef7e66f6dd9c569a634a7a0524bc7c70749e4592e /src/Alpha_complex/example
parent16d96ceb64b05f53953dc44abd23b17601fdc91b (diff)
Weighted, normal and exact version of Alpha_shapes_3
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_3d_module_vincent@3618 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: f1b2014fe34b3e7814d9c3d02881c63e10f047b2
Diffstat (limited to 'src/Alpha_complex/example')
-rw-r--r--src/Alpha_complex/example/CMakeLists.txt2
-rw-r--r--src/Alpha_complex/example/traits_test.cpp35
2 files changed, 37 insertions, 0 deletions
diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt
index 2fc62452..c93832d2 100644
--- a/src/Alpha_complex/example/CMakeLists.txt
+++ b/src/Alpha_complex/example/CMakeLists.txt
@@ -32,4 +32,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
install(TARGETS Alpha_complex_example_from_points DESTINATION bin)
install(TARGETS Alpha_complex_example_from_off DESTINATION bin)
+ add_executable ( traits_test traits_test.cpp )
+
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
diff --git a/src/Alpha_complex/example/traits_test.cpp b/src/Alpha_complex/example/traits_test.cpp
new file mode 100644
index 00000000..63b9740c
--- /dev/null
+++ b/src/Alpha_complex/example/traits_test.cpp
@@ -0,0 +1,35 @@
+#include <gudhi/Alpha_complex_3d.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <limits> // for numeric limits
+
+void usage(int nbArgs, char * const progName) {
+ std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
+ std::cerr << "Usage: " << progName << " [alpha_square_max_value]\n";
+ std::cerr << " i.e.: " << progName << " 60.0\n";
+ exit(-1); // ----- >>
+}
+
+int main(int argc, char **argv) {
+ //if ((argc != 1) && (argc != 2)) usage(argc, (argv[0] - 1));
+
+ using Alpha_shapes_3d = Gudhi::alpha_complex::Alpha_shapes_3d;
+ std::vector<Alpha_shapes_3d::Point_3> points;
+ points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
+ points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));
+
+ Gudhi::alpha_complex::Alpha_complex_3d<Alpha_shapes_3d> alpha_complex(points);
+
+ using Weighted_alpha_shapes_3d = Gudhi::alpha_complex::Weighted_alpha_shapes_3d;
+ std::vector<Weighted_alpha_shapes_3d::Point_3> w_points;
+ w_points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
+ w_points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));
+
+ std::vector<double> weights = {1., 2.};
+
+ Gudhi::alpha_complex::Alpha_complex_3d<Weighted_alpha_shapes_3d> weighted_alpha_complex(points, weights);
+
+ return 0;
+}