38 std::ifstream ifs(filename.c_str());
41 for(std::string line; std::getline(ifs, line);)
47 data.emplace(key, bbm::bsdf_import<CONF>(
bsdf));
62 void exportFIT(
const std::string& filename,
const std::map<std::string,
bsdf_ptr<CONF>>& data,
const std::string& comment)
65 std::ofstream ofs(filename.c_str());
68 std::stringstream ss(comment);
69 for(std::string line; std::getline(ss, line);)
70 ofs <<
"# " << line << std::endl;
73 for(
const auto&
bsdf : data)
A shared_ptr wrapper for bsdfs.
Import a BSDF from a string using the BBM_DEFAULT_BSDF_IMPORTER method specified in the configuration...
BSDF implementation of a BSDF model.
Definition: bsdf.h:30
config concept
Definition: config.h:31
void exportFIT(const std::string &filename, const std::map< std::string, bsdf_ptr< CONF > > &data, const std::string &comment)
Export a 'fit' file.
Definition: fit.h:62
void importFIT(const std::string &filename, std::map< std::string, bsdf_ptr< CONF > > &data)
Import a 'fit' file.
Definition: fit.h:35
std::pair< std::string, std::string > split_eq(const std::string &str)
split a string of the form "key = val" in key and value. If no '=', then return an empty key.
Definition: string_util.h:77
std::string remove_comment(const std::string &str, const std::string &comment_marker)
Remove comments from string.
Definition: string_util.h:53
Definition: aggregatebsdf.h:29
std::string toString(const T &)
toString alias
Definition: stringconvert.h:594
Helper method for processing strings.
Definition: bsdf_ptr.h:22