| 9 | using namespace PyMesh; |
| 10 | |
| 11 | SymmetryOrbits::SymmetryOrbits(const std::string& orbit_file) { |
| 12 | PTree orbit_config; |
| 13 | read_json(orbit_file, orbit_config); |
| 14 | auto v_orbit_config = orbit_config.find("vertex_orbits"); |
| 15 | if (v_orbit_config != orbit_config.not_found()) { |
| 16 | for (const auto& child : v_orbit_config->second) { |
| 17 | VectorI orbit(child.second.size()); |
| 18 | size_t count = 0; |
| 19 | for (auto val : child.second) { |
| 20 | orbit[count] = val.second.get_value<int>(); |
| 21 | count++; |
| 22 | } |
| 23 | m_vertex_orbits.push_back(orbit); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | auto e_orbit_config = orbit_config.find("edge_orbits"); |
| 28 | if (e_orbit_config != orbit_config.not_found()) { |
| 29 | for (const auto& child : e_orbit_config->second) { |
| 30 | VectorI orbit(child.second.size()); |
| 31 | size_t count=0; |
| 32 | for (auto val : child.second) { |
| 33 | orbit[count] = val.second.get_value<int>(); |
| 34 | count++; |
| 35 | } |
| 36 | m_edge_orbits.push_back(orbit); |
| 37 | } |
| 38 | } |
| 39 | } |