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

◆ attach()

void MayaFlux::Portal::Forma::Collapsible::attach ( Layer &  layer,
uint32_t  body_id 
) const

Relate a body element to this collapsible and sync its visibility to the current open state.

This is the only bookkeeping Collapsible does for an attached body - everything else lives in Layer::m_relations, keyed by header_id. That means Portal::Forma::destroy(surface, header_id) tears down every attached body for free, with no Collapsible-specific teardown code.

Parameters
layerLayer the body element lives on.
body_idElement id returned from layer.add(...).

Definition at line 153 of file Collapsible.cpp.

154{
155 if (!open)
156 return;
157
158 layer.relate(header_id, body_id);
159 layer.set_visible(body_id, open->value);
160}
std::shared_ptr< MappedState< bool > > open
Open/closed state. Valid after place(). Write to toggle.
uint32_t header_id
Element id of the header strip. Valid after place().

References header_id, open, MayaFlux::Portal::Forma::Layer::relate(), and MayaFlux::Portal::Forma::Layer::set_visible().

Referenced by MayaFlux::Portal::Forma::Inspector::event_manager(), and MayaFlux::Portal::Forma::Inspector::scheduler().

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