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

◆ node_network()

InspectResult MayaFlux::Portal::Forma::Inspector::node_network ( const std::shared_ptr< Nodes::Network::NodeNetwork > &  net,
Surface &  surface,
LayoutCursor &  cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F,
int  depth = 0 
)

Inspect a NodeNetwork and its per-network metadata.

Builds a collapsible EntryGroup whose header is the network's topology and output mode, with body rows for node count and enabled state. Intended to be nested inside node_graph_manager() but callable independently when the caller already holds a network reference.

Definition at line 212 of file NodeQuery.cpp.

217{
218 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
219
220 const std::string header_label
221 = std::string(Reflect::enum_to_string(net->get_topology()))
222 + " / "
223 + std::string(Reflect::enum_to_string(net->get_output_mode()));
224
225 auto net_ref = net;
226 std::vector<EntrySpec> entrys {
227 EntrySpec {
228 .label = "nodes",
229 .reader = [net_ref] { return std::to_string(net_ref->get_node_count()); },
230 },
231 EntrySpec {
232 .label = "enabled",
233 .reader = [net_ref] { return net_ref->is_enabled() ? "true" : "false"; },
234 },
235 EntrySpec {
236 .label = "channels",
237 .reader = [net_ref] {
238 const auto ch = net_ref->get_registered_channels();
239 std::string s;
240 for (size_t i = 0; i < ch.size(); ++i) {
241 if (i)
242 s += ',';
243 s += std::to_string(ch[i]);
244 }
245 return s.empty() ? "-" : s;
246 },
247 },
248 };
249
250 auto hbuf = make_header_buffer(surface.window());
251 auto rbufs = make_row_buffers(surface.window(), entrys.size());
252
253 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
254 surface, cursor, ind, x_max, row_h, false);
255
256 InspectResult result;
257 result.group = std::move(group);
258 return result;
259}
uint32_t depth
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
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 depth, MayaFlux::Reflect::enum_to_string(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by MayaFlux::Portal::Forma::inspect(), and node_graph_manager().

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