| 77 | } |
| 78 | |
| 79 | std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_voxel_attributes( |
| 80 | Mesh::Ptr mesh) { |
| 81 | const size_t num_voxels = mesh->get_num_voxels(); |
| 82 | std::vector<ParameterCommon::Variables> vars_array; |
| 83 | const auto& attr_names = mesh->get_attribute_names(); |
| 84 | |
| 85 | for (size_t i=0; i<num_voxels; i++) { |
| 86 | ParameterCommon::Variables vars; |
| 87 | for (const auto& name : attr_names) { |
| 88 | const MatrixFr& attr = mesh->get_attribute(name); |
| 89 | if (attr.rows() != num_voxels) continue; |
| 90 | if (attr.cols() != 1) continue; |
| 91 | vars[name] = attr(i, 0); |
| 92 | } |
| 93 | vars_array.push_back(vars); |
| 94 | } |
| 95 | return vars_array; |
| 96 | } |
| 97 | |
| 98 | std::vector<ParameterCommon::Variables> MeshTilerHelper::extract_attributes( |
| 99 | Mesh::Ptr mesh) { |
nothing calls this directly
no test coverage detected