summaryrefslogtreecommitdiff
path: root/src/common/example/CGAL_points_off_reader.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-04-15 08:42:28 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-04-15 08:42:28 +0000
commitc0bff602db910fbda4449299e48df469c0457fb9 (patch)
tree9056c8d35caa83265389f24cbf7575850ddb0b71 /src/common/example/CGAL_points_off_reader.cpp
parent384d6f7cda318804997555cb441b5baf4d8f6a42 (diff)
parent7e71749f8aa73236a244394eedd5f662ec3a1889 (diff)
Merge of periodic_alpha_complex_3d_persistence feature
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1119 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2a77050d737aa008a1bd0c71a4e4c8eb21c7fef6
Diffstat (limited to 'src/common/example/CGAL_points_off_reader.cpp')
-rw-r--r--src/common/example/CGAL_points_off_reader.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/common/example/CGAL_points_off_reader.cpp b/src/common/example/CGAL_points_off_reader.cpp
index 45e9f1e6..997b47c1 100644
--- a/src/common/example/CGAL_points_off_reader.cpp
+++ b/src/common/example/CGAL_points_off_reader.cpp
@@ -8,17 +8,19 @@
#include <string>
#include <vector>
-typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel;
-typedef typename Kernel::Point_d Point_d;
+using Kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >;
+using Point_d = typename Kernel::Point_d;
-void usage(int argc, char * const progName) {
- std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl;
+void usage(char * const progName) {
std::cerr << "Usage: " << progName << " inputFile.off" << std::endl;
exit(-1);
}
int main(int argc, char **argv) {
- if (argc != 2) usage(argc, (argv[0] - 1));
+ 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
@@ -26,16 +28,16 @@ int main(int argc, char **argv) {
// Check the read operation was correct
if (!off_reader.is_valid()) {
std::cerr << "Unable to read file " << offInputFile << std::endl;
- exit(-1);
+ usage(argv[0]);
}
// Retrieve the triangulation
std::vector<Point_d> point_cloud = off_reader.get_point_cloud();
- int n = 0;
+ int n {0};
for (auto point : point_cloud) {
std::cout << "Point[" << n << "] = ";
- for (int i = 0; i < point.dimension(); i++)
+ for (int i {0}; i < point.dimension(); i++)
std::cout << point[i] << " ";
std::cout << "\n";
++n;