mirror of https://github.com/CGAL/cgal
Merge pull request #7215 from bkhanal-11/master
Modified polyfit examples to take in user input
This commit is contained in:
commit
d528e54490
|
|
@ -39,9 +39,9 @@ typedef CGAL::Nth_of_tuple_property_map<2, PNI>
|
||||||
* candidate generation are cached and reused.
|
* candidate generation are cached and reused.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int main()
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
const std::string& input_file(CGAL::data_file_path("points_3/building.ply"));
|
const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/building.ply");
|
||||||
std::ifstream input_stream(input_file.c_str());
|
std::ifstream input_stream(input_file.c_str());
|
||||||
|
|
||||||
std::vector<PNI> points; // store points
|
std::vector<PNI> points; // store points
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ typedef CGAL::Nth_of_tuple_property_map<2, PNI>
|
||||||
* the point is not assigned to a plane).
|
* the point is not assigned to a plane).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int main()
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
const std::string& input_file(CGAL::data_file_path("points_3/ball.ply"));
|
const std::string input_file = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/ball.ply");
|
||||||
std::ifstream input_stream(input_file.c_str());
|
std::ifstream input_stream(input_file.c_str());
|
||||||
|
|
||||||
std::vector<PNI> points; // store points
|
std::vector<PNI> points; // store points
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,13 @@ private:
|
||||||
* the surface model from the planes.
|
* the surface model from the planes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int main()
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Point_vector points;
|
Point_vector points;
|
||||||
|
|
||||||
// Load point set from a file.
|
// Load point set from a file.
|
||||||
const std::string input_file(CGAL::data_file_path("points_3/cube.pwn"));
|
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());
|
std::ifstream input_stream(input_file.c_str());
|
||||||
if (input_stream.fail()) {
|
if (input_stream.fail()) {
|
||||||
std::cerr << "Failed open file \'" << input_file << "\'" << std::endl;
|
std::cerr << "Failed open file \'" << input_file << "\'" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,13 @@ typedef CGAL::Surface_mesh<Point>
|
||||||
* the surface model from the planes.
|
* the surface model from the planes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int main()
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Point_vector points;
|
Point_vector points;
|
||||||
|
|
||||||
// Loads point set from a file.
|
// Loads point set from a file.
|
||||||
const std::string input_file(CGAL::data_file_path("points_3/cube.pwn"));
|
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());
|
std::ifstream input_stream(input_file.c_str());
|
||||||
if (input_stream.fail()) {
|
if (input_stream.fail()) {
|
||||||
std::cerr << "failed open file \'" <<input_file << "\'" << std::endl;
|
std::cerr << "failed open file \'" <<input_file << "\'" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue