vim-web 0.3.44-dev.17 → 0.3.44-dev.19
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/types/core-viewers/ultra/viewer/camera.d.ts +2 -1
- package/dist/types/core-viewers/ultra/viewer/inputs/inputMouse.d.ts +6 -5
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +2 -0
- package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
- package/dist/types/react-viewers/bim/bimTree.d.ts +2 -2
- package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +3 -1
- package/dist/types/react-viewers/helpers/inputs.d.ts +2 -2
- package/dist/types/react-viewers/helpers/isolation.d.ts +2 -2
- package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -2
- package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
- package/dist/types/react-viewers/panels/icons.d.ts +1 -0
- package/dist/types/react-viewers/state/cameraState.d.ts +22 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +31 -6
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +0 -1
- package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -0
- package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +14 -1
- package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -0
- package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +2 -2
- package/dist/vim-web.iife.js +218 -110
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +218 -110
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/helpers/camera.d.ts +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box3, Segment } from '../utils/math3d';
|
|
1
|
+
import { Box3, Segment, Vector3 } from '../utils/math3d';
|
|
2
2
|
import { RpcSafeClient } from './rpcSafeClient';
|
|
3
3
|
import { Vim } from './vim';
|
|
4
4
|
/**
|
|
@@ -78,6 +78,7 @@ export declare class Camera implements ICamera {
|
|
|
78
78
|
*/
|
|
79
79
|
onConnect(): void;
|
|
80
80
|
onCameraPose(pose: Segment): void;
|
|
81
|
+
set(position: Vector3, target: Vector3, blendTime?: number): void;
|
|
81
82
|
/**
|
|
82
83
|
* Pauses or resumes rendering
|
|
83
84
|
* @param value - True to pause rendering, false to resume
|
|
@@ -8,14 +8,15 @@ export declare class InputMouse extends InputHandler {
|
|
|
8
8
|
private _lastMouseDownPosition;
|
|
9
9
|
private _selection;
|
|
10
10
|
private _camera;
|
|
11
|
+
private _capture;
|
|
11
12
|
constructor(canvas: HTMLCanvasElement, rpc: RpcSafeClient, selection: ViewerSelection, camera: ICamera);
|
|
12
13
|
register(): void;
|
|
13
14
|
dispose(): void;
|
|
14
|
-
private
|
|
15
|
-
private
|
|
15
|
+
private onPointerDown;
|
|
16
|
+
private onPointerUp;
|
|
16
17
|
private handleMouseClick;
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private
|
|
18
|
+
private onPointerMove;
|
|
19
|
+
private onDoubleClick;
|
|
20
|
+
private onMouseScroll;
|
|
20
21
|
private relativePosition;
|
|
21
22
|
}
|
|
@@ -8,9 +8,11 @@ export declare class SectionBoxHandle extends THREE.Mesh {
|
|
|
8
8
|
private _color;
|
|
9
9
|
private _highlightColor;
|
|
10
10
|
private _materials;
|
|
11
|
+
private _camera;
|
|
11
12
|
private _camSub;
|
|
12
13
|
constructor(axes: Axis, sign: number, size: number, color?: THREE.Color);
|
|
13
14
|
trackCamera(camera: ICamera): void;
|
|
15
|
+
update(): void;
|
|
14
16
|
setPosition(position: THREE.Vector3): void;
|
|
15
17
|
get forward(): THREE.Vector3;
|
|
16
18
|
highlight(value: boolean): void;
|
|
@@ -5,13 +5,13 @@ import React from 'react';
|
|
|
5
5
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
6
6
|
import { TreeActionRef } from './bimTree';
|
|
7
7
|
import { Isolation } from '../helpers/isolation';
|
|
8
|
-
import {
|
|
8
|
+
import { CameraRef } from '../state/cameraState';
|
|
9
9
|
import { ViewerState } from '../webgl/viewerState';
|
|
10
10
|
import { ComponentSettings } from '../settings/settings';
|
|
11
11
|
import { BimInfoPanelRef } from './bimInfoData';
|
|
12
12
|
export declare function OptionalBimPanel(props: {
|
|
13
13
|
viewer: VIM.Viewer;
|
|
14
|
-
camera:
|
|
14
|
+
camera: CameraRef;
|
|
15
15
|
viewerState: ViewerState;
|
|
16
16
|
isolation: Isolation;
|
|
17
17
|
visible: boolean;
|
|
@@ -30,7 +30,7 @@ export declare function OptionalBimPanel(props: {
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function BimPanel(props: {
|
|
32
32
|
viewer: VIM.Viewer;
|
|
33
|
-
camera:
|
|
33
|
+
camera: CameraRef;
|
|
34
34
|
viewerState: ViewerState;
|
|
35
35
|
isolation: Isolation;
|
|
36
36
|
visible: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import 'react-complex-tree/lib/style.css';
|
|
6
6
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
7
|
-
import {
|
|
7
|
+
import { CameraRef } from '../state/cameraState';
|
|
8
8
|
import { Isolation } from '../helpers/isolation';
|
|
9
9
|
import { BimTreeData } from './bimTreeData';
|
|
10
10
|
export type TreeActionRef = {
|
|
@@ -23,7 +23,7 @@ export type TreeActionRef = {
|
|
|
23
23
|
export declare function BimTree(props: {
|
|
24
24
|
actionRef: React.MutableRefObject<TreeActionRef>;
|
|
25
25
|
viewer: VIM.Viewer;
|
|
26
|
-
camera:
|
|
26
|
+
camera: CameraRef;
|
|
27
27
|
objects: VIM.Object3D[];
|
|
28
28
|
isolation: Isolation;
|
|
29
29
|
treeData: BimTreeData;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export declare const ids: {
|
|
2
2
|
sectionCamera: string;
|
|
3
|
+
sectionInputs: string;
|
|
3
4
|
sectionActions: string;
|
|
4
5
|
sectionTools: string;
|
|
5
6
|
sectionSettings: string;
|
|
6
7
|
sectionMeasure: string;
|
|
7
8
|
sectionSectionBox: string;
|
|
9
|
+
buttonCameraAuto: string;
|
|
8
10
|
buttonCameraOrbit: string;
|
|
9
11
|
buttonCameraLook: string;
|
|
10
12
|
buttonCameraPan: string;
|
|
@@ -22,6 +24,6 @@ export declare const ids: {
|
|
|
22
24
|
buttonSectionBoxVisible: string;
|
|
23
25
|
buttonSectionBoxShrinkToSelection: string;
|
|
24
26
|
buttonSectionBoxAuto: string;
|
|
25
|
-
|
|
27
|
+
buttonSectionBoxReset: string;
|
|
26
28
|
buttonSectionBoxSettings: string;
|
|
27
29
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
5
5
|
import { SideState } from '../sidePanel/sideState';
|
|
6
|
-
import {
|
|
6
|
+
import { CameraRef } from '../state/cameraState';
|
|
7
7
|
import { Isolation } from './isolation';
|
|
8
8
|
/**
|
|
9
9
|
* Custom viewer input scheme for the vim component
|
|
@@ -14,7 +14,7 @@ export declare class ComponentInputs implements VIM.InputScheme {
|
|
|
14
14
|
private _default;
|
|
15
15
|
private _isolation;
|
|
16
16
|
private _sideState;
|
|
17
|
-
constructor(viewer: VIM.Viewer, camera:
|
|
17
|
+
constructor(viewer: VIM.Viewer, camera: CameraRef, isolation: Isolation, sideState: SideState);
|
|
18
18
|
private _getSelection;
|
|
19
19
|
onMainAction(hit: VIM.InputAction): void;
|
|
20
20
|
onIdleAction(hit: VIM.InputAction): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
2
2
|
import { ComponentSettings } from '../settings/settings';
|
|
3
|
-
import {
|
|
3
|
+
import { CameraRef } from '../state/cameraState';
|
|
4
4
|
import { ISimpleEvent } from 'ste-simple-events';
|
|
5
5
|
/**
|
|
6
6
|
* Manages the isolation mechanic in the VIM component.
|
|
@@ -32,7 +32,7 @@ export declare class Isolation {
|
|
|
32
32
|
* @param camera - A component that handles camera control and framing.
|
|
33
33
|
* @param settings - The settings that control isolation and material usage.
|
|
34
34
|
*/
|
|
35
|
-
constructor(viewer: VIM.Viewer, camera:
|
|
35
|
+
constructor(viewer: VIM.Viewer, camera: CameraRef, settings: ComponentSettings);
|
|
36
36
|
/**
|
|
37
37
|
* Applies relevant settings to the isolation behavior.
|
|
38
38
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
6
|
-
import {
|
|
6
|
+
import { CameraRef } from '../state/cameraState';
|
|
7
7
|
import { SettingsState } from '../settings/settingsState';
|
|
8
8
|
/**
|
|
9
9
|
* Memoized version of the AxesPanelMemo.
|
|
@@ -14,7 +14,7 @@ export declare const AxesPanelMemo: React.MemoExoticComponent<typeof AxesPanel>;
|
|
|
14
14
|
*/
|
|
15
15
|
declare function AxesPanel(props: {
|
|
16
16
|
viewer: VIM.Viewer;
|
|
17
|
-
camera:
|
|
17
|
+
camera: CameraRef;
|
|
18
18
|
settings: SettingsState;
|
|
19
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { WebglViewer } from '../..';
|
|
6
6
|
import { Isolation } from '../helpers/isolation';
|
|
7
|
-
import {
|
|
7
|
+
import { CameraRef } from '../state/cameraState';
|
|
8
8
|
import { TreeActionRef } from '../bim/bimTree';
|
|
9
9
|
import { ModalRef } from './modal';
|
|
10
10
|
type ClickCallback = React.MouseEvent<HTMLDivElement, MouseEvent>;
|
|
@@ -65,7 +65,7 @@ export declare const VimContextMenuMemo: React.MemoExoticComponent<typeof VimCon
|
|
|
65
65
|
*/
|
|
66
66
|
export declare function VimContextMenu(props: {
|
|
67
67
|
viewer: WebglViewer.Viewer;
|
|
68
|
-
camera:
|
|
68
|
+
camera: CameraRef;
|
|
69
69
|
modal: ModalRef;
|
|
70
70
|
isolation: Isolation;
|
|
71
71
|
selection: WebglViewer.Object3D[];
|
|
@@ -27,6 +27,7 @@ export declare function arrowLeft({ height, width, fill, className }: IconOption
|
|
|
27
27
|
export declare function fullArrowLeft({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export declare function visible({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export declare function hidden({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function autoCamera({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
30
31
|
export declare function orbit({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export declare function look({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
32
33
|
export declare function perspective({ height, width, fill, className }: IconOptions): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module viw-webgl-react
|
|
3
|
+
*/
|
|
4
|
+
import { THREE } from '../../index';
|
|
5
|
+
import { ActionRef, AsyncFuncRef, StateRef } from '../helpers/reactUtils';
|
|
6
|
+
import { ISignal } from 'ste-signals';
|
|
7
|
+
export interface CameraRef {
|
|
8
|
+
autoCamera: StateRef<boolean>;
|
|
9
|
+
reset: ActionRef;
|
|
10
|
+
frameSelection: AsyncFuncRef<void>;
|
|
11
|
+
frameScene: AsyncFuncRef<void>;
|
|
12
|
+
}
|
|
13
|
+
interface ICameraAdapter {
|
|
14
|
+
onSelectionChanged: ISignal;
|
|
15
|
+
frameCamera: (box: THREE.Box3, duration: number) => void;
|
|
16
|
+
resetCamera: (duration: number) => void;
|
|
17
|
+
frameAll: (duration: number) => void;
|
|
18
|
+
hasSelection: () => boolean;
|
|
19
|
+
getSelectionBox: () => Promise<THREE.Box3>;
|
|
20
|
+
}
|
|
21
|
+
export declare function useCamera(adapter: ICameraAdapter): CameraRef;
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
2
|
-
import {
|
|
2
|
+
import { CameraRef } from './cameraState';
|
|
3
3
|
import { CursorManager } from '../helpers/cursor';
|
|
4
4
|
import { Isolation } from '../helpers/isolation';
|
|
5
5
|
import { ComponentSettings } from '../settings/settings';
|
|
@@ -12,10 +12,23 @@ import * as ControlBar from '../controlbar/controlBar';
|
|
|
12
12
|
* Returns a control bar section for the section box.
|
|
13
13
|
*/
|
|
14
14
|
export declare function controlBarSectionBox(section: SectionBoxRef, hasSelection: boolean): ControlBar.IControlBarSection;
|
|
15
|
+
export declare function controlBarCamera(camera: CameraRef): {
|
|
16
|
+
id: string;
|
|
17
|
+
enable: () => boolean;
|
|
18
|
+
style: string;
|
|
19
|
+
buttons: {
|
|
20
|
+
id: string;
|
|
21
|
+
tip: string;
|
|
22
|
+
isOn: () => boolean;
|
|
23
|
+
action: () => void;
|
|
24
|
+
icon: typeof Icons.autoCamera;
|
|
25
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
15
28
|
/**
|
|
16
29
|
* Combines all control bar sections into one control bar.
|
|
17
30
|
*/
|
|
18
|
-
export declare function useControlBar(viewer: VIM.Viewer, camera:
|
|
31
|
+
export declare function useControlBar(viewer: VIM.Viewer, camera: CameraRef, modal: ModalRef, side: SideState, isolation: Isolation, cursor: CursorManager, settings: ComponentSettings, section: SectionBoxRef, customization: ControlBar.ControlBarCustomization | undefined): (ControlBar.IControlBarSection | {
|
|
19
32
|
id: string;
|
|
20
33
|
enable: () => boolean;
|
|
21
34
|
style: string;
|
|
@@ -24,16 +37,28 @@ export declare function useControlBar(viewer: VIM.Viewer, camera: ComponentCamer
|
|
|
24
37
|
enabled: () => boolean;
|
|
25
38
|
tip: string;
|
|
26
39
|
action: () => void;
|
|
27
|
-
icon: typeof Icons.
|
|
28
|
-
isOn: () => boolean;
|
|
40
|
+
icon: typeof Icons.toggleIsolation;
|
|
29
41
|
style: typeof ControlBar.buttonDefaultStyle;
|
|
42
|
+
isOn?: undefined;
|
|
30
43
|
} | {
|
|
31
44
|
id: string;
|
|
32
45
|
enabled: () => boolean;
|
|
46
|
+
isOn: () => boolean;
|
|
33
47
|
tip: string;
|
|
34
48
|
action: () => void;
|
|
35
|
-
icon: typeof Icons.
|
|
49
|
+
icon: typeof Icons.measure;
|
|
36
50
|
style: typeof ControlBar.buttonDefaultStyle;
|
|
37
|
-
isOn?: undefined;
|
|
38
51
|
})[];
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
enable: () => boolean;
|
|
55
|
+
style: string;
|
|
56
|
+
buttons: {
|
|
57
|
+
id: string;
|
|
58
|
+
tip: string;
|
|
59
|
+
isOn: () => boolean;
|
|
60
|
+
action: () => void;
|
|
61
|
+
icon: typeof Icons.autoCamera;
|
|
62
|
+
style: typeof ControlBar.buttonDefaultStyle;
|
|
63
|
+
}[];
|
|
39
64
|
})[];
|
|
@@ -26,6 +26,5 @@ export interface SectionBoxAdapter {
|
|
|
26
26
|
getSelectionBox: () => Promise<THREE.Box3 | undefined>;
|
|
27
27
|
getRendererBox: () => Promise<THREE.Box3>;
|
|
28
28
|
onSelectionChanged: ISignal;
|
|
29
|
-
onSceneChanged: ISignal;
|
|
30
29
|
}
|
|
31
30
|
export declare function useSectionBox(adapter: SectionBoxAdapter): SectionBoxRef;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { ControlBarCustomization } from '../controlbar/controlBar';
|
|
2
2
|
import { SectionBoxRef } from '../state/sectionBoxState';
|
|
3
3
|
import * as Ultra from '../../core-viewers/ultra/index';
|
|
4
|
+
import { CameraRef } from '../state/cameraState';
|
|
4
5
|
export { buttonDefaultStyle, buttonBlueStyle } from '../controlbar/controlBarButton';
|
|
5
6
|
export { sectionDefaultStyle, sectionBlueStyle } from '../controlbar/controlBarSection';
|
|
6
|
-
export declare function useUltraControlBar(viewer: Ultra.Viewer, section: SectionBoxRef, customization: ControlBarCustomization | undefined): import("../controlbar/controlBarSection").IControlBarSection
|
|
7
|
+
export declare function useUltraControlBar(viewer: Ultra.Viewer, section: SectionBoxRef, camera: CameraRef, customization: ControlBarCustomization | undefined): (import("../controlbar/controlBarSection").IControlBarSection | {
|
|
8
|
+
id: string;
|
|
9
|
+
enable: () => boolean;
|
|
10
|
+
style: string;
|
|
11
|
+
buttons: {
|
|
12
|
+
id: string;
|
|
13
|
+
tip: string;
|
|
14
|
+
isOn: () => boolean;
|
|
15
|
+
action: () => void;
|
|
16
|
+
icon: typeof import("../panels/icons").autoCamera;
|
|
17
|
+
style: typeof import("../controlbar/controlBarButton").buttonDefaultStyle;
|
|
18
|
+
}[];
|
|
19
|
+
})[];
|
|
@@ -5,7 +5,7 @@ import * as VIM from '../../core-viewers/webgl/index';
|
|
|
5
5
|
import { ContextMenuCustomization } from '../panels/contextMenu';
|
|
6
6
|
import { ComponentSettings } from '../settings/settings';
|
|
7
7
|
import { Isolation } from '../helpers/isolation';
|
|
8
|
-
import {
|
|
8
|
+
import { CameraRef } from '../state/cameraState';
|
|
9
9
|
import { Container } from '../container';
|
|
10
10
|
import { BimInfoPanelRef } from '../bim/bimInfoData';
|
|
11
11
|
import { ControlBarCustomization } from '../controlbar/controlBar';
|
|
@@ -106,7 +106,7 @@ export type VimComponentRef = {
|
|
|
106
106
|
/**
|
|
107
107
|
* Camera API to interact with the viewer camera at a higher level.
|
|
108
108
|
*/
|
|
109
|
-
camera:
|
|
109
|
+
camera: CameraRef;
|
|
110
110
|
/**
|
|
111
111
|
* API To interact with the BIM info panel.
|
|
112
112
|
*/
|