Extract every selected grid onto a caller-supplied lattice.
202{
205 return std::nullopt;
206 }
207
209 if (count == 0) {
211 return std::nullopt;
212 }
213
214 const auto indices = select_indices(*
m_archive, count, options.field_names);
215 if (indices.empty()) {
217 return std::nullopt;
218 }
219
220 const auto first =
m_archive->grid_summary(indices.front());
221 if (glm::any(glm::lessThanEqual(first.voxel_size, glm::vec3(0.0F)))) {
222 set_error(
"First selected grid has a degenerate voxel size");
223 return std::nullopt;
224 }
225
226 const glm::vec3 region_min_f = (lattice.bounds.min - first.translation) / first.voxel_size + glm::vec3(0.5F);
227 const glm::ivec3 region_min = glm::ivec3(glm::round(region_min_f));
228
230}
void set_error(std::string msg) const
std::optional< Kakshya::VolumeData > materialize(const std::vector< size_t > &indices, const glm::ivec3 ®ion_min, const Kinesis::Lattice3D &lattice) const
Build VolumeData from selected grids over an explicit region.
std::unique_ptr< Detail::VDBArchive > m_archive
std::vector< double > count(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Sample count per window (as double for pipeline uniformity).