forked from bldrs-ai/Share
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIFCSlice.js
41 lines (32 loc) · 1.2 KB
/
IFCSlice.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Data stored in Zustand for IFC state.
*
* @param {Function} set
* @param {Function} get
* @return {object} Zustand slice.
*/
export default function createIFCSlice(set, get) {
return {
cameraControls: null,
setCameraControls: (controls) => set(() => ({cameraControls: controls})),
customViewSettings: null,
setCustomViewSettings: (settings) => set(() => ({customViewSettings: settings})),
isModelLoading: false,
setIsModelLoading: (isLoading) => set(() => ({isModelLoading: isLoading})),
// TODO(pablo): really needed?
isModelReady: false,
setIsModelReady: (isReady) => set(() => ({isModelReady: isReady})),
elementTypesMap: [],
setElementTypesMap: (map) => set(() => ({elementTypesMap: map})),
loadedFileInfo: null,
setLoadedFileInfo: (loadedFileInfo) => set(() => ({loadedFileInfo: loadedFileInfo})),
model: null,
setModel: (m) => set(() => ({model: m})),
preselectedElementIds: null,
setPreselectedElementIds: (ids) => set(() => ({preselectedElementIds: ids})),
rootElement: null,
setRootElement: (elt) => set(() => ({rootElement: elt})),
viewer: {},
setViewerStore: (viewer) => set(() => ({viewerStore: viewer})),
}
}