vim-web 0.5.0-dev.2 → 0.5.0-dev.20
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/dist/style.css +37 -7
- package/dist/types/core-viewers/shared/inputAdapter.d.ts +1 -0
- package/dist/types/core-viewers/shared/keyboardHandler.d.ts +1 -1
- package/dist/types/core-viewers/shared/mouseHandler.d.ts +2 -0
- package/dist/types/core-viewers/ultra/camera.d.ts +2 -2
- package/dist/types/core-viewers/ultra/colorManager.d.ts +4 -4
- package/dist/types/core-viewers/ultra/element3d.d.ts +4 -4
- package/dist/types/core-viewers/ultra/index.d.ts +1 -1
- package/dist/types/core-viewers/ultra/remoteColor.d.ts +3 -23
- package/dist/types/core-viewers/ultra/renderer.d.ts +14 -11
- package/dist/types/core-viewers/ultra/rpcClient.d.ts +22 -19
- package/dist/types/core-viewers/ultra/rpcSafeClient.d.ts +200 -85
- package/dist/types/core-viewers/ultra/rpcTypes.d.ts +6 -3
- package/dist/types/core-viewers/ultra/rpcUtils.d.ts +8 -0
- package/dist/types/core-viewers/ultra/sectionBox.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer.d.ts +6 -0
- package/dist/types/core-viewers/ultra/viewport.d.ts +6 -0
- package/dist/types/core-viewers/ultra/vim.d.ts +11 -9
- package/dist/types/core-viewers/ultra/visibility.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +4 -2
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +5 -0
- package/dist/types/core-viewers/webgl/loader/vim.d.ts +5 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/markers/gizmoMarker.d.ts +1 -0
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +7 -0
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +5 -0
- package/dist/types/core-viewers/webgl/viewer/viewport.d.ts +1 -1
- package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
- package/dist/types/react-viewers/errors/errorStyle.d.ts +1 -1
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +2 -1
- package/dist/types/react-viewers/helpers/utils.d.ts +8 -0
- package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -1
- package/dist/types/react-viewers/panels/index.d.ts +1 -0
- package/dist/types/react-viewers/panels/isolationPanel.d.ts +2 -0
- package/dist/types/react-viewers/panels/messageBox.d.ts +2 -0
- package/dist/types/react-viewers/panels/sidePanel.d.ts +1 -1
- package/dist/types/react-viewers/settings/anySettings.d.ts +7 -0
- package/dist/types/react-viewers/settings/index.d.ts +1 -1
- package/dist/types/react-viewers/settings/settingsInputBox.d.ts +4 -0
- package/dist/types/react-viewers/settings/settingsItem.d.ts +30 -0
- package/dist/types/react-viewers/settings/settingsKeys.d.ts +46 -0
- package/dist/types/react-viewers/settings/settingsPanel.d.ts +5 -4
- package/dist/types/react-viewers/settings/settingsPanelContent.d.ts +6 -0
- package/dist/types/react-viewers/settings/settingsState.d.ts +11 -11
- package/dist/types/react-viewers/settings/settingsStorage.d.ts +3 -3
- package/dist/types/react-viewers/settings/settingsSubtitle.d.ts +2 -0
- package/dist/types/react-viewers/settings/settingsToggle.d.ts +11 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +40 -7
- package/dist/types/react-viewers/state/sharedIsolation.d.ts +2 -0
- package/dist/types/react-viewers/ultra/controlBar.d.ts +3 -1
- package/dist/types/react-viewers/ultra/index.d.ts +1 -0
- package/dist/types/react-viewers/ultra/settings.d.ts +10 -0
- package/dist/types/react-viewers/ultra/settingsPanel.d.ts +5 -0
- package/dist/types/react-viewers/ultra/viewer.d.ts +3 -1
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +3 -0
- package/dist/types/react-viewers/urls.d.ts +0 -1
- package/dist/types/react-viewers/webgl/index.d.ts +1 -0
- package/dist/types/react-viewers/webgl/loading.d.ts +2 -2
- package/dist/types/react-viewers/webgl/settings.d.ts +36 -0
- package/dist/types/react-viewers/webgl/settingsPanel.d.ts +12 -0
- package/dist/types/react-viewers/webgl/viewer.d.ts +3 -3
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +12 -5
- package/dist/types/utils/validation.d.ts +6 -6
- package/dist/vim-web.iife.js +1751 -1030
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1751 -1030
- package/dist/vim-web.js.map +1 -1
- package/package.json +2 -2
- package/dist/types/react-viewers/settings/settings.d.ts +0 -61
|
@@ -27,7 +27,12 @@ export declare class InstancedMesh {
|
|
|
27
27
|
* Returns all submeshes for given index.
|
|
28
28
|
*/
|
|
29
29
|
getSubmeshes(): InstancedSubmesh[];
|
|
30
|
+
/**
|
|
31
|
+
* Sets the material for this mesh.
|
|
32
|
+
* Set to undefined to reset to original materials.
|
|
33
|
+
*/
|
|
30
34
|
setMaterial(value: ModelMaterial): void;
|
|
35
|
+
private _mergeMaterials;
|
|
31
36
|
private computeBoundingBoxes;
|
|
32
37
|
private importBoundingBoxes;
|
|
33
38
|
computeBoundingBox(boxes: THREE.Box3[]): THREE.Box3;
|
|
@@ -18,6 +18,11 @@ type VimFormat = 'vim' | 'vimx';
|
|
|
18
18
|
* Facilitates high-level scene manipulation by providing access to objects.
|
|
19
19
|
*/
|
|
20
20
|
export declare class Vim implements IVim<Element3D> {
|
|
21
|
+
/**
|
|
22
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
23
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
24
|
+
*/
|
|
25
|
+
readonly type = "webgl";
|
|
21
26
|
/**
|
|
22
27
|
* Indicates whether the vim was opened from a vim or vimx file.
|
|
23
28
|
*/
|
|
@@ -62,8 +62,15 @@ export declare class Renderer implements IRenderer {
|
|
|
62
62
|
*/
|
|
63
63
|
get background(): THREE.Color | THREE.Texture;
|
|
64
64
|
set background(color: THREE.Color | THREE.Texture);
|
|
65
|
+
/**
|
|
66
|
+
* Sets the material used to render models. If set to undefined, the default model or mesh material is used.
|
|
67
|
+
*/
|
|
65
68
|
get modelMaterial(): ModelMaterial;
|
|
66
69
|
set modelMaterial(material: ModelMaterial);
|
|
70
|
+
/**
|
|
71
|
+
* The material that will be used when setting model material to undefined.
|
|
72
|
+
*/
|
|
73
|
+
defaultModelMaterial: ModelMaterial;
|
|
67
74
|
/**
|
|
68
75
|
* Signal dispatched at the end of each frame if the scene was updated, such as visibility changes.
|
|
69
76
|
*/
|
|
@@ -17,6 +17,11 @@ import { Renderer } from './rendering/renderer';
|
|
|
17
17
|
* Viewer and loader for vim files.
|
|
18
18
|
*/
|
|
19
19
|
export declare class Viewer {
|
|
20
|
+
/**
|
|
21
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
22
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
23
|
+
*/
|
|
24
|
+
readonly type = "webgl";
|
|
20
25
|
/**
|
|
21
26
|
* The settings configuration used by the viewer.
|
|
22
27
|
*/
|
|
@@ -62,7 +62,7 @@ export declare class Viewport {
|
|
|
62
62
|
/**
|
|
63
63
|
* Resizes the canvas and updates the camera to match new parent dimensions.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
resizeToParent(): void;
|
|
66
66
|
/**
|
|
67
67
|
* Set a callback for canvas resize with debouncing
|
|
68
68
|
* https://stackoverflow.com/questions/5825447/javascript-event-for-canvas-resize/30688151
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import * as Core from '../../core-viewers';
|
|
6
|
-
import { Settings } from '../settings';
|
|
7
6
|
import { CameraRef } from '../state/cameraState';
|
|
8
7
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
9
8
|
import { ViewerState } from '../webgl/viewerState';
|
|
10
9
|
import { BimInfoPanelRef } from './bimInfoData';
|
|
11
10
|
import { TreeActionRef } from './bimTree';
|
|
11
|
+
import { WebglSettings } from '../webgl/settings';
|
|
12
12
|
export declare function OptionalBimPanel(props: {
|
|
13
13
|
viewer: Core.Webgl.Viewer;
|
|
14
14
|
camera: CameraRef;
|
|
15
15
|
viewerState: ViewerState;
|
|
16
16
|
isolation: IsolationRef;
|
|
17
17
|
visible: boolean;
|
|
18
|
-
settings:
|
|
18
|
+
settings: WebglSettings;
|
|
19
19
|
treeRef: React.MutableRefObject<TreeActionRef | undefined>;
|
|
20
20
|
bimInfoRef: BimInfoPanelRef;
|
|
21
21
|
}): JSX.Element;
|
|
@@ -34,7 +34,7 @@ export declare function BimPanel(props: {
|
|
|
34
34
|
viewerState: ViewerState;
|
|
35
35
|
isolation: IsolationRef;
|
|
36
36
|
visible: boolean;
|
|
37
|
-
settings:
|
|
37
|
+
settings: WebglSettings;
|
|
38
38
|
treeRef: React.MutableRefObject<TreeActionRef | undefined>;
|
|
39
39
|
bimInfoRef: BimInfoPanelRef;
|
|
40
40
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ export declare const vcColorLink = "vc-text-[#0590CC]";
|
|
|
4
4
|
export declare const vcLink = "vc-text-[#0590CC] vc-underline";
|
|
5
5
|
export declare const vcLabel = "vc-text-[#3F444F]";
|
|
6
6
|
export declare const vcRoboto = "vc-font-['Roboto',sans-serif]";
|
|
7
|
-
export declare function footer(
|
|
7
|
+
export declare function footer(): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function mainText(text: JSX.Element): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function detailText(text: string): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare function bold(text: string): import("react/jsx-runtime").JSX.Element;
|
|
@@ -55,9 +55,10 @@ export declare function useRefresher(): StateRefresher;
|
|
|
55
55
|
* The reference provides access to the state, along with event dispatching, validation, and confirmation logic.
|
|
56
56
|
*
|
|
57
57
|
* @param initialValue - The initial state value.
|
|
58
|
+
* @param isLazy - Whether to treat the initialValue as a lazy initializer function.
|
|
58
59
|
* @returns An object implementing StateRef along with additional helper hooks.
|
|
59
60
|
*/
|
|
60
|
-
export declare function useStateRef<T>(initialValue: T | (() => T)): {
|
|
61
|
+
export declare function useStateRef<T>(initialValue: T | (() => T), isLazy?: boolean): {
|
|
61
62
|
/**
|
|
62
63
|
* Returns the current state value.
|
|
63
64
|
*/
|
|
@@ -5,3 +5,11 @@ export declare function whenAllTrue(value: (UserBoolean | boolean)[], element: J
|
|
|
5
5
|
export declare function whenAllFalse(value: (UserBoolean | boolean)[], element: JSX.Element): JSX.Element;
|
|
6
6
|
export declare function whenSomeTrue(value: (UserBoolean | boolean)[], element: JSX.Element): JSX.Element;
|
|
7
7
|
export declare function whenSomeFalse(value: (UserBoolean | boolean)[], element: JSX.Element): JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Makes all fields optional recursively
|
|
10
|
+
* @template T - The type to make recursively partial
|
|
11
|
+
* @returns A type with all nested properties made optional
|
|
12
|
+
*/
|
|
13
|
+
export type RecursivePartial<T> = {
|
|
14
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
|
|
15
|
+
};
|
|
@@ -5,6 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import * as Core from '../../core-viewers';
|
|
6
6
|
import { CameraRef } from '../state/cameraState';
|
|
7
7
|
import { SettingsState } from '../settings/settingsState';
|
|
8
|
+
import { WebglSettings } from '../webgl/settings';
|
|
8
9
|
/**
|
|
9
10
|
* Memoized version of the AxesPanelMemo.
|
|
10
11
|
*/
|
|
@@ -15,6 +16,6 @@ export declare const AxesPanelMemo: React.MemoExoticComponent<typeof AxesPanel>;
|
|
|
15
16
|
declare function AxesPanel(props: {
|
|
16
17
|
viewer: Core.Webgl.Viewer;
|
|
17
18
|
camera: CameraRef;
|
|
18
|
-
settings: SettingsState
|
|
19
|
+
settings: SettingsState<WebglSettings>;
|
|
19
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -3,7 +3,9 @@ import { GenericPanelHandle } from "../generic/genericPanel";
|
|
|
3
3
|
export declare const Ids: {
|
|
4
4
|
showGhost: string;
|
|
5
5
|
ghostOpacity: string;
|
|
6
|
+
transparency: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const IsolationPanel: import("react").ForwardRefExoticComponent<{
|
|
8
9
|
state: IsolationRef;
|
|
10
|
+
transparency: boolean;
|
|
9
11
|
} & import("react").RefAttributes<GenericPanelHandle>>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type MessageBoxProps = {
|
|
2
2
|
title: string;
|
|
3
3
|
body: string | JSX.Element;
|
|
4
|
+
icon?: JSX.Element;
|
|
4
5
|
footer?: string | JSX.Element;
|
|
5
6
|
canClose?: boolean;
|
|
7
|
+
minimize?: boolean;
|
|
6
8
|
onClose?: () => void;
|
|
7
9
|
};
|
|
8
10
|
export type MessageBoxPropsTyped = MessageBoxProps & {
|
|
@@ -15,6 +15,6 @@ export declare const SidePanelMemo: React.MemoExoticComponent<typeof SidePanel>;
|
|
|
15
15
|
export declare function SidePanel(props: {
|
|
16
16
|
container: Container;
|
|
17
17
|
side: SideState;
|
|
18
|
-
viewer: Core.Webgl.Viewer;
|
|
18
|
+
viewer: Core.Webgl.Viewer | Core.Ultra.Viewer;
|
|
19
19
|
content: () => JSX.Element;
|
|
20
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SettingsBox } from './settingsItem';
|
|
2
|
+
import { SettingsState } from './settingsState';
|
|
3
|
+
import { AnySettings } from './anySettings';
|
|
4
|
+
export declare function renderSettingsInputBox(settings: SettingsState<AnySettings>, item: SettingsBox<AnySettings>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnySettings } from './anySettings';
|
|
2
|
+
import { UserBoolean } from './userBoolean';
|
|
3
|
+
export type SettingsCustomizer<T extends AnySettings> = (items: SettingsItem<T>[]) => SettingsItem<T>[];
|
|
4
|
+
export type SettingsItem<T extends AnySettings> = SettingsSubtitle | SettingsToggle<T> | SettingsBox<T> | SettingsElement;
|
|
5
|
+
export type BaseSettingsItem = {
|
|
6
|
+
type: string;
|
|
7
|
+
key: string;
|
|
8
|
+
};
|
|
9
|
+
export type SettingsSubtitle = BaseSettingsItem & {
|
|
10
|
+
type: 'subtitle';
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
export type SettingsToggle<T extends AnySettings> = BaseSettingsItem & {
|
|
14
|
+
type: 'toggle';
|
|
15
|
+
label: string;
|
|
16
|
+
getter: (settings: T) => UserBoolean;
|
|
17
|
+
setter: (settings: T, b: boolean) => void;
|
|
18
|
+
};
|
|
19
|
+
export type SettingsBox<T extends AnySettings> = BaseSettingsItem & {
|
|
20
|
+
type: 'box';
|
|
21
|
+
label: string;
|
|
22
|
+
info: string;
|
|
23
|
+
transform: (value: number) => number;
|
|
24
|
+
getter: (settings: T) => number;
|
|
25
|
+
setter: (settings: T, b: number) => void;
|
|
26
|
+
};
|
|
27
|
+
export type SettingsElement = BaseSettingsItem & {
|
|
28
|
+
type: 'element';
|
|
29
|
+
element: JSX.Element;
|
|
30
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare class SettingsPanelKeys {
|
|
2
|
+
static InputsSubtitle: string;
|
|
3
|
+
static InputsScrollSpeedBox: string;
|
|
4
|
+
static PanelsSubtitle: string;
|
|
5
|
+
static PanelsShowLogoToggle: string;
|
|
6
|
+
static PanelsShowBimTreeToggle: string;
|
|
7
|
+
static PanelsShowBimInfoToggle: string;
|
|
8
|
+
static PanelsShowAxesPanelToggle: string;
|
|
9
|
+
static PanelsShowPerformancePanelToggle: string;
|
|
10
|
+
static AxesSubtitle: string;
|
|
11
|
+
static AxesShowOrthographicButtonToggle: string;
|
|
12
|
+
static AxesShowResetCameraButtonToggle: string;
|
|
13
|
+
static ControlBarSubtitle: string;
|
|
14
|
+
static ControlBarShowControlBarToggle: string;
|
|
15
|
+
static ControlBarCursorsSubtitle: string;
|
|
16
|
+
static ControlBarCursorsShowOrbitButtonToggle: string;
|
|
17
|
+
static ControlBarCursorsShowLookAroundButtonToggle: string;
|
|
18
|
+
static ControlBarCursorsShowPanButtonToggle: string;
|
|
19
|
+
static ControlBarCursorsShowZoomButtonToggle: string;
|
|
20
|
+
static ControlBarCursorsShowZoomWindowButtonToggle: string;
|
|
21
|
+
static ControlBarToolsSubtitle: string;
|
|
22
|
+
static ControlBarToolsShowMeasuringModeButtonToggle: string;
|
|
23
|
+
static ControlBarCameraSubtitle: string;
|
|
24
|
+
static ControlBarAutoCamera: string;
|
|
25
|
+
static ControlBarFrameSelection: string;
|
|
26
|
+
static ControlBarFrameAll: string;
|
|
27
|
+
static ControlBarSectioningSubtitle: string;
|
|
28
|
+
static ControlBarSectioningEnable: string;
|
|
29
|
+
static ControlBarSectioningFitToSelection: string;
|
|
30
|
+
static ControlBarSectioningReset: string;
|
|
31
|
+
static ControlBarSectioningShow: string;
|
|
32
|
+
static ControlBarSectioningAuto: string;
|
|
33
|
+
static ControlBarSectioningSettings: string;
|
|
34
|
+
static ControlBarVisibilitySubtitle: string;
|
|
35
|
+
static ControlBarVisibilityClearSelection: string;
|
|
36
|
+
static ControlBarVisibilityShowAll: string;
|
|
37
|
+
static ControlBarVisibilityToggle: string;
|
|
38
|
+
static ControlBarVisibilityIsolate: string;
|
|
39
|
+
static ControlBarVisibilityAutoIsolate: string;
|
|
40
|
+
static ControlBarVisibilitySettings: string;
|
|
41
|
+
static ControlBarSettingsSubtitle: string;
|
|
42
|
+
static ControlBarSettingsShowProjectInspectorButtonToggle: string;
|
|
43
|
+
static ControlBarSettingsShowSettingsButtonToggle: string;
|
|
44
|
+
static ControlBarSettingsShowHelpButtonToggle: string;
|
|
45
|
+
static ControlBarSettingsShowMaximiseButtonToggle: string;
|
|
46
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-react
|
|
3
3
|
*/
|
|
4
|
-
import * as Core from '../../core-viewers';
|
|
5
4
|
import { SettingsState } from './settingsState';
|
|
5
|
+
import { SettingsItem } from './settingsItem';
|
|
6
|
+
import { AnySettings } from './anySettings';
|
|
6
7
|
/**
|
|
7
8
|
* JSX Component to interact with settings.
|
|
8
9
|
* @param viewer current viewer
|
|
@@ -10,8 +11,8 @@ import { SettingsState } from './settingsState';
|
|
|
10
11
|
* @param visible will return null if this is false.
|
|
11
12
|
* @returns
|
|
12
13
|
*/
|
|
13
|
-
export declare function SettingsPanel(props: {
|
|
14
|
-
|
|
15
|
-
settings: SettingsState
|
|
14
|
+
export declare function SettingsPanel<T extends AnySettings>(props: {
|
|
15
|
+
content: SettingsItem<T>[];
|
|
16
|
+
settings: SettingsState<T>;
|
|
16
17
|
visible: boolean;
|
|
17
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SettingsItem } from './settingsItem';
|
|
2
|
+
import { AnySettings } from './anySettings';
|
|
3
|
+
export declare function getControlBarCursorSettings(): SettingsItem<AnySettings>[];
|
|
4
|
+
export declare function getControlBarCameraSettings(): SettingsItem<AnySettings>[];
|
|
5
|
+
export declare function getControlBarSectionBoxSettings(): SettingsItem<AnySettings>[];
|
|
6
|
+
export declare function getControlBarVisibilitySettings(): SettingsItem<AnySettings>[];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-react
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { StateRef } from '../helpers/reactUtils';
|
|
5
|
+
import { SettingsCustomizer } from './settingsItem';
|
|
6
|
+
import { AnySettings } from './anySettings';
|
|
7
|
+
import { RecursivePartial } from '../../utils';
|
|
8
|
+
export type SettingsState<T extends AnySettings> = {
|
|
9
|
+
value: T;
|
|
10
|
+
update: (updater: (s: T) => void) => void;
|
|
11
|
+
register: (action: (s: T) => void) => void;
|
|
12
|
+
customizer: StateRef<SettingsCustomizer<T>>;
|
|
10
13
|
};
|
|
11
14
|
/**
|
|
12
15
|
* Returns a new state closure for settings.
|
|
13
16
|
*/
|
|
14
|
-
export declare function useSettings(
|
|
15
|
-
|
|
16
|
-
* Apply given vim viewer settings to the given viewer.
|
|
17
|
-
*/
|
|
18
|
-
export declare function applySettings(viewer: Core.Webgl.Viewer, settings: Settings): void;
|
|
17
|
+
export declare function useSettings<T extends AnySettings>(value: RecursivePartial<T>, defaultSettings: T, applySettings?: (settings: T) => void): SettingsState<T>;
|
|
18
|
+
export declare function createSettings<T extends AnySettings>(settings: RecursivePartial<T>, defaultSettings: T): T;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module viw-webgl-react
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { AnySettings } from './anySettings';
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves viewer settings from localStorage and applies permissions
|
|
7
7
|
* @param settings - Partial viewer settings to apply permissions from
|
|
8
8
|
* @returns The stored settings with applied permissions, or empty object if retrieval fails
|
|
9
9
|
*/
|
|
10
|
-
export declare function getLocalSettings(settings?:
|
|
10
|
+
export declare function getLocalSettings(settings?: Partial<AnySettings>): {};
|
|
11
11
|
/**
|
|
12
12
|
* Saves viewer settings to localStorage after removing permissions
|
|
13
13
|
* @param value - Component settings to save
|
|
14
14
|
*/
|
|
15
|
-
export declare function saveSettingsToLocal(value:
|
|
15
|
+
export declare function saveSettingsToLocal(value: AnySettings): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SettingsToggle } from './settingsItem';
|
|
2
|
+
import { SettingsState } from './settingsState';
|
|
3
|
+
import { AnySettings } from './anySettings';
|
|
4
|
+
/**
|
|
5
|
+
* Renders a toggle (checkbox) UI element for a given SettingsToggle item.
|
|
6
|
+
* @param viewer The WebGL viewer instance (for future consistency).
|
|
7
|
+
* @param settings The current settings state object.
|
|
8
|
+
* @param item The SettingsToggle configuration.
|
|
9
|
+
* @returns JSX.Element | null
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderSettingsToggle(settings: SettingsState<AnySettings>, item: SettingsToggle<AnySettings>): JSX.Element | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as Core from "../../core-viewers";
|
|
2
2
|
import { CameraRef } from './cameraState';
|
|
3
3
|
import { CursorManager } from '../helpers/cursor';
|
|
4
|
-
import { Settings } from '../settings';
|
|
5
4
|
import { SideState } from './sideState';
|
|
6
5
|
import * as Icons from '../icons';
|
|
7
6
|
import { SectionBoxRef } from './sectionBoxState';
|
|
@@ -9,11 +8,31 @@ import { getMeasureState } from './measureState';
|
|
|
9
8
|
import { ModalHandle } from '../panels/modal';
|
|
10
9
|
import { IsolationRef } from './sharedIsolation';
|
|
11
10
|
import * as ControlBar from '../controlbar';
|
|
11
|
+
import { UserBoolean } from "../settings/userBoolean";
|
|
12
|
+
import { UltraSettings } from "../ultra/settings";
|
|
13
|
+
import { WebglSettings } from "../webgl/settings";
|
|
14
|
+
export type ControlBarSectionBoxSettings = {
|
|
15
|
+
sectioningEnable: UserBoolean;
|
|
16
|
+
sectioningFitToSelection: UserBoolean;
|
|
17
|
+
sectioningReset: UserBoolean;
|
|
18
|
+
sectioningShow: UserBoolean;
|
|
19
|
+
sectioningAuto: UserBoolean;
|
|
20
|
+
sectioningSettings: UserBoolean;
|
|
21
|
+
};
|
|
12
22
|
/**
|
|
13
23
|
* Returns a control bar section for the section box.
|
|
14
24
|
*/
|
|
15
|
-
export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean): ControlBar.IControlBarSection;
|
|
16
|
-
export
|
|
25
|
+
export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean, settings: ControlBarSectionBoxSettings): ControlBar.IControlBarSection;
|
|
26
|
+
export type ControlBarCursorSettings = {
|
|
27
|
+
cursorOrbit: UserBoolean;
|
|
28
|
+
cursorLookAround: UserBoolean;
|
|
29
|
+
cursorPan: UserBoolean;
|
|
30
|
+
cursorZoom: UserBoolean;
|
|
31
|
+
};
|
|
32
|
+
export type ControlBarMeasureSettings = {
|
|
33
|
+
measureEnable: UserBoolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function controlBarMeasure(measure: ReturnType<typeof getMeasureState>, settings: ControlBarMeasureSettings): {
|
|
17
36
|
id: string;
|
|
18
37
|
enable: () => boolean;
|
|
19
38
|
style: string;
|
|
@@ -27,12 +46,26 @@ export declare function controlBarMeasure(settings: Settings, measure: ReturnTyp
|
|
|
27
46
|
style: typeof ControlBar.Style.buttonDefaultStyle;
|
|
28
47
|
}[];
|
|
29
48
|
};
|
|
30
|
-
export declare function
|
|
31
|
-
export
|
|
49
|
+
export declare function controlBarSettingsUltra(side: SideState, settings: UltraSettings): ControlBar.IControlBarSection;
|
|
50
|
+
export type ControlBarCameraSettings = {
|
|
51
|
+
cameraAuto: UserBoolean;
|
|
52
|
+
cameraFrameSelection: UserBoolean;
|
|
53
|
+
cameraFrameScene: UserBoolean;
|
|
54
|
+
};
|
|
55
|
+
export declare function controlBarCamera(camera: CameraRef, settings: ControlBarCameraSettings): ControlBar.IControlBarSection;
|
|
56
|
+
export type ControlBarVisibilitySettings = {
|
|
57
|
+
visibilityClearSelection: UserBoolean;
|
|
58
|
+
visibilityShowAll: UserBoolean;
|
|
59
|
+
visibilityToggle: UserBoolean;
|
|
60
|
+
visibilityIsolate: UserBoolean;
|
|
61
|
+
visibilityAutoIsolate: UserBoolean;
|
|
62
|
+
visibilitySettings: UserBoolean;
|
|
63
|
+
};
|
|
64
|
+
export declare function controlBarVisibility(isolation: IsolationRef, settings: ControlBarVisibilitySettings): ControlBar.IControlBarSection;
|
|
32
65
|
/**
|
|
33
66
|
* Combines all control bar sections into one control bar.
|
|
34
67
|
*/
|
|
35
|
-
export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraRef, modal: ModalHandle, side: SideState, cursor: CursorManager, settings:
|
|
68
|
+
export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraRef, modal: ModalHandle, side: SideState, cursor: CursorManager, settings: WebglSettings, section: SectionBoxRef, isolationRef: IsolationRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
|
|
36
69
|
id: string;
|
|
37
70
|
enable: () => boolean;
|
|
38
71
|
style: string;
|
|
@@ -51,4 +84,4 @@ export declare function useControlBar(viewer: Core.Webgl.Viewer, camera: CameraR
|
|
|
51
84
|
* @param {Settings} settings - The viewer settings to check
|
|
52
85
|
* @returns {boolean} True if any settings buttons are enabled
|
|
53
86
|
*/
|
|
54
|
-
export declare function anyUiSettingButton(settings:
|
|
87
|
+
export declare function anyUiSettingButton(settings: WebglSettings): boolean;
|
|
@@ -9,6 +9,7 @@ export interface IsolationRef {
|
|
|
9
9
|
showPanel: StateRef<boolean>;
|
|
10
10
|
showGhost: StateRef<boolean>;
|
|
11
11
|
ghostOpacity: StateRef<number>;
|
|
12
|
+
transparency: StateRef<boolean>;
|
|
12
13
|
showRooms: StateRef<boolean>;
|
|
13
14
|
onAutoIsolate: FuncRef<void>;
|
|
14
15
|
onVisibilityChange: FuncRef<void>;
|
|
@@ -32,6 +33,7 @@ export interface IsolationAdapter {
|
|
|
32
33
|
showGhost(show: boolean): void;
|
|
33
34
|
getGhostOpacity(): number;
|
|
34
35
|
setGhostOpacity(opacity: number): void;
|
|
36
|
+
enableTransparency(enable: boolean): void;
|
|
35
37
|
getShowRooms(): boolean;
|
|
36
38
|
setShowRooms(show: boolean): void;
|
|
37
39
|
}
|
|
@@ -3,4 +3,6 @@ import { ControlBarCustomization } from '../controlbar/controlBar';
|
|
|
3
3
|
import { CameraRef } from '../state/cameraState';
|
|
4
4
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
5
5
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
6
|
-
|
|
6
|
+
import { SideState } from '../state/sideState';
|
|
7
|
+
import { UltraSettings } from './settings';
|
|
8
|
+
export declare function useUltraControlBar(viewer: Core.Viewer, section: SectionBoxRef, isolation: IsolationRef, camera: CameraRef, settings: UltraSettings, side: SideState, customization: ControlBarCustomization | undefined): import("../controlbar").IControlBarSection[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RecursivePartial } from "../helpers/utils";
|
|
2
|
+
import { UserBoolean } from "../settings/userBoolean";
|
|
3
|
+
import { ControlBarCameraSettings, ControlBarCursorSettings, ControlBarSectionBoxSettings, ControlBarVisibilitySettings } from "../state/controlBarState";
|
|
4
|
+
export type PartialUltraSettings = RecursivePartial<UltraSettings>;
|
|
5
|
+
export type UltraSettings = {
|
|
6
|
+
ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & {
|
|
7
|
+
settings: UserBoolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare function getDefaultUltraSettings(): UltraSettings;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Viewer } from "../../core-viewers/ultra";
|
|
2
|
+
import { SettingsItem } from "../settings/settingsItem";
|
|
3
|
+
import { UltraSettings } from "./settings";
|
|
4
|
+
export declare function getControlBarUltraSettings(): SettingsItem<UltraSettings>[];
|
|
5
|
+
export declare function getUltraSettingsContent(viewer: Viewer): SettingsItem<UltraSettings>[];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Core from '../../core-viewers';
|
|
2
2
|
import { Container } from '../container';
|
|
3
3
|
import { ViewerRef } from './viewerRef';
|
|
4
|
+
import { PartialUltraSettings } from './settings';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a UI container along with a VIM.Viewer and its associated React viewer.
|
|
6
7
|
* @param container An optional container object. If none is provided, a container will be created.
|
|
7
8
|
* @returns An object containing the resulting container, reactRoot, and viewer.
|
|
8
9
|
*/
|
|
9
|
-
export declare function createViewer(container?: Container | HTMLElement): Promise<ViewerRef>;
|
|
10
|
+
export declare function createViewer(container?: Container | HTMLElement, settings?: PartialUltraSettings): Promise<ViewerRef>;
|
|
10
11
|
/**
|
|
11
12
|
* Represents a React viewer providing UI for the Vim viewer.
|
|
12
13
|
* @param container The container object containing root, gfx, and UI elements for the Vim viewer.
|
|
@@ -17,5 +18,6 @@ export declare function createViewer(container?: Container | HTMLElement): Promi
|
|
|
17
18
|
export declare function Viewer(props: {
|
|
18
19
|
container: Container;
|
|
19
20
|
core: Core.Ultra.Viewer;
|
|
21
|
+
settings?: PartialUltraSettings;
|
|
20
22
|
onMount: (viewer: ViewerRef) => void;
|
|
21
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,8 @@ import { SectionBoxRef } from '../state/sectionBoxState';
|
|
|
5
5
|
import { IsolationRef } from '../state/sharedIsolation';
|
|
6
6
|
import { ControlBarRef } from '../controlbar';
|
|
7
7
|
import { GenericPanelHandle } from '../generic/';
|
|
8
|
+
import { SettingsRef } from '../webgl';
|
|
9
|
+
import { UltraSettings } from './settings';
|
|
8
10
|
export type ViewerRef = {
|
|
9
11
|
/**
|
|
10
12
|
* The Vim viewer instance associated with the viewer.
|
|
@@ -27,6 +29,7 @@ export type ViewerRef = {
|
|
|
27
29
|
*/
|
|
28
30
|
camera: CameraRef;
|
|
29
31
|
isolation: IsolationRef;
|
|
32
|
+
settings: SettingsRef<UltraSettings>;
|
|
30
33
|
/**
|
|
31
34
|
* API to interact with the isolation panel.
|
|
32
35
|
*/
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export declare const support = "https://docs.vimaec.com";
|
|
2
1
|
export declare const supportUltra = "https://docs.vimaec.com/docs/vim-for-windows/configuring-vim-ultra";
|
|
3
2
|
export declare const supportControls = "https://docs.vimaec.com/docs/vim-cloud/webgl-navigation-and-controls-guide";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as Core from '../../core-viewers';
|
|
5
5
|
import { LoadRequest } from '../helpers/loadRequest';
|
|
6
6
|
import { ModalHandle } from '../panels/modal';
|
|
7
|
-
import {
|
|
7
|
+
import { WebglSettings } from './settings';
|
|
8
8
|
type AddSettings = {
|
|
9
9
|
/**
|
|
10
10
|
* Controls whether to frame the camera on a vim everytime it is updated.
|
|
@@ -30,7 +30,7 @@ export declare class ComponentLoader {
|
|
|
30
30
|
private _viewer;
|
|
31
31
|
private _modal;
|
|
32
32
|
private _addLink;
|
|
33
|
-
constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>, settings:
|
|
33
|
+
constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>, settings: WebglSettings);
|
|
34
34
|
/**
|
|
35
35
|
* Event emitter for progress updates.
|
|
36
36
|
*/
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RecursivePartial } from "../../utils";
|
|
2
|
+
import { UserBoolean } from "../settings/userBoolean";
|
|
3
|
+
import { ControlBarCameraSettings, ControlBarCursorSettings, ControlBarMeasureSettings, ControlBarSectionBoxSettings, ControlBarVisibilitySettings } from "../state/controlBarState";
|
|
4
|
+
export type PartialWebglSettings = RecursivePartial<WebglSettings>;
|
|
5
|
+
/**
|
|
6
|
+
* Complete settings configuration for the Vim viewer
|
|
7
|
+
* @interface Settings
|
|
8
|
+
*/
|
|
9
|
+
export type WebglSettings = {
|
|
10
|
+
capacity: {
|
|
11
|
+
canFollowUrl: boolean;
|
|
12
|
+
canGoFullScreen: boolean;
|
|
13
|
+
canDownload: boolean;
|
|
14
|
+
canReadLocalStorage: boolean;
|
|
15
|
+
};
|
|
16
|
+
ui: ControlBarCameraSettings & ControlBarCursorSettings & ControlBarSectionBoxSettings & ControlBarVisibilitySettings & ControlBarMeasureSettings & {
|
|
17
|
+
logo: UserBoolean;
|
|
18
|
+
bimTreePanel: UserBoolean;
|
|
19
|
+
bimInfoPanel: UserBoolean;
|
|
20
|
+
performance: UserBoolean;
|
|
21
|
+
axesPanel: UserBoolean;
|
|
22
|
+
controlBar: UserBoolean;
|
|
23
|
+
orthographic: UserBoolean;
|
|
24
|
+
resetCamera: UserBoolean;
|
|
25
|
+
miscProjectInspector: UserBoolean;
|
|
26
|
+
miscSettings: UserBoolean;
|
|
27
|
+
miscHelp: UserBoolean;
|
|
28
|
+
miscMaximise: UserBoolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Default settings configuration for the React Webgl Vim viewer
|
|
33
|
+
* @constant
|
|
34
|
+
* @type {WebglSettings}
|
|
35
|
+
*/
|
|
36
|
+
export declare function getDefaultSettings(): WebglSettings;
|