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

◆ relate()

bool MayaFlux::Portal::Forma::Layer::relate ( uint32_t  primary_id,
uint32_t  related_id 
)

Record that related_id belongs with primary_id.

Cascaded lifecycle operations (remove, set_visible, bring_to_front, send_to_back) on primary_id propagate to related_id. Returns false if either id is not found.

Definition at line 152 of file Layer.cpp.

153{
154 auto* p = get(primary_id);
155 auto* r = get(related_id);
156 if (!p || !r || primary_id == related_id)
157 return false;
158
159 auto& rel = m_relations[primary_id];
160 if (std::ranges::find(rel, related_id) == rel.end())
161 rel.push_back(related_id);
162
163 r->visible = p->visible;
164 if (r->buffer)
165 r->buffer->mark_for_processing(p->visible);
166
167 return true;
168}
const Element * get(uint32_t id) const
Definition Layer.cpp:195
std::unordered_map< uint32_t, std::vector< uint32_t > > m_relations
Definition Layer.hpp:283

References get(), and m_relations.

Referenced by MayaFlux::Portal::Forma::Collapsible::attach(), MayaFlux::Portal::Forma::Inspector::buffer_manager(), MayaFlux::Portal::Forma::Inspector::inspect_modulator_tree(), MayaFlux::Portal::Forma::Inspector::node(), MayaFlux::Portal::Forma::Inspector::node_graph_manager(), MayaFlux::Portal::Forma::Plot::place_label(), MayaFlux::Portal::Forma::Plot::place_rect(), MayaFlux::Portal::Forma::Inspector::root_audio_buffer(), MayaFlux::Portal::Forma::Inspector::root_audio_buffer(), MayaFlux::Portal::Forma::Inspector::root_graphics_buffer(), and MayaFlux::Portal::Forma::Inspector::root_node().

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