From 5fb7ad3b999aef665f3788ec88ff282a2c6ff3e7 Mon Sep 17 00:00:00 2001 From: Bishwash Khanal <43448240+bkhanal-11@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:07:25 +0545 Subject: [PATCH] added user input --- .../polyfit_example_with_region_growing.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index 493c8c138aa..530d1422de4 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -83,13 +83,13 @@ private: * the surface model from the planes. */ -int main() +int main(int argc, char* argv[]) { Point_vector points; // Load point set from a file. - const std::string input_file(CGAL::data_file_path("points_3/cube.pwn")); - std::ifstream input_stream(input_file.c_str()); + const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/cube.pwn"); + std::ifstream input_stream(input_file.c_str()); if (input_stream.fail()) { std::cerr << "Failed open file \'" << input_file << "\'" << std::endl; return EXIT_FAILURE;