From ea9b811a7c958c0e577789b74ea7362ecd47990e Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 14 Aug 2018 14:18:45 +0200 Subject: [PATCH] Update test with latest methods --- .../test/Point_set_3/point_set_test_join.cpp | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/Point_set_3/test/Point_set_3/point_set_test_join.cpp b/Point_set_3/test/Point_set_3/point_set_test_join.cpp index 78f6e3ee6c8..ab8d3b9da6b 100644 --- a/Point_set_3/test/Point_set_3/point_set_test_join.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test_join.cpp @@ -29,15 +29,23 @@ void test (bool expr, const char* msg) } void print_point_set (const Point_set& ps, const char* msg) + { + Point_set::Property_map intensity; + bool has_intensity; + boost::tie (intensity, has_intensity) + = ps.property_map("intensity"); + std::cerr << msg << std::endl; - if (ps.has_normal_map()) - for (Point_set::const_iterator it = ps.begin(); it != ps.end(); ++ it) - std::cerr << *it << ": " << ps.point(*it) - << ", normal " << ps.normal(*it) << std::endl; - else - for (Point_set::const_iterator it = ps.begin(); it != ps.end(); ++ it) - std::cerr << *it << ": " << ps.point(*it) << std::endl; + for (Point_set::const_iterator it = ps.begin(); it != ps.end(); ++ it) + { + std::cerr << *it << ": " << ps.point(*it); + if (ps.has_normal_map()) + std::cerr << ", normal " << ps.normal(*it); + if (has_intensity) + std::cerr << ", intensity " << intensity[*it]; + std::cerr << std::endl; + } } @@ -62,5 +70,25 @@ int main (int, char**) ps1 += ps2; print_point_set (ps1, "JOINT PS1 = "); + Point_set ps3; + ps3.add_normal_map(); + + Point_set::Property_map intensity; + bool okay; + + boost::tie (intensity, okay) = ps3.add_property_map("intensity", 0); + assert (okay); + + Point_set::iterator it = ps3.insert (Point (double(0), double(1), double(2)), + Vector (double(3), double(4), double(5))); + intensity[*it] = 42; + + print_point_set (ps3, "PS3 = "); + ps1.copy_properties (ps3); + + print_point_set (ps1, "PS1 with PS3 properties = "); + ps1.insert (ps3, *it); + print_point_set (ps1, "PS1 with PS3 properties + PS3 item copied = "); + return EXIT_SUCCESS; };