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

◆ inspect_modulator_tree()

InspectResult MayaFlux::Portal::Forma::Inspector::inspect_modulator_tree ( const Nodes::ModulatorTree tree,
Surface surface,
LayoutCursor cursor,
float  x_min,
float  x_max,
float  row_h,
int  depth 
)
private

Definition at line 36 of file NodeQuery.cpp.

41{
42 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
43
44 const std::string header_label = std::string(role_label(tree.role))
45 + ": " + Reflect::short_dynamic_type_name(*tree.node);
46
47 auto node_ref = tree.node;
48 std::vector<ValueSpec> values {
49 ValueSpec {
50 .label = "out",
51 .reader = [node_ref] { return std::to_string(node_ref->get_last_output()); },
52 },
53 };
54
55 const auto dims = row_pixel_dims(surface.window(), ind, x_max, row_h);
56 auto hbuf = make_row_buffer(surface.window(), header_label, dims);
57 std::vector<RowBuffer> rbufs;
58 rbufs.reserve(values.size());
59 for (const auto& spec : values)
60 rbufs.push_back(make_row_buffer(surface.window(), spec.label, dims));
61
62 auto group = make_value_group(values, std::move(hbuf), rbufs,
63 surface, cursor, ind, x_max, row_h, false);
64
65 InspectResult result;
66 result.group = std::move(group);
67
68 for (const auto& child : tree.modulators) {
69 auto child_result = inspect_modulator_tree(
70 child, surface, cursor,
71 x_min, x_max, row_h, depth + 1);
72 surface.layer().relate(
73 result.group.header.header_id,
74 child_result.group.header.header_id);
75 result.children.push_back(std::move(child_result));
76 }
77
78 return result;
79}
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
RowBuffer make_row_buffer(const std::shared_ptr< Core::Window > &window, std::string_view text, glm::uvec2 pixel_dims) const
Definition Inspector.cpp:13
ValueGroup make_value_group(std::span< const ValueSpec > values, RowBuffer header_buf, std::span< const RowBuffer > 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 value rows under it.
constexpr float k_inspect_indent
glm::uvec2 row_pixel_dims(const std::shared_ptr< Core::Window > &window, float x_min, float x_max, float row_h)
Convert an NDC row rect into integer pixel dimensions.
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, MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::ValueGroup::header, MayaFlux::Portal::Forma::Collapsible::header_id, inspect_modulator_tree(), MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::ValueSpec::label, MayaFlux::Portal::Forma::Surface::layer(), make_row_buffer(), MayaFlux::Portal::Forma::make_value_group(), MayaFlux::Nodes::ModulatorTree::modulators, MayaFlux::Nodes::ModulatorTree::node, MayaFlux::Portal::Forma::Layer::relate(), MayaFlux::Nodes::ModulatorTree::role, MayaFlux::Portal::Forma::row_pixel_dims(), MayaFlux::Reflect::short_dynamic_type_name(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by inspect_modulator_tree(), and node().

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