@ifc-lite/viewer 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/assets/{Arrow.dom-CusgkT03.js → Arrow.dom-Bw5JMdDs.js} +1 -1
- package/dist/assets/{browser-BXNIkE8a.js → browser-DdRf3aWl.js} +1 -1
- package/dist/assets/ifc-lite_bg-C1-gLAHo.wasm +0 -0
- package/dist/assets/{index-huvR-kGC.js → index-1ff6P0kc.js} +28334 -26628
- package/dist/assets/{index-6Mr3byM-.js → index-Bz7vHRxl.js} +4 -4
- package/dist/assets/{index-CGbokkQ9.css → index-mvbV6NHd.css} +1 -1
- package/dist/assets/{native-bridge-DsHOKdgD.js → native-bridge-C5hD5vae.js} +1 -1
- package/dist/assets/{wasm-bridge-Bd73HXn-.js → wasm-bridge-CaNKXFGM.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +19 -19
- package/src/components/viewer/Viewport.tsx +57 -2
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +3 -1
- package/src/components/viewer/useAnimationLoop.ts +4 -1
- package/src/components/viewer/useRenderUpdates.ts +6 -1
- package/src/hooks/useViewerSelectors.ts +22 -0
- package/src/index.css +6 -0
- package/src/store/constants.ts +20 -0
- package/src/store/index.ts +10 -0
- package/src/store/slices/uiSlice.ts +41 -0
- package/dist/assets/ifc-lite_bg-DyIN_nBM.wasm +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
10
|
-
import { Renderer } from '@ifc-lite/renderer';
|
|
10
|
+
import { Renderer, type VisualEnhancementOptions } from '@ifc-lite/renderer';
|
|
11
11
|
import type { MeshData, CoordinateInfo } from '@ifc-lite/geometry';
|
|
12
12
|
import { useViewerStore, resolveEntityRef, type MeasurePoint, type SnapVisualization } from '@/store';
|
|
13
13
|
import {
|
|
@@ -158,7 +158,20 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
158
158
|
const { updateCameraRotationRealtime, updateScaleRealtime, setCameraCallbacks } = useCameraState();
|
|
159
159
|
|
|
160
160
|
// Theme state
|
|
161
|
-
const {
|
|
161
|
+
const {
|
|
162
|
+
theme,
|
|
163
|
+
isMobile,
|
|
164
|
+
visualEnhancementsEnabled,
|
|
165
|
+
edgeContrastEnabled,
|
|
166
|
+
edgeContrastIntensity,
|
|
167
|
+
contactShadingQuality,
|
|
168
|
+
contactShadingIntensity,
|
|
169
|
+
contactShadingRadius,
|
|
170
|
+
separationLinesEnabled,
|
|
171
|
+
separationLinesQuality,
|
|
172
|
+
separationLinesIntensity,
|
|
173
|
+
separationLinesRadius,
|
|
174
|
+
} = useThemeState();
|
|
162
175
|
|
|
163
176
|
// Hover state
|
|
164
177
|
const { hoverTooltipsEnabled, setHoverState, clearHover } = useHoverState();
|
|
@@ -215,6 +228,37 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
215
228
|
// Theme-aware clear color ref (updated when theme changes)
|
|
216
229
|
// Tokyo Night storm: #1a1b26 = rgb(26, 27, 38)
|
|
217
230
|
const clearColorRef = useRef<[number, number, number, number]>([0.102, 0.106, 0.149, 1]);
|
|
231
|
+
const visualEnhancement = useMemo<VisualEnhancementOptions>(() => ({
|
|
232
|
+
enabled: visualEnhancementsEnabled,
|
|
233
|
+
edgeContrast: {
|
|
234
|
+
enabled: edgeContrastEnabled,
|
|
235
|
+
intensity: edgeContrastIntensity,
|
|
236
|
+
},
|
|
237
|
+
contactShading: {
|
|
238
|
+
quality: isMobile ? 'off' : contactShadingQuality,
|
|
239
|
+
intensity: contactShadingIntensity,
|
|
240
|
+
radius: contactShadingRadius,
|
|
241
|
+
},
|
|
242
|
+
separationLines: {
|
|
243
|
+
enabled: separationLinesEnabled,
|
|
244
|
+
quality: isMobile ? 'low' : separationLinesQuality,
|
|
245
|
+
intensity: isMobile ? Math.min(0.4, separationLinesIntensity) : separationLinesIntensity,
|
|
246
|
+
radius: isMobile ? 1.0 : separationLinesRadius,
|
|
247
|
+
},
|
|
248
|
+
}), [
|
|
249
|
+
visualEnhancementsEnabled,
|
|
250
|
+
edgeContrastEnabled,
|
|
251
|
+
edgeContrastIntensity,
|
|
252
|
+
isMobile,
|
|
253
|
+
contactShadingQuality,
|
|
254
|
+
contactShadingIntensity,
|
|
255
|
+
contactShadingRadius,
|
|
256
|
+
separationLinesEnabled,
|
|
257
|
+
separationLinesQuality,
|
|
258
|
+
separationLinesIntensity,
|
|
259
|
+
separationLinesRadius,
|
|
260
|
+
]);
|
|
261
|
+
const visualEnhancementRef = useRef<VisualEnhancementOptions>(visualEnhancement);
|
|
218
262
|
|
|
219
263
|
// Animation frame ref
|
|
220
264
|
const animationFrameRef = useRef<number | null>(null);
|
|
@@ -330,6 +374,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
330
374
|
useEffect(() => { measurementConstraintEdgeRef.current = measurementConstraintEdge; }, [measurementConstraintEdge]);
|
|
331
375
|
useEffect(() => { sectionPlaneRef.current = sectionPlane; }, [sectionPlane]);
|
|
332
376
|
useEffect(() => { sectionRangeRef.current = sectionRange; }, [sectionRange]);
|
|
377
|
+
useEffect(() => { visualEnhancementRef.current = visualEnhancement; }, [visualEnhancement]);
|
|
333
378
|
useEffect(() => {
|
|
334
379
|
geometryRef.current = geometry;
|
|
335
380
|
}, [geometry]);
|
|
@@ -459,6 +504,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
459
504
|
selectedId: selectedEntityIdRef.current,
|
|
460
505
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
461
506
|
clearColor: clearColorRef.current,
|
|
507
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
462
508
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
463
509
|
...sectionPlaneRef.current,
|
|
464
510
|
min: sectionRangeRef.current?.min,
|
|
@@ -485,6 +531,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
485
531
|
selectedId: selectedEntityIdRef.current,
|
|
486
532
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
487
533
|
clearColor: clearColorRef.current,
|
|
534
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
488
535
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
489
536
|
...sectionPlaneRef.current,
|
|
490
537
|
min: sectionRangeRef.current?.min,
|
|
@@ -501,6 +548,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
501
548
|
selectedId: selectedEntityIdRef.current,
|
|
502
549
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
503
550
|
clearColor: clearColorRef.current,
|
|
551
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
504
552
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
505
553
|
...sectionPlaneRef.current,
|
|
506
554
|
min: sectionRangeRef.current?.min,
|
|
@@ -534,6 +582,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
534
582
|
selectedId: selectedEntityIdRef.current,
|
|
535
583
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
536
584
|
clearColor: clearColorRef.current,
|
|
585
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
537
586
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
538
587
|
...sectionPlaneRef.current,
|
|
539
588
|
min: sectionRangeRef.current?.min,
|
|
@@ -557,6 +606,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
557
606
|
selectedId: selectedEntityIdRef.current,
|
|
558
607
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
559
608
|
clearColor: clearColorRef.current,
|
|
609
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
560
610
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
561
611
|
...sectionPlaneRef.current,
|
|
562
612
|
min: sectionRangeRef.current?.min,
|
|
@@ -573,6 +623,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
573
623
|
selectedId: selectedEntityIdRef.current,
|
|
574
624
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
575
625
|
clearColor: clearColorRef.current,
|
|
626
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
576
627
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
577
628
|
...sectionPlaneRef.current,
|
|
578
629
|
min: sectionRangeRef.current?.min,
|
|
@@ -598,6 +649,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
598
649
|
selectedId: selectedEntityIdRef.current,
|
|
599
650
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
600
651
|
clearColor: clearColorRef.current,
|
|
652
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
601
653
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
602
654
|
...sectionPlaneRef.current,
|
|
603
655
|
min: sectionRangeRef.current?.min,
|
|
@@ -614,6 +666,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
614
666
|
selectedId: selectedEntityIdRef.current,
|
|
615
667
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
616
668
|
clearColor: clearColorRef.current,
|
|
669
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
617
670
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
618
671
|
...sectionPlaneRef.current,
|
|
619
672
|
min: sectionRangeRef.current?.min,
|
|
@@ -767,6 +820,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
767
820
|
clearColorRef,
|
|
768
821
|
sectionPlaneRef,
|
|
769
822
|
sectionRangeRef,
|
|
823
|
+
visualEnhancementRef,
|
|
770
824
|
lastCameraStateRef,
|
|
771
825
|
updateCameraRotationRealtime,
|
|
772
826
|
calculateScale,
|
|
@@ -791,6 +845,7 @@ export function Viewport({ geometry, coordinateInfo, computedIsolatedIds, modelI
|
|
|
791
845
|
isInitialized,
|
|
792
846
|
theme,
|
|
793
847
|
clearColorRef,
|
|
848
|
+
visualEnhancementRef,
|
|
794
849
|
hiddenEntities,
|
|
795
850
|
isolatedEntities,
|
|
796
851
|
selectedEntityId,
|
|
@@ -132,7 +132,9 @@ function buildSpatialNodes(
|
|
|
132
132
|
id: nodeId,
|
|
133
133
|
expressIds: [spatialNode.expressId],
|
|
134
134
|
modelIds: [modelId],
|
|
135
|
-
name: spatialNode.name
|
|
135
|
+
name: (spatialNode.name && spatialNode.name.toLowerCase() !== 'unknown')
|
|
136
|
+
? spatialNode.name
|
|
137
|
+
: nodeType,
|
|
136
138
|
type: nodeType,
|
|
137
139
|
depth,
|
|
138
140
|
hasChildren,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEffect, type MutableRefObject, type RefObject } from 'react';
|
|
11
|
-
import type { Renderer } from '@ifc-lite/renderer';
|
|
11
|
+
import type { Renderer, VisualEnhancementOptions } from '@ifc-lite/renderer';
|
|
12
12
|
import type { SectionPlane } from '@/store';
|
|
13
13
|
|
|
14
14
|
export interface UseAnimationLoopParams {
|
|
@@ -24,6 +24,7 @@ export interface UseAnimationLoopParams {
|
|
|
24
24
|
selectedEntityIdRef: MutableRefObject<number | null>;
|
|
25
25
|
selectedModelIndexRef: MutableRefObject<number | undefined>;
|
|
26
26
|
clearColorRef: MutableRefObject<[number, number, number, number]>;
|
|
27
|
+
visualEnhancementRef: MutableRefObject<VisualEnhancementOptions>;
|
|
27
28
|
sectionPlaneRef: MutableRefObject<SectionPlane>;
|
|
28
29
|
sectionRangeRef: MutableRefObject<{ min: number; max: number } | null>;
|
|
29
30
|
lastCameraStateRef: MutableRefObject<{
|
|
@@ -53,6 +54,7 @@ export function useAnimationLoop(params: UseAnimationLoopParams): void {
|
|
|
53
54
|
selectedEntityIdRef,
|
|
54
55
|
selectedModelIndexRef,
|
|
55
56
|
clearColorRef,
|
|
57
|
+
visualEnhancementRef,
|
|
56
58
|
sectionPlaneRef,
|
|
57
59
|
sectionRangeRef,
|
|
58
60
|
lastCameraStateRef,
|
|
@@ -87,6 +89,7 @@ export function useAnimationLoop(params: UseAnimationLoopParams): void {
|
|
|
87
89
|
selectedId: selectedEntityIdRef.current,
|
|
88
90
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
89
91
|
clearColor: clearColorRef.current,
|
|
92
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
90
93
|
sectionPlane: activeToolRef.current === 'section' ? {
|
|
91
94
|
...sectionPlaneRef.current,
|
|
92
95
|
min: sectionRangeRef.current?.min,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEffect, type MutableRefObject } from 'react';
|
|
11
|
-
import type { Renderer, CutPolygon2D, DrawingLine2D } from '@ifc-lite/renderer';
|
|
11
|
+
import type { Renderer, CutPolygon2D, DrawingLine2D, VisualEnhancementOptions } from '@ifc-lite/renderer';
|
|
12
12
|
import type { CoordinateInfo } from '@ifc-lite/geometry';
|
|
13
13
|
import type { Drawing2D } from '@ifc-lite/drawing-2d';
|
|
14
14
|
import type { SectionPlane } from '@/store';
|
|
@@ -21,6 +21,7 @@ export interface UseRenderUpdatesParams {
|
|
|
21
21
|
// Theme
|
|
22
22
|
theme: string;
|
|
23
23
|
clearColorRef: MutableRefObject<[number, number, number, number]>;
|
|
24
|
+
visualEnhancementRef: MutableRefObject<VisualEnhancementOptions>;
|
|
24
25
|
|
|
25
26
|
// Visibility/selection state (reactive values, not refs)
|
|
26
27
|
hiddenEntities: Set<number>;
|
|
@@ -54,6 +55,7 @@ export function useRenderUpdates(params: UseRenderUpdatesParams): void {
|
|
|
54
55
|
isInitialized,
|
|
55
56
|
theme,
|
|
56
57
|
clearColorRef,
|
|
58
|
+
visualEnhancementRef,
|
|
57
59
|
hiddenEntities,
|
|
58
60
|
isolatedEntities,
|
|
59
61
|
selectedEntityId,
|
|
@@ -88,6 +90,7 @@ export function useRenderUpdates(params: UseRenderUpdatesParams): void {
|
|
|
88
90
|
selectedId: selectedEntityIdRef.current,
|
|
89
91
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
90
92
|
clearColor: clearColorRef.current,
|
|
93
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
}, [theme, isInitialized]);
|
|
@@ -132,6 +135,7 @@ export function useRenderUpdates(params: UseRenderUpdatesParams): void {
|
|
|
132
135
|
selectedIds: selectedEntityIdsRef.current,
|
|
133
136
|
selectedModelIndex: selectedModelIndexRef.current,
|
|
134
137
|
clearColor: clearColorRef.current,
|
|
138
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
135
139
|
sectionPlane: activeTool === 'section' ? {
|
|
136
140
|
...sectionPlane,
|
|
137
141
|
min: sectionRangeRef.current?.min,
|
|
@@ -152,6 +156,7 @@ export function useRenderUpdates(params: UseRenderUpdatesParams): void {
|
|
|
152
156
|
selectedIds: selectedEntityIds,
|
|
153
157
|
selectedModelIndex,
|
|
154
158
|
clearColor: clearColorRef.current,
|
|
159
|
+
visualEnhancement: visualEnhancementRef.current,
|
|
155
160
|
sectionPlane: activeTool === 'section' ? {
|
|
156
161
|
...sectionPlane,
|
|
157
162
|
min: sectionRange?.min,
|
|
@@ -157,9 +157,31 @@ export function useHoverState() {
|
|
|
157
157
|
*/
|
|
158
158
|
export function useThemeState() {
|
|
159
159
|
const theme = useViewerStore((state) => state.theme);
|
|
160
|
+
const isMobile = useViewerStore((state) => state.isMobile);
|
|
161
|
+
const visualEnhancementsEnabled = useViewerStore((state) => state.visualEnhancementsEnabled);
|
|
162
|
+
const edgeContrastEnabled = useViewerStore((state) => state.edgeContrastEnabled);
|
|
163
|
+
const edgeContrastIntensity = useViewerStore((state) => state.edgeContrastIntensity);
|
|
164
|
+
const contactShadingQuality = useViewerStore((state) => state.contactShadingQuality);
|
|
165
|
+
const contactShadingIntensity = useViewerStore((state) => state.contactShadingIntensity);
|
|
166
|
+
const contactShadingRadius = useViewerStore((state) => state.contactShadingRadius);
|
|
167
|
+
const separationLinesEnabled = useViewerStore((state) => state.separationLinesEnabled);
|
|
168
|
+
const separationLinesQuality = useViewerStore((state) => state.separationLinesQuality);
|
|
169
|
+
const separationLinesIntensity = useViewerStore((state) => state.separationLinesIntensity);
|
|
170
|
+
const separationLinesRadius = useViewerStore((state) => state.separationLinesRadius);
|
|
160
171
|
|
|
161
172
|
return {
|
|
162
173
|
theme,
|
|
174
|
+
isMobile,
|
|
175
|
+
visualEnhancementsEnabled,
|
|
176
|
+
edgeContrastEnabled,
|
|
177
|
+
edgeContrastIntensity,
|
|
178
|
+
contactShadingQuality,
|
|
179
|
+
contactShadingIntensity,
|
|
180
|
+
contactShadingRadius,
|
|
181
|
+
separationLinesEnabled,
|
|
182
|
+
separationLinesQuality,
|
|
183
|
+
separationLinesIntensity,
|
|
184
|
+
separationLinesRadius,
|
|
163
185
|
};
|
|
164
186
|
}
|
|
165
187
|
|
package/src/index.css
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
@import "tailwindcss";
|
|
6
6
|
|
|
7
|
+
/* Override Tailwind v4's default media-query dark variant so all dark: utilities
|
|
8
|
+
respond to the .dark class on <html> instead of prefers-color-scheme.
|
|
9
|
+
Without this, toggling light mode while the OS is in dark mode leaves all
|
|
10
|
+
dark: Tailwind utilities active, creating a mixed dark/light UI. */
|
|
11
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
12
|
+
|
|
7
13
|
/* ═══════════════════════════════════════════════════════════════════════════
|
|
8
14
|
TOKYO NIGHT THEME - Dark Stormy Cyberpunk Vibes
|
|
9
15
|
═══════════════════════════════════════════════════════════════════════════ */
|
package/src/store/constants.ts
CHANGED
|
@@ -66,6 +66,26 @@ export const UI_DEFAULTS = {
|
|
|
66
66
|
THEME: getInitialTheme(),
|
|
67
67
|
/** Default hover tooltips state */
|
|
68
68
|
HOVER_TOOLTIPS_ENABLED: false,
|
|
69
|
+
/** Global visual enhancement kill switch */
|
|
70
|
+
VISUAL_ENHANCEMENTS_ENABLED: true,
|
|
71
|
+
/** Edge contrast enhancement default */
|
|
72
|
+
EDGE_CONTRAST_ENABLED: true,
|
|
73
|
+
/** Edge contrast intensity */
|
|
74
|
+
EDGE_CONTRAST_INTENSITY: 1.2,
|
|
75
|
+
/** Contact shading quality preset */
|
|
76
|
+
CONTACT_SHADING_QUALITY: 'low' as const,
|
|
77
|
+
/** Contact shading intensity */
|
|
78
|
+
CONTACT_SHADING_INTENSITY: 0.35,
|
|
79
|
+
/** Contact shading radius in pixels */
|
|
80
|
+
CONTACT_SHADING_RADIUS: 1.5,
|
|
81
|
+
/** Separation-line overlay default */
|
|
82
|
+
SEPARATION_LINES_ENABLED: true,
|
|
83
|
+
/** Separation-line quality preset */
|
|
84
|
+
SEPARATION_LINES_QUALITY: 'low' as const,
|
|
85
|
+
/** Separation-line intensity */
|
|
86
|
+
SEPARATION_LINES_INTENSITY: 0.38,
|
|
87
|
+
/** Separation-line radius in pixels */
|
|
88
|
+
SEPARATION_LINES_RADIUS: 1.0,
|
|
69
89
|
} as const;
|
|
70
90
|
|
|
71
91
|
// ============================================================================
|
package/src/store/index.ts
CHANGED
|
@@ -184,6 +184,16 @@ export const useViewerStore = create<ViewerState>()((...args) => ({
|
|
|
184
184
|
|
|
185
185
|
// UI
|
|
186
186
|
activeTool: UI_DEFAULTS.ACTIVE_TOOL,
|
|
187
|
+
visualEnhancementsEnabled: UI_DEFAULTS.VISUAL_ENHANCEMENTS_ENABLED,
|
|
188
|
+
edgeContrastEnabled: UI_DEFAULTS.EDGE_CONTRAST_ENABLED,
|
|
189
|
+
edgeContrastIntensity: UI_DEFAULTS.EDGE_CONTRAST_INTENSITY,
|
|
190
|
+
contactShadingQuality: UI_DEFAULTS.CONTACT_SHADING_QUALITY,
|
|
191
|
+
contactShadingIntensity: UI_DEFAULTS.CONTACT_SHADING_INTENSITY,
|
|
192
|
+
contactShadingRadius: UI_DEFAULTS.CONTACT_SHADING_RADIUS,
|
|
193
|
+
separationLinesEnabled: UI_DEFAULTS.SEPARATION_LINES_ENABLED,
|
|
194
|
+
separationLinesQuality: UI_DEFAULTS.SEPARATION_LINES_QUALITY,
|
|
195
|
+
separationLinesIntensity: UI_DEFAULTS.SEPARATION_LINES_INTENSITY,
|
|
196
|
+
separationLinesRadius: UI_DEFAULTS.SEPARATION_LINES_RADIUS,
|
|
187
197
|
|
|
188
198
|
// Drawing 2D
|
|
189
199
|
drawing2D: null,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import type { StateCreator } from 'zustand';
|
|
10
10
|
import { UI_DEFAULTS } from '../constants.js';
|
|
11
|
+
import type { ContactShadingQuality, SeparationLinesQuality } from '@ifc-lite/renderer';
|
|
11
12
|
|
|
12
13
|
export interface UISlice {
|
|
13
14
|
// State
|
|
@@ -17,6 +18,16 @@ export interface UISlice {
|
|
|
17
18
|
theme: 'light' | 'dark';
|
|
18
19
|
isMobile: boolean;
|
|
19
20
|
hoverTooltipsEnabled: boolean;
|
|
21
|
+
visualEnhancementsEnabled: boolean;
|
|
22
|
+
edgeContrastEnabled: boolean;
|
|
23
|
+
edgeContrastIntensity: number;
|
|
24
|
+
contactShadingQuality: ContactShadingQuality;
|
|
25
|
+
contactShadingIntensity: number;
|
|
26
|
+
contactShadingRadius: number;
|
|
27
|
+
separationLinesEnabled: boolean;
|
|
28
|
+
separationLinesQuality: SeparationLinesQuality;
|
|
29
|
+
separationLinesIntensity: number;
|
|
30
|
+
separationLinesRadius: number;
|
|
20
31
|
|
|
21
32
|
// Actions
|
|
22
33
|
setLeftPanelCollapsed: (collapsed: boolean) => void;
|
|
@@ -26,6 +37,16 @@ export interface UISlice {
|
|
|
26
37
|
toggleTheme: () => void;
|
|
27
38
|
setIsMobile: (isMobile: boolean) => void;
|
|
28
39
|
toggleHoverTooltips: () => void;
|
|
40
|
+
setVisualEnhancementsEnabled: (enabled: boolean) => void;
|
|
41
|
+
setEdgeContrastEnabled: (enabled: boolean) => void;
|
|
42
|
+
setEdgeContrastIntensity: (intensity: number) => void;
|
|
43
|
+
setContactShadingQuality: (quality: ContactShadingQuality) => void;
|
|
44
|
+
setContactShadingIntensity: (intensity: number) => void;
|
|
45
|
+
setContactShadingRadius: (radius: number) => void;
|
|
46
|
+
setSeparationLinesEnabled: (enabled: boolean) => void;
|
|
47
|
+
setSeparationLinesQuality: (quality: SeparationLinesQuality) => void;
|
|
48
|
+
setSeparationLinesIntensity: (intensity: number) => void;
|
|
49
|
+
setSeparationLinesRadius: (radius: number) => void;
|
|
29
50
|
}
|
|
30
51
|
|
|
31
52
|
export const createUISlice: StateCreator<UISlice, [], [], UISlice> = (set, get) => ({
|
|
@@ -36,6 +57,16 @@ export const createUISlice: StateCreator<UISlice, [], [], UISlice> = (set, get)
|
|
|
36
57
|
theme: UI_DEFAULTS.THEME,
|
|
37
58
|
isMobile: false,
|
|
38
59
|
hoverTooltipsEnabled: UI_DEFAULTS.HOVER_TOOLTIPS_ENABLED,
|
|
60
|
+
visualEnhancementsEnabled: UI_DEFAULTS.VISUAL_ENHANCEMENTS_ENABLED,
|
|
61
|
+
edgeContrastEnabled: UI_DEFAULTS.EDGE_CONTRAST_ENABLED,
|
|
62
|
+
edgeContrastIntensity: UI_DEFAULTS.EDGE_CONTRAST_INTENSITY,
|
|
63
|
+
contactShadingQuality: UI_DEFAULTS.CONTACT_SHADING_QUALITY,
|
|
64
|
+
contactShadingIntensity: UI_DEFAULTS.CONTACT_SHADING_INTENSITY,
|
|
65
|
+
contactShadingRadius: UI_DEFAULTS.CONTACT_SHADING_RADIUS,
|
|
66
|
+
separationLinesEnabled: UI_DEFAULTS.SEPARATION_LINES_ENABLED,
|
|
67
|
+
separationLinesQuality: UI_DEFAULTS.SEPARATION_LINES_QUALITY,
|
|
68
|
+
separationLinesIntensity: UI_DEFAULTS.SEPARATION_LINES_INTENSITY,
|
|
69
|
+
separationLinesRadius: UI_DEFAULTS.SEPARATION_LINES_RADIUS,
|
|
39
70
|
|
|
40
71
|
// Actions
|
|
41
72
|
setLeftPanelCollapsed: (leftPanelCollapsed) => set({ leftPanelCollapsed }),
|
|
@@ -57,4 +88,14 @@ export const createUISlice: StateCreator<UISlice, [], [], UISlice> = (set, get)
|
|
|
57
88
|
|
|
58
89
|
setIsMobile: (isMobile) => set({ isMobile }),
|
|
59
90
|
toggleHoverTooltips: () => set((state) => ({ hoverTooltipsEnabled: !state.hoverTooltipsEnabled })),
|
|
91
|
+
setVisualEnhancementsEnabled: (visualEnhancementsEnabled) => set({ visualEnhancementsEnabled }),
|
|
92
|
+
setEdgeContrastEnabled: (edgeContrastEnabled) => set({ edgeContrastEnabled }),
|
|
93
|
+
setEdgeContrastIntensity: (edgeContrastIntensity) => set({ edgeContrastIntensity }),
|
|
94
|
+
setContactShadingQuality: (contactShadingQuality) => set({ contactShadingQuality }),
|
|
95
|
+
setContactShadingIntensity: (contactShadingIntensity) => set({ contactShadingIntensity }),
|
|
96
|
+
setContactShadingRadius: (contactShadingRadius) => set({ contactShadingRadius }),
|
|
97
|
+
setSeparationLinesEnabled: (separationLinesEnabled) => set({ separationLinesEnabled }),
|
|
98
|
+
setSeparationLinesQuality: (separationLinesQuality) => set({ separationLinesQuality }),
|
|
99
|
+
setSeparationLinesIntensity: (separationLinesIntensity) => set({ separationLinesIntensity }),
|
|
100
|
+
setSeparationLinesRadius: (separationLinesRadius) => set({ separationLinesRadius }),
|
|
60
101
|
});
|
|
Binary file
|