diff --git a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h index 952adb6799d..2e09b9431e2 100644 --- a/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h +++ b/Triangulation/include/CGAL/IO/Triangulation_off_ostream.h @@ -32,7 +32,7 @@ namespace Triangulation_IO { // TODO: test if the stream is binary or text? template -void +int output_point(std::ostream & os, const Traits &traits, const P & p) { typedef typename Traits::Compute_coordinate_d Ccd; @@ -44,11 +44,12 @@ output_point(std::ostream & os, const Traits &traits, const P & p) for (int i = 1 ; i < dim ; ++i) os << " " << CGAL::to_double(ccd(p, i)); } + return dim; } // TODO: test if the stream is binary or text? template -void +int output_weighted_point(std::ostream & os, const Traits &traits, const P & p, bool output_weight = true) { @@ -64,6 +65,26 @@ output_weighted_point(std::ostream & os, const Traits &traits, const P & p, if (output_weight) os << " " << pt_weight(p); } + return dim; +} + +// TODO: test if the stream is binary or text? +template +void +output_full_cell(std::ostream & os, const Traits &traits, const FCH & fch, + bool output_weights = false) +{ + typename FCH::value_type::Vertex_handle_iterator vit = fch->vertices_begin(); + for( ; vit != fch->vertices_end(); ++vit ) + { + int dim; + if (output_weights) + dim = output_weighted_point(os, traits, (*vit)->point()); + else + dim = output_point(os, traits, (*vit)->point()); + if (dim > 0) + os << std::endl; + } } // TODO: test if the stream is binary or text?