| 193 | } |
| 194 | |
| 195 | ParameterManager::Ptr ParameterManager::create_isotropic( |
| 196 | WireNetwork::Ptr wire_network, |
| 197 | Float default_thickness, |
| 198 | ParameterManager::TargetType thickness_type) { |
| 199 | Ptr manager = create_empty_manager(wire_network, default_thickness); |
| 200 | if (!wire_network->has_attribute("vertex_cubic_symmetry_orbit")) { |
| 201 | wire_network->add_attribute("vertex_cubic_symmetry_orbit"); |
| 202 | } |
| 203 | if (!wire_network->has_attribute("edge_cubic_symmetry_orbit")) { |
| 204 | wire_network->add_attribute("edge_cubic_symmetry_orbit"); |
| 205 | } |
| 206 | |
| 207 | std::list<VectorI> vertex_orbits = group_by_label( |
| 208 | wire_network->get_attribute("vertex_cubic_symmetry_orbit")); |
| 209 | std::list<VectorI> edge_orbits = group_by_label( |
| 210 | wire_network->get_attribute("edge_cubic_symmetry_orbit")); |
| 211 | |
| 212 | manager->set_thickness_type(thickness_type); |
| 213 | if (thickness_type == ParameterCommon::VERTEX) { |
| 214 | for (const auto& roi : vertex_orbits) { |
| 215 | manager->add_thickness_parameter(roi, "", default_thickness); |
| 216 | } |
| 217 | } else { |
| 218 | for (const auto& roi : edge_orbits) { |
| 219 | manager->add_thickness_parameter(roi, "", default_thickness); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | IsotropicDofExtractor extractor(wire_network); |
| 224 | const MatrixFr& vertices = wire_network->get_vertices(); |
| 225 | manager->set_offset_type(ParameterCommon::VERTEX); |
| 226 | for (const auto& roi : vertex_orbits) { |
| 227 | const size_t seed_idx = roi.minCoeff(); |
| 228 | VectorF seed = vertices.row(seed_idx); |
| 229 | |
| 230 | const auto dofs = extractor.extract_dofs(seed); |
| 231 | for (const auto& dof_dir : dofs) { |
| 232 | manager->add_isotropic_offset_parameter( |
| 233 | roi, "", 0.0, dof_dir); |
| 234 | } |
| 235 | } |
| 236 | manager->m_dof_type = ISOTROPIC; |
| 237 | return manager; |
| 238 | } |
| 239 | |
| 240 | ParameterManager::Ptr ParameterManager::create_empty_manager( |
| 241 | WireNetwork::Ptr wire_network, Float default_thickness) { |
nothing calls this directly
no test coverage detected