Spaces:
Running
Running
Download editor/src/SelectionManager.ts from dylanebert/gsplat-editor: direct link, hf CLI and curl.
- Browser
- Download file 824 Bytes
-
https://huggingface.co/spaces/dylanebert/gsplat-editor/resolve/main/editor/src/SelectionManager.ts
- Command line
-
hf download hf://spaces/dylanebert/gsplat-editor/editor/src/SelectionManager.ts
-
curl -L -o SelectionManager.ts https://huggingface.co/spaces/dylanebert/gsplat-editor/resolve/main/editor/src/SelectionManager.ts
824 Bytes
| import * as SPLAT from "gsplat"; | |
| class SelectionManager { | |
| private static _instance: SelectionManager; | |
| private static _selectedSplat: SPLAT.Splat | null = null; | |
| public static get instance(): SelectionManager { | |
| if (!SelectionManager._instance) { | |
| SelectionManager._instance = new SelectionManager(); | |
| } | |
| return SelectionManager._instance; | |
| } | |
| public static get selectedSplat(): SPLAT.Splat | null { | |
| return this._selectedSplat; | |
| } | |
| public static set selectedSplat(splat: SPLAT.Splat | null) { | |
| if (this._selectedSplat) { | |
| this._selectedSplat.selected = false; | |
| } | |
| this._selectedSplat = splat; | |
| if (this._selectedSplat) { | |
| this._selectedSplat.selected = true; | |
| } | |
| } | |
| } | |
| export { SelectionManager }; | |