MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ grid_summary()

VDBGridSummary MayaFlux::IO::Detail::VDBArchive::grid_summary ( size_t  index) const

Summarize one grid: name, value kind, transform, active bounds.

Parameters
indexGrid index, less than read_grid_count().
Returns
The summary, or a default-constructed one if index is out of range or nothing is open.

Definition at line 681 of file VDBArchive.cpp.

682{
683 VDBGridSummary out;
684
685 if (!m_state->read_file_open || index >= m_state->read_file.num_grids) {
686 return out;
687 }
688
689 const tvdb_grid_t& grid = m_state->read_file.grids[index];
690
691 const char* name = tvdb_grid_name(&m_state->read_file, index);
692 out.name = name ? name : "";
693
694 const tvdb_value_type_t vt = leaf_value_type(grid);
695 out.is_vector = is_vector_type(vt);
696 out.narrowed = needs_narrowing(vt);
697
698 out.voxel_size = grid_voxel_size(grid.transform);
699 out.translation = grid_translation(grid.transform);
700
701 BBoxAcc acc;
702 tvdb_grid_visit_leaves(&grid, bbox_visit, &acc);
703 out.has_active = acc.has_any;
704 out.active_min = acc.min;
705 out.active_max = acc.max;
706
707 out.background_scalar = grid_background_scalar(grid);
708 out.background_vector = grid_background_vector(grid);
709
710 return out;
711}
std::vector< float > * out
tvdb_value_type_t vt
std::string name
Definition VKDevice.cpp:143
uint32_t index
Definition VKDevice.cpp:142
std::unique_ptr< State > m_state

References index, m_state, name, out, and vt.