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

◆ node()

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

Inspect a single Node and its full modulator tree.

Builds a EntryGroup whose header is the node's short type name and whose body rows expose the node's runtime entrys (output, role for modulators, etc.). Modulator children are recursively expanded as nested InspectResults related to this node's header.

Definition at line 81 of file NodeQuery.cpp.

86{
87 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
88 const std::string header_label = Reflect::short_dynamic_type_name(*n);
89
90 auto node_ref = n;
91 std::vector<EntrySpec> entrys {
92 EntrySpec {
93 .label = "out",
94 .reader = [node_ref] { return std::to_string(node_ref->get_last_output()); },
95 },
96 };
97
98 auto hbuf = make_header_buffer(surface.window());
99 auto rbufs = make_row_buffers(surface.window(), entrys.size());
100
101 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
102 surface, cursor, ind, x_max, row_h, false);
103
104 InspectResult result;
105 result.group = std::move(group);
106
107 for (const auto& tree : n->get_modulator_tree()) {
108 auto child = inspect_modulator_tree(
109 tree, surface, cursor,
110 x_min, x_max, row_h, depth + 1);
111 surface.layer().relate(
112 result.group.header.header_id,
113 child.group.header.header_id);
114 result.children.push_back(std::move(child));
115 }
116
117 return result;
118}
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
InspectResult inspect_modulator_tree(const Nodes::ModulatorTree &tree, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, int depth)
Definition NodeQuery.cpp:36
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
std::string short_dynamic_type_name(const T &obj) noexcept
Returns the unqualified dynamic type name of obj.
Definition TypeInfo.hpp:95

References MayaFlux::Portal::Forma::InspectResult::children, depth, MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::EntryGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, inspect_modulator_tree(), MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::Surface::layer(), MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), MayaFlux::Portal::Forma::Layer::relate(), MayaFlux::Reflect::short_dynamic_type_name(), and MayaFlux::Portal::Forma::Surface::window().

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

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