| 52 | } |
| 53 | |
| 54 | void parse_offset_parameters(ParameterManager::Ptr manager, |
| 55 | PTree& config, SymmetryOrbits& orbits) { |
| 56 | std::string type = config.get<std::string>("type"); |
| 57 | if (type != "vertex_orbit") { |
| 58 | std::stringstream err_msg; |
| 59 | err_msg << "Invalid offset type: " << type; |
| 60 | throw NotImplementedError(err_msg.str()); |
| 61 | } |
| 62 | |
| 63 | PTree& effective_orbits = config.get_child("effective_orbits"); |
| 64 | PTree& offset_percentages = config.get_child("offset_percentages"); |
| 65 | assert(effective_orbits.size() == offset_percentages.size()); |
| 66 | |
| 67 | auto orbit_itr = effective_orbits.begin(); |
| 68 | auto offset_itr = offset_percentages.begin(); |
| 69 | while (orbit_itr != effective_orbits.end()) { |
| 70 | assert(offset_itr != offset_percentages.end()); |
| 71 | size_t orbit_index = orbit_itr->second.get_value<int>(); |
| 72 | const VectorI& roi = orbits.get_vertex_orbit(orbit_index); |
| 73 | size_t coordinate_idx = 0; |
| 74 | for (auto coordinate_itr : offset_itr->second) { |
| 75 | std::string offset = |
| 76 | coordinate_itr.second.get_value<std::string>(); |
| 77 | Float val = parse_value(offset); |
| 78 | std::string formula = parse_formula(offset); |
| 79 | manager->add_offset_parameter(roi, formula, val, coordinate_idx); |
| 80 | coordinate_idx++; |
| 81 | } |
| 82 | orbit_itr++; |
| 83 | offset_itr++; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | void parse_thickness_parameters(ParameterManager::Ptr manager, |
| 88 | PTree& config, SymmetryOrbits& orbits) { |
no test coverage detected