Class Selection
- Namespace
- Ofs
- Assembly
- Ofs.Api.dll
Registration of alternate selection modes. A mode owns which actions a selection gesture selects — given the region the user gestured over, it decides what becomes selected (only the peaks, only actions above a threshold, every Nth, …). It cannot edit actions, only select existing ones. Registering only publishes the mode; the user activates it from the footer's Select selector (no plugin-callable setter). Call RegisterMode(string, string, SelectHandler, Action?, Action?, Action<Ui>?) from OnLoad().
public sealed class Selection
- Inheritance
-
objectSelection
Remarks
The onSelect callback runs on the main thread, once per editable axis. It must return quickly.
Methods
IsActive(string)
Whether the selection mode this plugin registered as id is the one the user has
active in the footer. Use it to gate the plugin's selection UI. The host resolves
id the same way RegisterMode(string, string, SelectHandler, Action?, Action?, Action<Ui>?) does (it prepends the plugin name),
so pass the same local id.
public bool IsActive(string id)
Parameters
idstring
Returns
RegisterMode(string, string, SelectHandler, Action?, Action?, Action<Ui>?)
Publishes a selection mode the user can select in the footer's Select selector. Call from OnLoad.
public void RegisterMode(string id, string displayName, SelectHandler onSelect, Action? onEnter = null, Action? onExit = null, Action<Ui>? onUi = null)
Parameters
idstringLocal id (no namespace prefix); the host prepends the plugin name.
displayNamestringName shown in the footer's Select selector (rendered verbatim).
onSelectSelectHandlerResolves each gesture per axis: Pass / Drop / Replace(times).
onEnterActionOptional: runs when the user activates this mode.
onExitActionOptional: runs when the user leaves this mode.
onUiAction<Ui>Optional: draws this mode's options. The host calls it (with a Ui builder) only while this mode is the active one, in the docked Tool Options panel — so you no longer hand-gate the options on IsActive(string). Null = no options section.