#include "yamlsessreader.h" #include "yamlext.h" namespace genesis { using namespace geoworld; YAMLSynthSessCfgReader::YAMLSynthSessCfgReader( std::istream & input ) : _input(input) {} YAMLSynthSessCfgReader::~YAMLSynthSessCfgReader() {} bool YAMLSynthSessCfgReader::load( geoworld::SynthesisSessionConfig & cfg ) { using namespace YAML; Node nd = Load(_input); try { const YAML::Node & ndPasses = nd["passes"], & ndGeohost = nd["geohost"], & ndMacro = nd["macro"]; ndPasses["count"] >> cfg.passes.count; ndPasses["morphs"] >> cfg.passes.morphcount; ndGeohost["layers"] >> cfg.geohost.layercount; ndGeohost["classes"] >> cfg.geohost.classcount; ndMacro["morphs"] >> cfg.macro.morphcount; ndMacro["lod"] >> cfg.macro.lod; ndMacro["coarseness"] >> cfg.macro.coarseness; return true; } catch (YAML::RepresentationException &) { return false; } } }