Skip to content

Commit

Permalink
Merge pull request #867 from taketwo/fix-lzf
Browse files Browse the repository at this point in the history
Fix incompatibility with Boost 1.56
  • Loading branch information
jspricke committed Aug 24, 2014
2 parents 8d3a14e + c2ad66f commit 5c8fa8a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions io/src/lzf_image_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@

#define LZF_HEADER_SIZE 37


// The signature of boost::property_tree::xml_parser::write_xml() changed in Boost 1.56
// See https://github.com/PointCloudLibrary/pcl/issues/864
#include <boost/version.hpp>
#if (BOOST_VERSION >= 105600)
typedef boost::property_tree::xml_writer_settings<std::string> xml_writer_settings;
#else
typedef boost::property_tree::xml_writer_settings<char> xml_writer_settings;
#endif


//////////////////////////////////////////////////////////////////////////////
bool
pcl::io::LZFImageWriter::saveImageBlob (const char* data,
Expand Down Expand Up @@ -198,9 +209,8 @@ pcl::io::LZFImageWriter::writeParameter (const double &parameter,
catch (std::exception& e)
{}

boost::property_tree::xml_writer_settings<char> settings ('\t', 1);
pt.put (tag, parameter);
write_xml (filename, pt, std::locale (), settings);
write_xml (filename, pt, std::locale (), xml_writer_settings ('\t', 1));

return (true);
}
Expand All @@ -218,13 +228,12 @@ pcl::io::LZFDepth16ImageWriter::writeParameters (const pcl::io::CameraParameters
catch (std::exception& e)
{}

boost::property_tree::xml_writer_settings<char> settings ('\t', 1);
pt.put ("depth.focal_length_x", parameters.focal_length_x);
pt.put ("depth.focal_length_y", parameters.focal_length_y);
pt.put ("depth.principal_point_x", parameters.principal_point_x);
pt.put ("depth.principal_point_y", parameters.principal_point_y);
pt.put ("depth.z_multiplication_factor", z_multiplication_factor_);
write_xml (filename, pt, std::locale (), settings);
write_xml (filename, pt, std::locale (), xml_writer_settings ('\t', 1));

return (true);
}
Expand Down Expand Up @@ -279,12 +288,11 @@ pcl::io::LZFRGB24ImageWriter::writeParameters (const pcl::io::CameraParameters &
catch (std::exception& e)
{}

boost::property_tree::xml_writer_settings<char> settings ('\t', 1);
pt.put ("rgb.focal_length_x", parameters.focal_length_x);
pt.put ("rgb.focal_length_y", parameters.focal_length_y);
pt.put ("rgb.principal_point_x", parameters.principal_point_x);
pt.put ("rgb.principal_point_y", parameters.principal_point_y);
write_xml (filename, pt, std::locale (), settings);
write_xml (filename, pt, std::locale (), xml_writer_settings ('\t', 1));

return (true);
}
Expand Down

0 comments on commit 5c8fa8a

Please sign in to comment.