/** * Saves the model to a file named fname. You may want to use this method * from only a single rank. */ void save(const std::string& fname, const std::string& header) const { boost::property_tree::ptree pt = to_ptree(); std::ofstream of(fname); of << header; boost::property_tree::write_json(of, pt); of.close(); }
void Viewer::camera_position_output::write() { boost::property_tree::ptree p; comma::to_ptree to_ptree( p ); comma::visiting::apply( to_ptree ).to( *viewer_.camera() ); boost::property_tree::write_json( std::cout, p ); }