Пример #1
0
 /**
  * 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();
 }
Пример #2
0
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 );
}