Commit d9b62ea7 authored by incardon's avatar incardon

Fixing metadata in binary format

parent d0d5ac78
......@@ -343,7 +343,7 @@ class VTKWriter<pair,VECTOR_POINTS>
* \param meta_data string with the meta-data to add
*
*/
std::string add_meta_data(std::string & meta_data)
std::string add_meta_data(std::string & meta_data, file_type & opt)
{
std::string meta_string;
......@@ -362,7 +362,13 @@ class VTKWriter<pair,VECTOR_POINTS>
{
meta_string += "FIELD FieldData 1\n";
meta_string += "TIME 1 1 double\n";
meta_string += std::to_string(time);
if (opt == file_type::ASCII)
{meta_string += std::to_string(time);}
else
{
time = swap_endian_lt(time);
meta_string.append((const char *)&time,sizeof(double));
}
meta_string += "\n";
}
......@@ -446,7 +452,7 @@ public:
// Data type for graph is DATASET POLYDATA
vtk_header += "DATASET POLYDATA\n";
vtk_header += add_meta_data(meta_data);
vtk_header += add_meta_data(meta_data,ft);
// point properties header
point_prop_header = get_point_properties_list(ft);
......
......@@ -1049,6 +1049,9 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
vtk_v3.write("vtk_points_pp_header.vtk",prp_names,"points","time=5.123");
// We try binary
vtk_v3.write("vtk_points_pp_header_bin.vtk",prp_names,"points","time=5.123",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment