summaryrefslogtreecommitdiff
path: root/example/common/CGAL_points_off_reader.cpp
diff options
context:
space:
mode:
authorGard Spreemann <gspreemann@gmail.com>2017-04-20 11:10:45 +0200
committerGard Spreemann <gspreemann@gmail.com>2017-04-20 11:10:45 +0200
commit8d7329f3e5ad843e553c3c5503cecc28ef2eead6 (patch)
tree6d80d83a7c4bcd3296e12a28404bfe84ef84ed55 /example/common/CGAL_points_off_reader.cpp
parent55c7181126aa7defce38c9b82872d14223d4c1dd (diff)
GUDHI 2.0.0 as released by upstream in a tarball.upstream/2.0.0
Diffstat (limited to 'example/common/CGAL_points_off_reader.cpp')
-rw-r--r--example/common/CGAL_points_off_reader.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/example/common/CGAL_points_off_reader.cpp b/example/common/CGAL_points_off_reader.cpp
deleted file mode 100644
index d1ca166d..00000000
--- a/example/common/CGAL_points_off_reader.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <gudhi/Points_off_io.h>
-
-// For CGAL points type in dimension d
-// cf. http://doc.cgal.org/latest/Kernel_d/classCGAL_1_1Point__d.html
-#include <CGAL/Epick_d.h>
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-using Kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >;
-using Point_d = Kernel::Point_d;
-
-void usage(char * const progName) {
- std::cerr << "Usage: " << progName << " inputFile.off" << std::endl;
- exit(-1);
-}
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl;
- usage(argv[0]);
- }
-
- std::string offInputFile(argv[1]);
- // Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_off_reader<Point_d> off_reader(offInputFile);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << offInputFile << std::endl;
- usage(argv[0]);
- }
-
- // Retrieve the triangulation
- std::vector<Point_d> point_cloud = off_reader.get_point_cloud();
-
- int n {0};
- for (auto point : point_cloud) {
- std::cout << "Point[" << n << "] = ";
- for (int i {0}; i < point.dimension(); i++)
- std::cout << point[i] << " ";
- std::cout << "\n";
- ++n;
- }
- return 0;
-}