isUsableHost function
Whether wall wall of doc may host a new opening (spec 12b S-11): its
object layer (objectLayer) is visible and unlocked. A tool acting on
the wall under the pointer is selection-like, so a door is never placed
on a wall the user cannot see or select. A missing record counts as
visible and unlocked, as FilterEvaluator counts it. (Decision 8 is
untouched: a hidden wall's existing openings still cut it.)
Implementation
bool isUsableHost(DraftDocument doc, Handle wall) {
final record = doc.tables.layers[objectLayer(doc, wall)];
return (record?.visible ?? true) && !(record?.locked ?? false);
}