Extract every selected grid onto a caller-supplied lattice.
- Parameters
-
| lattice | Output lattice, as in the load() overload. |
| options | Grid selection. |
- Returns
- Populated VolumeData, or nullopt if no file is open or on failure; check get_last_error().
Definition at line 200 of file VolumeReader.cpp.
202{
205 return std::nullopt;
206 }
207
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
References MayaFlux::Kinesis::Lattice3D::bounds, count, MayaFlux::IO::VolumeReadOptions::field_names, m_archive, m_is_open, materialize(), MayaFlux::Kinesis::AABB3D::min, region_min, and set_error().