From 6b4da62cab26b51ba48370c67fb873fd71e19f69 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 6 Oct 2015 15:16:16 +0200 Subject: [PATCH] Update read_test with new ply function --- .../data/read_test/simple.ply | Bin 0 -> 320 bytes .../test/Point_set_processing_3/read_test.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 Point_set_processing_3/test/Point_set_processing_3/data/read_test/simple.ply diff --git a/Point_set_processing_3/test/Point_set_processing_3/data/read_test/simple.ply b/Point_set_processing_3/test/Point_set_processing_3/data/read_test/simple.ply new file mode 100644 index 0000000000000000000000000000000000000000..8be39b1407359be4c5d2a2ffe0e567db0ca7b973 GIT binary patch literal 320 zcmZXP!3x4K42E~^Q{)L`;sZGJAcAMFrFNMsbm{0aS$Fc$4a(fu0zV{Q$e*P3NmU^> zhT-AJ#H77r_Nb9cX9)JYT-nexNDTM$<#s*66A7bXEERhEHeMJR2RNuUhF0 #include #include +#include #include #include @@ -47,6 +48,17 @@ bool read_off(std::string s, CGAL::Second_of_pair_property_map()); } +bool read_ply (std::string s, + std::vector& pv_pairs) +{ + std::ifstream fs(s.c_str()); + + return CGAL::read_ply_points_and_normals (fs, + back_inserter(pv_pairs), + CGAL::First_of_pair_property_map(), + CGAL::Second_of_pair_property_map()); +} + int main() { @@ -78,6 +90,7 @@ int main() assert(pv_pairs[2] == std::make_pair(Point_3(4,5,6), Vector_3(0,0,0))); assert(pv_pairs[3] == std::make_pair(Point_3(7,8,9), Vector_3(0,0,0))); + assert(read_ply("data/read_test/simple.ply", pv_pairs)); return 0; }