| 204 | |
| 205 | |
| 206 | void BpfWriter::loadBpfDimensions(PointLayoutPtr layout) |
| 207 | { |
| 208 | Dimension::IdList dims; |
| 209 | |
| 210 | if (m_outputDims.size()) |
| 211 | { |
| 212 | for (std::string& s : m_outputDims) |
| 213 | { |
| 214 | Dimension::Id id = layout->findDim(s); |
| 215 | if (id == Dimension::Id::Unknown) |
| 216 | throwError("Invalid dimension '" + s + "' specified for " |
| 217 | "'output_dims' option."); |
| 218 | dims.push_back(id); |
| 219 | } |
| 220 | } |
| 221 | else |
| 222 | dims = layout->dims(); |
| 223 | |
| 224 | // Verify that we have X, Y and Z and that they're the first three |
| 225 | // dimensions. |
| 226 | std::sort(dims.begin(), dims.end()); |
| 227 | if (dims.size() < 3 || dims[0] != Dimension::Id::X || |
| 228 | dims[1] != Dimension::Id::Y || dims[2] != Dimension::Id::Z) |
| 229 | { |
| 230 | throwError("Missing one of dimensions X, Y or Z. Can't write BPF."); |
| 231 | } |
| 232 | |
| 233 | for (auto id : dims) |
| 234 | { |
| 235 | BpfDimension dim; |
| 236 | dim.m_id = id; |
| 237 | dim.m_label = layout->dimName(id); |
| 238 | m_dims.push_back(dim); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | |
| 243 | void BpfWriter::prerunFile(const PointViewSet& pvSet) |