diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-03 08:41:38 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-03 08:41:38 +0000 |
commit | 3e1cf01b055718ead2433ef852dcfccce502cdb8 (patch) | |
tree | b51a0ff3eed7d9ff7007a52180833ab7f529a248 /src/common/example/example_vector_double_points_off_reader.cpp | |
parent | a6b1719067462f93a7ee3b7f8f632b85fe27117d (diff) | |
parent | 8447fa7575ae4db0db6daa8e03a0c2f9a374df7c (diff) |
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/rips_complex_from_correlation_matrix@3327 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 85b28237989b93fb4b5f8629a7f28bdb51b9a1b1
Diffstat (limited to 'src/common/example/example_vector_double_points_off_reader.cpp')
-rw-r--r-- | src/common/example/example_vector_double_points_off_reader.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/example/example_vector_double_points_off_reader.cpp b/src/common/example/example_vector_double_points_off_reader.cpp index 8aecb26e..5093da85 100644 --- a/src/common/example/example_vector_double_points_off_reader.cpp +++ b/src/common/example/example_vector_double_points_off_reader.cpp @@ -17,25 +17,27 @@ int main(int argc, char **argv) { usage(argv[0]); } - std::string offInputFile(argv[1]); + std::string off_input_file(argv[1]); // Read the OFF file (input file name given as parameter) and triangulate points - Gudhi::Points_off_reader<Point_d> off_reader(offInputFile); + Gudhi::Points_off_reader<Point_d> off_reader(off_input_file); // Check the read operation was correct if (!off_reader.is_valid()) { - std::cerr << "Unable to read file " << offInputFile << std::endl; + std::cerr << "Unable to read file " << off_input_file << std::endl; usage(argv[0]); } // Retrieve the triangulation std::vector<Point_d> point_cloud = off_reader.get_point_cloud(); + std::ofstream output_file(off_input_file + ".txt"); int n {0}; for (auto point : point_cloud) { - std::cout << "Point[" << n << "] = "; + output_file << "Point[" << n << "] = "; for (std::size_t i {0}; i < point.size(); i++) - std::cout << point[i] << " "; - std::cout << "\n"; + output_file << point[i] << " "; + output_file << "\n"; ++n; } + output_file.close(); return 0; } |