diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index d16b9923584..84d9b09a0ea 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -1401,15 +1401,8 @@ private: // functions : public: /// \cond SKIP_IN_MANUAL - void dump_to_polylines(std::ostream& os) const { - for (const auto n: traverse()) - if (is_leaf(n)) { - Bbox box = bbox(n); - dump_box_to_polylines(box, os); - } - } - - void dump_box_to_polylines(const Bbox_2& box, std::ostream& os) const { + template + void dump_box_to_polylines(const Iso_rectangle_2& box, std::ostream& os) const { // dump in 3D for visualisation os << "5 " << box.xmin() << " " << box.ymin() << " 0 " @@ -1419,7 +1412,8 @@ public: << box.xmin() << " " << box.ymin() << " 0" << std::endl; } - void dump_box_to_polylines(const Bbox_3& box, std::ostream& os) const { + template + void dump_box_to_polylines(const Iso_cuboid_3& box, std::ostream& os) const { // Back face os << "5 " << box.xmin() << " " << box.ymin() << " " << box.zmin() << " " @@ -1451,6 +1445,14 @@ public: << box.xmax() << " " << box.ymax() << " " << box.zmax() << std::endl; } + void dump_to_polylines(std::ostream& os) const { + for (Node_index n: traverse(Orthtrees::Preorder_traversal(*this))) + if (is_leaf(n)) { + Bbox box = bbox(n); + dump_box_to_polylines(box, os); + } + } + std::string to_string(Node_index node) { std::stringstream stream; internal::print_orthtree_node(stream, node, *this);