added user input

This commit is contained in:
Bishwash Khanal 2023-01-27 14:07:25 +05:45 committed by GitHub
parent c7aac265f5
commit 5fb7ad3b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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;