MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / parse_offset_parameters

Function parse_offset_parameters

tools/Wires/Parameters/ParameterManager.cpp:54–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 1

Calls 8

NotImplementedErrorClass · 0.85
parse_valueFunction · 0.85
parse_formulaFunction · 0.85
add_offset_parameterMethod · 0.80
strMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected