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

◆ root_graphics_buffer()

InspectResult MayaFlux::Portal::Forma::Inspector::root_graphics_buffer ( Buffers::ProcessingToken  token,
Surface &  surface,
LayoutCursor &  cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F,
int  depth = 0 
)

Inspect the root graphics buffer for a token.

Header shows token. Row shows VKBuffer child count. The root buffer itself is expanded via buffer(), then each VKBuffer child via buffer().

Definition at line 193 of file BufferQuery.cpp.

198{
199 auto root = m_bm.get_root_graphics_buffer(token);
200 if (!root)
201 return {};
202
203 const auto children = root->get_child_buffers();
204
205 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
206 const std::string header_label = "graphics ["
207 + std::string(Reflect::enum_to_string(token)) + "]";
208
209 std::vector<EntrySpec> entrys {
210 EntrySpec {
211 .label = "vk_buffers",
212 .reader = [root] { return std::to_string(root->get_buffer_count()); },
213 },
214 };
215
216 auto hbuf = make_header_buffer(surface.window());
217 auto rbufs = make_row_buffers(surface.window(), entrys.size());
218 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
219 surface, cursor, ind, x_max, row_h, false);
220
221 InspectResult result;
222 result.group = std::move(group);
223
224 auto root_result = buffer(
225 root, surface, cursor,
226 x_min, x_max, row_h, depth + 1);
227 surface.layer().relate(result.group.header.header_id, root_result.group.header.header_id);
228 result.children.push_back(std::move(root_result));
229
230 for (const auto& child : children) {
231 auto child_result = buffer(
232 child, surface, cursor,
233 x_min, x_max, row_h, depth + 2);
234 surface.layer().relate(result.group.header.header_id, child_result.group.header.header_id);
235 result.children.push_back(std::move(child_result));
236 }
237
238 return result;
239}
std::shared_ptr< NetworkGeometryBuffer > buffer
uint32_t depth
std::shared_ptr< RootGraphicsBuffer > get_root_graphics_buffer(ProcessingToken token)
Gets a root graphics buffer for a specific token.
std::shared_ptr< Buffers::FormaBuffer > make_header_buffer(const std::shared_ptr< Core::Window > &window) const
A "text"-slotted buffer, registered with the BufferManager.
Definition Inspector.cpp:11
std::vector< EntryBuffer > make_row_buffers(const std::shared_ptr< Core::Window > &window, size_t count) const
count row targets, slices of one "text"-slotted buffer, for make_entry_group's rows.
Definition Inspector.cpp:24
Buffers::BufferManager & m_bm
EntryGroup make_entry_group(std::span< const EntrySpec > entrys, std::string_view header_label, FormaTarget header_buf, std::span< const EntryBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N entry rows under it.
Definition Entry.cpp:104
constexpr float k_inspect_indent
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)

References buffer, MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Reflect::enum_to_string(), MayaFlux::Buffers::BufferManager::get_root_graphics_buffer(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::EntryGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::Surface::layer(), m_bm, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), MayaFlux::Portal::Forma::Layer::relate(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by buffer_manager().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: