diff --git a/SMDS_3/include/CGAL/IO/output_to_vtu.h b/SMDS_3/include/CGAL/IO/output_to_vtu.h index 51438e8dcde..24506adc687 100644 --- a/SMDS_3/include/CGAL/IO/output_to_vtu.h +++ b/SMDS_3/include/CGAL/IO/output_to_vtu.h @@ -268,12 +268,16 @@ write_attributes(std::ostream& os, } enum VTU_ATTRIBUTE_TYPE{ - DOUBLE=0, + INTEGER = 0, + DOUBLE, UNIT_8, SIZE_TYPE }; -typedef std::variant*, const std::vector*, const std::vector* > Vtu_attributes; +typedef std::variant*, + const std::vector*, + const std::vector*, + const std::vector* > Vtu_attributes; template void output_to_vtu_with_attributes(std::ostream& os, @@ -284,6 +288,7 @@ void output_to_vtu_with_attributes(std::ostream& os, //CGAL_assertion(attributes.size() == attribute_types.size()); typedef typename C3T3::Triangulation Tr; typedef typename Tr::Vertex_handle Vertex_handle; + const Tr& tr = c3t3.triangulation(); std::map V; //write header @@ -316,9 +321,12 @@ void output_to_vtu_with_attributes(std::ostream& os, { switch(attributes[i].second.index()){ case 0: - write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); + write_attribute_tag(os, attributes[i].first, *std::get* >(attributes[i].second), binary, offset); break; case 1: + write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); + break; + case 2: write_attribute_tag(os,attributes[i].first, *std::get* >(attributes[i].second), binary,offset); break; default: @@ -336,9 +344,12 @@ void output_to_vtu_with_attributes(std::ostream& os, for(std::size_t i = 0; i< attributes.size(); ++i) { switch(attributes[i].second.index()){ case 0: - write_attributes(os, *std::get* >(attributes[i].second)); + write_attributes(os, *std::get* >(attributes[i].second)); break; case 1: + write_attributes(os, *std::get* >(attributes[i].second)); + break; + case 2: write_attributes(os, *std::get* >(attributes[i].second)); break; default: @@ -371,14 +382,13 @@ void output_to_vtu(std::ostream& os, const C3T3& c3t3, Mode mode = BINARY) { - typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; - std::vector mids; - for( Cell_iterator cit = c3t3.cells_in_complex_begin() ; - cit != c3t3.cells_in_complex_end() ; - ++cit ) + typedef typename C3T3::Cell_handle Cell_handle; + typedef typename C3T3::Subdomain_index Subdomain_index; + + std::vector mids; + for( Cell_handle c : c3t3.cells_in_complex()) { - double v = cit->subdomain_index(); - mids.push_back(v); + mids.push_back(c->subdomain_index()); } std::vector > atts;