diff --git a/Nef_3/include/CGAL/IO/Nef_polyhedron_iostream_3.h b/Nef_3/include/CGAL/IO/Nef_polyhedron_iostream_3.h index 204381fe465..ca96ec047e5 100644 --- a/Nef_3/include/CGAL/IO/Nef_polyhedron_iostream_3.h +++ b/Nef_3/include/CGAL/IO/Nef_polyhedron_iostream_3.h @@ -31,9 +31,9 @@ std::ostream& operator<< { typedef typename Nef_polyhedron_3::SNC_structure SNC_structure; #ifdef CGAL_NEF3_SORT_OUTPUT - CGAL::SNC_io_parser O(os, NP.snc(), true); + CGAL::SNC_io_parser O(os, NP.snc(), true, true); #else - CGAL::SNC_io_parser O(os, NP.snc()); + CGAL::SNC_io_parser O(os, NP.snc(), false, true); #endif O.print(); return os; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index ae50fdc8cb8..0dcedd25cfe 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -878,7 +878,8 @@ public: public: SNC_io_parser(std::istream& is, SNC_structure& W); - SNC_io_parser(std::ostream& os, SNC_structure& W, bool sort=false); + SNC_io_parser(std::ostream& os, SNC_structure& W, + bool sort=false, bool reduce_ = false); std::string index(Vertex_iterator v) const { return VI(v,verbose); } @@ -972,7 +973,7 @@ SNC_io_parser::SNC_io_parser(std::istream& is, SNC_structure& W) : template SNC_io_parser::SNC_io_parser(std::ostream& os, SNC_structure& W, - bool sort) : + bool sort, bool reduce_) : Base(W), in(std::cin), out(os), FI(W.halffacets_begin(),W.halffacets_end(),'F'), CI(W.volumes_begin(),W.volumes_end(),'C'), @@ -990,8 +991,10 @@ SNC_io_parser::SNC_io_parser(std::ostream& os, SNC_structure& W, verbose = (out.iword(CGAL::IO::mode) != CGAL::IO::ASCII && out.iword(CGAL::IO::mode) != CGAL::IO::BINARY); sorted = sort; - reduce = this->is_extended_kernel() && sorted && this->is_bounded(); - + reduce = reduce_; + reduce = reduce && this->is_extended_kernel() && this->is_bounded(); + sorted = sorted || reduce; + Vertex_iterator vi; CGAL_forall_vertices(vi, *this->sncp()) { VL.push_back(vi);