vim-web 0.3.42 → 0.3.44-dev.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/dist/types/core-viewers/ultra/index.d.ts +1 -1
- package/dist/types/core-viewers/ultra/viewer/camera.d.ts +1 -13
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +37 -24
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +9 -7
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +8 -1
- package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +31 -0
- package/dist/types/core-viewers/ultra/viewer/socketClient.d.ts +14 -5
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +7 -3
- package/dist/types/core-viewers/webgl/loader/materials/ghostMaterial.d.ts +16 -0
- package/dist/types/core-viewers/webgl/loader/materials/simpleMaterial.d.ts +10 -5
- package/dist/types/core-viewers/webgl/loader/materials/viewerMaterials.d.ts +9 -8
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/insertableMesh.d.ts +2 -1
- package/dist/types/core-viewers/webgl/loader/progressive/instancedMesh.d.ts +3 -1
- package/dist/types/core-viewers/webgl/loader/scene.d.ts +3 -2
- package/dist/types/core-viewers/webgl/viewer/camera/ICamera.d.ts +102 -0
- package/dist/types/core-viewers/webgl/viewer/environment/cameraLight.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/environment/environment.d.ts +1 -7
- package/dist/types/core-viewers/webgl/viewer/environment/skybox.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/SectionBoxMesh.d.ts +15 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +55 -21
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxGizmo.d.ts +13 -43
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +15 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandles.d.ts +19 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxInputs.d.ts +143 -28
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxOutline.d.ts +15 -0
- package/dist/types/core-viewers/webgl/viewer/inputs/input.d.ts +4 -4
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +8 -4
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +5 -9
- package/dist/types/core-viewers/webgl/viewer/selection.d.ts +1 -0
- package/dist/types/core-viewers/webgl/viewer/settings/viewerSettings.d.ts +4 -39
- package/dist/types/core-viewers/webgl/viewer/viewer.d.ts +1 -1
- package/dist/types/react-viewers/helpers/inputs.d.ts +1 -2
- package/dist/types/react-viewers/helpers/isolation.d.ts +91 -50
- package/dist/types/react-viewers/settings/settings.d.ts +3 -2
- package/dist/vim-web.iife.js +1507 -1199
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1505 -1197
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/core-viewers/webgl/images.d.ts +0 -4
- package/dist/types/core-viewers/webgl/loader/materials/isolationMaterial.d.ts +0 -12
- package/dist/types/core-viewers/webgl/viewer/environment/groundPlane.d.ts +0 -25
- /package/dist/types/core-viewers/webgl/viewer/inputs/{keyboard.d.ts → keyboardHandler.d.ts} +0 -0
- /package/dist/types/core-viewers/webgl/viewer/inputs/{mouse.d.ts → mouseHandler.d.ts} +0 -0
- /package/dist/types/core-viewers/webgl/viewer/inputs/{touch.d.ts → touchHandler.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the box mesh for the section box.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SectionBoxMesh extends THREE.Mesh {
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Resize the mesh to the given box.
|
|
9
|
+
*/
|
|
10
|
+
fitBox(box: THREE.Box3): void;
|
|
11
|
+
/**
|
|
12
|
+
* Disposes of all resources.
|
|
13
|
+
*/
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
-
*/
|
|
2
|
+
* @module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
+
*/
|
|
4
4
|
import { Viewer } from '../../viewer';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Manages a section box gizmo, serving as a proxy between the renderer and the user.
|
|
8
|
+
*
|
|
9
|
+
* This class:
|
|
10
|
+
* - Maintains a Three.js `Box3` that defines the clipping region.
|
|
11
|
+
* - Handles user interaction via {@link BoxInputs}.
|
|
12
|
+
* - Updates a {@link SectionBoxGizmo} to visualize the clipping box.
|
|
13
|
+
* - Dispatches signals when the box is resized or interaction state changes.
|
|
8
14
|
*/
|
|
9
15
|
export declare class SectionBox {
|
|
10
16
|
private _viewer;
|
|
17
|
+
private _gizmos;
|
|
11
18
|
private _inputs;
|
|
12
|
-
private _cube;
|
|
13
|
-
private _outline;
|
|
14
|
-
private _highlight;
|
|
15
|
-
private _normal;
|
|
16
19
|
private _clip;
|
|
17
20
|
private _visible;
|
|
18
21
|
private _interactive;
|
|
@@ -20,51 +23,82 @@ export declare class SectionBox {
|
|
|
20
23
|
private _onBoxConfirm;
|
|
21
24
|
private _onHover;
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
26
|
+
* @internal
|
|
27
|
+
* A convenience getter to the viewer's renderer.
|
|
28
|
+
*/
|
|
29
|
+
private get renderer();
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* A convenience getter to the `Section` module in the renderer.
|
|
33
|
+
*/
|
|
34
|
+
private get section();
|
|
35
|
+
/**
|
|
36
|
+
* Dispatches when any of the following properties change:
|
|
37
|
+
* - {@link clip} (clipping planes active)
|
|
38
|
+
* - {@link visible} (gizmo visibility)
|
|
39
|
+
* - {@link interactive} (pointer inputs active)
|
|
24
40
|
*/
|
|
25
41
|
get onStateChanged(): import("ste-signals").ISignal;
|
|
26
42
|
/**
|
|
27
|
-
*
|
|
43
|
+
* Dispatches when the user finishes manipulating (dragging) the box.
|
|
44
|
+
* The payload is the final {@link THREE.Box3} used for clipping.
|
|
28
45
|
*/
|
|
29
46
|
get onBoxConfirm(): import("ste-simple-events").ISimpleEvent<THREE.Box3>;
|
|
30
47
|
/**
|
|
31
|
-
*
|
|
48
|
+
* Dispatches a boolean indicating pointer hover state on the box handles:
|
|
49
|
+
* - `true` if the pointer has entered a handle
|
|
50
|
+
* - `false` if it has left or no handle is hovered
|
|
32
51
|
*/
|
|
33
52
|
get onHover(): import("ste-simple-events").ISimpleEvent<boolean>;
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new SectionBox gizmo controller.
|
|
55
|
+
*
|
|
56
|
+
* @param viewer - The parent {@link Viewer} in which the section box is rendered.
|
|
57
|
+
*/
|
|
36
58
|
constructor(viewer: Viewer);
|
|
37
59
|
/**
|
|
38
|
-
*
|
|
60
|
+
* The shared bounding box that defines the section region.
|
|
61
|
+
*
|
|
62
|
+
* To programmatically update the box, see {@link fitBox}.
|
|
39
63
|
*/
|
|
40
64
|
get box(): THREE.Box3;
|
|
41
65
|
/**
|
|
42
|
-
* Determines whether the section gizmo
|
|
66
|
+
* Determines whether the section gizmo applies clipping planes to the model.
|
|
67
|
+
*
|
|
68
|
+
* When `true`, `renderer.section.active` is enabled.
|
|
43
69
|
*/
|
|
44
70
|
get clip(): boolean;
|
|
45
71
|
set clip(value: boolean);
|
|
46
72
|
/**
|
|
47
|
-
* Determines whether the gizmo
|
|
73
|
+
* Determines whether the gizmo is interactive (i.e. responds to pointer events).
|
|
74
|
+
*
|
|
75
|
+
* When `true`, pointer events are registered and box handles can be dragged.
|
|
48
76
|
*/
|
|
49
77
|
get interactive(): boolean;
|
|
50
78
|
set interactive(value: boolean);
|
|
51
79
|
/**
|
|
52
|
-
* Determines whether the gizmo
|
|
80
|
+
* Determines whether the section box gizmo is visible in the scene.
|
|
53
81
|
*/
|
|
54
82
|
get visible(): boolean;
|
|
55
83
|
set visible(value: boolean);
|
|
56
84
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
85
|
+
* Resizes the section gizmo to match the given box, optionally expanded by a padding.
|
|
86
|
+
* After resizing, this method also updates the renderer's clipping box.
|
|
87
|
+
*
|
|
88
|
+
* @param box - The bounding box to match (required).
|
|
89
|
+
* @param padding - The scalar amount by which to expand the bounding box. Default is `1`.
|
|
60
90
|
*/
|
|
61
91
|
fitBox(box: THREE.Box3, padding?: number): void;
|
|
62
92
|
/**
|
|
63
|
-
*
|
|
93
|
+
* Updates the section box to match the current size of `this.section.box`.
|
|
94
|
+
*
|
|
95
|
+
* Call this if the renderer's section box is changed by code outside this class.
|
|
64
96
|
*/
|
|
65
97
|
update(): void;
|
|
66
98
|
/**
|
|
67
|
-
*
|
|
99
|
+
* Disposes of the gizmo and input event listeners, cleaning up related resources.
|
|
100
|
+
*
|
|
101
|
+
* After disposal, this `SectionBox` instance should no longer be used.
|
|
68
102
|
*/
|
|
69
103
|
dispose(): void;
|
|
70
104
|
}
|
|
@@ -1,47 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
-
*/
|
|
4
1
|
import * as THREE from 'three';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { SectionBoxMesh } from './SectionBoxMesh';
|
|
3
|
+
import { SectionBoxOutline } from './sectionBoxOutline';
|
|
4
|
+
import { SectionBoxHandles } from './sectionBoxHandles';
|
|
5
|
+
import { Renderer } from '../../rendering/renderer';
|
|
6
|
+
export declare class SectionBoxGizmo {
|
|
7
|
+
private _renderer;
|
|
8
|
+
readonly cube: SectionBoxMesh;
|
|
9
|
+
readonly outline: SectionBoxOutline;
|
|
10
|
+
readonly handles: SectionBoxHandles;
|
|
11
|
+
private _visible;
|
|
12
|
+
get visible(): boolean;
|
|
13
|
+
set visible(value: boolean);
|
|
14
|
+
constructor(renderer: Renderer);
|
|
13
15
|
fitBox(box: THREE.Box3): void;
|
|
14
|
-
/**
|
|
15
|
-
* Disposes of all resources.
|
|
16
|
-
*/
|
|
17
|
-
dispose(): void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Defines the box mesh for the section box.
|
|
21
|
-
*/
|
|
22
|
-
export declare class BoxMesh extends THREE.Mesh {
|
|
23
|
-
constructor();
|
|
24
|
-
/**
|
|
25
|
-
* Resize the mesh to the given box.
|
|
26
|
-
*/
|
|
27
|
-
fitBox(box: THREE.Box3): void;
|
|
28
|
-
/**
|
|
29
|
-
* Disposes of all resources.
|
|
30
|
-
*/
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Defines the face highlight on hover for the section box.
|
|
35
|
-
*/
|
|
36
|
-
export declare class BoxHighlight extends THREE.Mesh {
|
|
37
|
-
constructor();
|
|
38
|
-
/**
|
|
39
|
-
* Sets the face to highlight
|
|
40
|
-
* @param normal a direction vector from theses options (X,-X, Y,-Y, Z,-Z)
|
|
41
|
-
*/
|
|
42
|
-
highlight(box: THREE.Box3, normal: THREE.Vector3): void;
|
|
43
|
-
/**
|
|
44
|
-
* Disposes all resources.
|
|
45
|
-
*/
|
|
46
16
|
dispose(): void;
|
|
47
17
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export type Axis = 'x' | 'y' | 'z';
|
|
3
|
+
export declare class SectionBoxHandle extends THREE.Mesh {
|
|
4
|
+
readonly axis: Axis;
|
|
5
|
+
readonly sign: number;
|
|
6
|
+
private _forward;
|
|
7
|
+
private _color;
|
|
8
|
+
private _highlightColor;
|
|
9
|
+
private _materials;
|
|
10
|
+
constructor(axes: Axis, sign: number, size: number, color?: THREE.Color);
|
|
11
|
+
setPosition(position: THREE.Vector3): void;
|
|
12
|
+
get forward(): THREE.Vector3;
|
|
13
|
+
highlight(value: boolean): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { SectionBoxHandle } from './sectionBoxHandle';
|
|
6
|
+
export declare class SectionBoxHandles {
|
|
7
|
+
readonly up: SectionBoxHandle;
|
|
8
|
+
readonly down: SectionBoxHandle;
|
|
9
|
+
readonly left: SectionBoxHandle;
|
|
10
|
+
readonly right: SectionBoxHandle;
|
|
11
|
+
readonly front: SectionBoxHandle;
|
|
12
|
+
readonly back: SectionBoxHandle;
|
|
13
|
+
readonly meshes: THREE.Group;
|
|
14
|
+
constructor();
|
|
15
|
+
get visible(): boolean;
|
|
16
|
+
set visible(value: boolean);
|
|
17
|
+
fitBox(box: THREE.Box3): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -1,40 +1,155 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
-
*/
|
|
2
|
+
* @module viw-webgl-viewer/gizmos/sectionBox
|
|
3
|
+
*/
|
|
4
4
|
import { Viewer } from '../../viewer';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
|
+
import { SectionBoxHandles } from './sectionBoxHandles';
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Manages pointer interactions (mouse, touch, etc.) on a {@link SectionBoxHandles} to
|
|
9
|
+
* reshape a Three.js `Box3`. This includes detecting which handle is hovered or dragged,
|
|
10
|
+
* capturing the pointer for smooth dragging, and enforcing a minimum box size.
|
|
8
11
|
*/
|
|
9
12
|
export declare class BoxInputs {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
/** The parent Viewer controlling the scene. */
|
|
14
|
+
private _viewer;
|
|
15
|
+
/** The handles mesh group containing the draggable cones/faces. */
|
|
16
|
+
private _handles;
|
|
17
|
+
/** The main box that is being reshaped by dragging handles. */
|
|
18
|
+
private _sharedBox;
|
|
19
|
+
/** The currently hovered/dragged handle, if any. */
|
|
20
|
+
private _handle;
|
|
21
|
+
/** The origin point for dragging, updated on pointer down. */
|
|
22
|
+
private _dragOrigin;
|
|
23
|
+
/** The plane used for drag intersection (perpendicular to the camera direction). */
|
|
24
|
+
private _dragPlane;
|
|
25
|
+
/** Whether a pointer is currently down on a handle. */
|
|
26
|
+
private _mouseDown;
|
|
27
|
+
/** A reusable Raycaster for picking and plane intersection. */
|
|
28
|
+
private _raycaster;
|
|
29
|
+
/** The box state before the current drag. */
|
|
30
|
+
private _lastBox;
|
|
31
|
+
/** A collection of unregister callbacks for event listeners. */
|
|
32
|
+
private _unregisters;
|
|
33
|
+
/** The ID of the pointer that is captured, if any. */
|
|
34
|
+
private _capturedPointerId;
|
|
35
|
+
/**
|
|
36
|
+
* Called when the pointer enters or leaves a handle face.
|
|
37
|
+
* @param normal - The normal (forward) vector of the hovered handle, or a zero vector if none.
|
|
38
|
+
*/
|
|
23
39
|
onFaceEnter: ((normal: THREE.Vector3) => void) | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Called continuously as the box is reshaped by dragging.
|
|
42
|
+
* @param box - The updated box after the latest drag move.
|
|
43
|
+
*/
|
|
24
44
|
onBoxStretch: ((box: THREE.Box3) => void) | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Called when the user has finished reshaping the box (pointer up).
|
|
47
|
+
* @param box - The final box after dragging ends.
|
|
48
|
+
*/
|
|
25
49
|
onBoxConfirm: ((box: THREE.Box3) => void) | undefined;
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new BoxInputs instance for pointer-driven box resizing.
|
|
52
|
+
*
|
|
53
|
+
* @param viewer - The parent {@link Viewer} that renders the scene.
|
|
54
|
+
* @param handles - A {@link SectionBoxHandles} instance containing the draggable mesh handles.
|
|
55
|
+
* @param box - The shared bounding box (`Box3`) that will be updated by dragging.
|
|
56
|
+
*/
|
|
57
|
+
constructor(viewer: Viewer, handles: SectionBoxHandles, box: THREE.Box3);
|
|
58
|
+
/**
|
|
59
|
+
* Registers pointer event listeners on the viewer's canvas.
|
|
60
|
+
* If already registered, it does nothing.
|
|
61
|
+
*/
|
|
28
62
|
register(): void;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Unregisters any previously set pointer event listeners, releasing pointer capture
|
|
65
|
+
* and resetting drag state.
|
|
66
|
+
*/
|
|
32
67
|
unregister(): void;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Indicates if a pointer is currently captured for dragging.
|
|
70
|
+
*/
|
|
71
|
+
get pointerCaptured(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* A helper method to attach an event listener and store its unregister callback.
|
|
74
|
+
*
|
|
75
|
+
* @param handler - The DOM element or Window to attach the listener to.
|
|
76
|
+
* @param type - The pointer event type, e.g. 'pointerdown'.
|
|
77
|
+
* @param listener - The event handler function.
|
|
78
|
+
*/
|
|
79
|
+
private reg;
|
|
80
|
+
/**
|
|
81
|
+
* Called when the pointer leaves the canvas. If not dragging,
|
|
82
|
+
* invokes {@link onFaceEnter} to indicate no active handle is hovered.
|
|
83
|
+
*
|
|
84
|
+
* @param event - The pointerleave event.
|
|
85
|
+
*/
|
|
86
|
+
private onPointerLeave;
|
|
87
|
+
/**
|
|
88
|
+
* Sets pointer capture on the canvas for a specific pointer (ID).
|
|
89
|
+
*
|
|
90
|
+
* @param pointerId - The pointer ID to capture.
|
|
91
|
+
*/
|
|
92
|
+
private capturePointer;
|
|
93
|
+
/**
|
|
94
|
+
* Releases any captured pointer on the canvas, if present.
|
|
95
|
+
*/
|
|
96
|
+
private releasePointer;
|
|
97
|
+
/**
|
|
98
|
+
* Handles pointer movement events.
|
|
99
|
+
* - If dragging, calls {@link onDrag}.
|
|
100
|
+
* - Otherwise, performs a raycast to detect which handle is under the pointer.
|
|
101
|
+
*
|
|
102
|
+
* @param event - The pointermove event.
|
|
103
|
+
*/
|
|
104
|
+
private onMouseMove;
|
|
105
|
+
/**
|
|
106
|
+
* Handles pointer up events. Ends dragging and triggers {@link onBoxConfirm}.
|
|
107
|
+
*
|
|
108
|
+
* @param event - The pointerup event.
|
|
109
|
+
*/
|
|
110
|
+
private onMouseUp;
|
|
111
|
+
/**
|
|
112
|
+
* Handles pointer down events. Begins drag if a handle is hit, capturing the pointer.
|
|
113
|
+
*
|
|
114
|
+
* @param event - The pointerdown event.
|
|
115
|
+
*/
|
|
116
|
+
private onMouseDown;
|
|
117
|
+
/**
|
|
118
|
+
* Continues the drag operation. Determines the new position on the drag plane
|
|
119
|
+
* and computes how far we moved along the handle's forward axis.
|
|
120
|
+
*
|
|
121
|
+
* @param event - The pointermove event while dragging.
|
|
122
|
+
*/
|
|
123
|
+
private onDrag;
|
|
124
|
+
/**
|
|
125
|
+
* Expands or contracts the `_sharedBox` along one axis by a certain amount,
|
|
126
|
+
* ensuring the box cannot shrink below the minimum size (`MIN_BOX_SIZE`).
|
|
127
|
+
*
|
|
128
|
+
* @param axis - The axis ('x', 'y', or 'z') to stretch.
|
|
129
|
+
* @param sign - +1 if stretching the 'max' side, -1 if stretching the 'min' side.
|
|
130
|
+
* @param amount - The numeric offset along that axis to add or subtract.
|
|
131
|
+
* @returns A **new** `Box3` instance with updated min/max coordinates.
|
|
132
|
+
*/
|
|
133
|
+
private stretch;
|
|
134
|
+
/**
|
|
135
|
+
* Prepares the internal raycaster for a given 2D pointer position.
|
|
136
|
+
*
|
|
137
|
+
* @param position - The pointer position in canvas coordinates.
|
|
138
|
+
* @returns The updated raycaster pointing from the camera through this position.
|
|
139
|
+
*/
|
|
140
|
+
private getRaycaster;
|
|
141
|
+
/**
|
|
142
|
+
* Raycasts into the handle meshes from the given pointer position.
|
|
143
|
+
*
|
|
144
|
+
* @param position - The pointer position in canvas coordinates.
|
|
145
|
+
* @returns An array of intersection results, if any.
|
|
146
|
+
*/
|
|
147
|
+
private raycast;
|
|
148
|
+
/**
|
|
149
|
+
* Raycasts into the drag plane from the given pointer position.
|
|
150
|
+
*
|
|
151
|
+
* @param position - The pointer position in canvas coordinates.
|
|
152
|
+
* @returns The intersection point in 3D space, or `null` if none.
|
|
153
|
+
*/
|
|
154
|
+
private raycastPlane;
|
|
40
155
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the thin outline on the edges of the section box.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SectionBoxOutline extends THREE.LineSegments {
|
|
6
|
+
constructor(color: THREE.Color);
|
|
7
|
+
/**
|
|
8
|
+
* Resize the outline to the given box.
|
|
9
|
+
*/
|
|
10
|
+
fitBox(box: THREE.Box3): void;
|
|
11
|
+
/**
|
|
12
|
+
* Disposes of all resources.
|
|
13
|
+
*/
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { Viewer } from '../viewer';
|
|
6
|
-
import { KeyboardHandler } from './
|
|
7
|
-
import { TouchHandler } from './
|
|
8
|
-
import { MouseHandler } from './
|
|
6
|
+
import { KeyboardHandler } from './keyboardHandler';
|
|
7
|
+
import { TouchHandler } from './touchHandler';
|
|
8
|
+
import { MouseHandler } from './mouseHandler';
|
|
9
9
|
import { InputAction } from '../raycaster';
|
|
10
|
-
export { KEYS } from './
|
|
10
|
+
export { KEYS } from './keyboardHandler';
|
|
11
11
|
/** Pointers mode supported by the viewer */
|
|
12
12
|
export type PointerMode = 'orbit' | 'look' | 'pan' | 'zoom' | 'rect';
|
|
13
13
|
/**
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { Scene } from '../../loader/scene';
|
|
6
|
+
import { ModelMaterial } from '../../loader/materials/viewerMaterials';
|
|
7
|
+
import { InstancedMesh } from '../../loader/progressive/instancedMesh';
|
|
6
8
|
/**
|
|
7
9
|
* Wrapper around the THREE scene that tracks bounding box and other information.
|
|
8
10
|
*/
|
|
9
11
|
export declare class RenderScene {
|
|
10
12
|
scene: THREE.Scene;
|
|
11
13
|
boxUpdated: boolean;
|
|
14
|
+
smallGhostThreshold: number | undefined;
|
|
12
15
|
private _vimScenes;
|
|
13
16
|
private _boundingBox;
|
|
14
17
|
private _memory;
|
|
15
18
|
private _2dCount;
|
|
16
|
-
private
|
|
17
|
-
get
|
|
19
|
+
private _modelMaterial;
|
|
20
|
+
get meshes(): (import("../..").InsertableMesh | import("../../loader/mesh").Mesh | InstancedMesh)[];
|
|
18
21
|
constructor();
|
|
19
22
|
get estimatedMemory(): number;
|
|
20
23
|
has2dObjects(): boolean;
|
|
@@ -45,8 +48,9 @@ export declare class RenderScene {
|
|
|
45
48
|
* Removes all rendered objects
|
|
46
49
|
*/
|
|
47
50
|
clear(): void;
|
|
48
|
-
get
|
|
49
|
-
set
|
|
51
|
+
get modelMaterial(): ModelMaterial;
|
|
52
|
+
set modelMaterial(material: ModelMaterial);
|
|
53
|
+
private updateInstanceMeshVisibility;
|
|
50
54
|
private addScene;
|
|
51
55
|
updateBox(box: THREE.Box3 | undefined): void;
|
|
52
56
|
private removeScene;
|
|
@@ -5,7 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { IRenderer, Scene } from '../../loader/scene';
|
|
6
6
|
import { Viewport } from '../viewport';
|
|
7
7
|
import { RenderScene } from './renderScene';
|
|
8
|
-
import { ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
8
|
+
import { ModelMaterial, ViewerMaterials } from '../../loader/materials/viewerMaterials';
|
|
9
9
|
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
10
10
|
import { Camera } from '../camera/camera';
|
|
11
11
|
import { RenderingSection } from './renderingSection';
|
|
@@ -36,7 +36,6 @@ export declare class Renderer implements IRenderer {
|
|
|
36
36
|
private _composer;
|
|
37
37
|
private _materials;
|
|
38
38
|
private _renderText;
|
|
39
|
-
private _skipAntialias;
|
|
40
39
|
private _needsUpdate;
|
|
41
40
|
private _onSceneUpdate;
|
|
42
41
|
private _onBoxUpdated;
|
|
@@ -52,13 +51,6 @@ export declare class Renderer implements IRenderer {
|
|
|
52
51
|
*/
|
|
53
52
|
get needsUpdate(): boolean;
|
|
54
53
|
set needsUpdate(value: boolean);
|
|
55
|
-
/**
|
|
56
|
-
* Indicates whether the next render should skip antialiasing.
|
|
57
|
-
* Useful for expensive operations such as the section box.
|
|
58
|
-
* Can only be set to true. Cleared on each render.
|
|
59
|
-
*/
|
|
60
|
-
get skipAntialias(): boolean;
|
|
61
|
-
set skipAntialias(value: boolean);
|
|
62
54
|
constructor(scene: RenderScene, viewport: Viewport, materials: ViewerMaterials, camera: Camera, settings: ViewerSettings);
|
|
63
55
|
/**
|
|
64
56
|
* Removes all objects from rendering and disposes the WebGL context.
|
|
@@ -69,6 +61,8 @@ export declare class Renderer implements IRenderer {
|
|
|
69
61
|
*/
|
|
70
62
|
get background(): THREE.Color | THREE.Texture;
|
|
71
63
|
set background(color: THREE.Color | THREE.Texture);
|
|
64
|
+
get modelMaterial(): ModelMaterial;
|
|
65
|
+
set modelMaterial(material: ModelMaterial);
|
|
72
66
|
/**
|
|
73
67
|
* Signal dispatched at the end of each frame if the scene was updated, such as visibility changes.
|
|
74
68
|
*/
|
|
@@ -82,6 +76,8 @@ export declare class Renderer implements IRenderer {
|
|
|
82
76
|
*/
|
|
83
77
|
get textEnabled(): boolean;
|
|
84
78
|
set textEnabled(value: boolean);
|
|
79
|
+
get smallGhostThreshold(): number;
|
|
80
|
+
set smallGhostThreshold(value: number);
|
|
85
81
|
/**
|
|
86
82
|
* Returns the bounding box encompassing all rendered objects.
|
|
87
83
|
* @param target - Box in which to copy the result. A new instance is created if undefined.
|
|
@@ -51,6 +51,7 @@ export declare class Selection {
|
|
|
51
51
|
* or `null`, `undefined`, or an empty array to clear the selection.
|
|
52
52
|
*/
|
|
53
53
|
select(object: SelectableObject | SelectableObject[] | undefined): void;
|
|
54
|
+
any(): boolean;
|
|
54
55
|
/**
|
|
55
56
|
* Returns true if the given object is currently selected.
|
|
56
57
|
* @param {IObject} object The object to check for selection.
|
|
@@ -165,41 +165,6 @@ export type ViewerSettings = {
|
|
|
165
165
|
*/
|
|
166
166
|
sharpness: number;
|
|
167
167
|
};
|
|
168
|
-
/**
|
|
169
|
-
* Ground plane under the scene options.
|
|
170
|
-
*/
|
|
171
|
-
groundPlane: {
|
|
172
|
-
/**
|
|
173
|
-
* Enables/Disables plane under scene
|
|
174
|
-
* Default: true
|
|
175
|
-
*/
|
|
176
|
-
visible: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Controls how the texture will be retrieved using the texture field.
|
|
179
|
-
* Default: base64
|
|
180
|
-
*/
|
|
181
|
-
encoding: TextureEncoding;
|
|
182
|
-
/**
|
|
183
|
-
* Local or remote texture url for plane
|
|
184
|
-
* Default: Vim halo ground provided with the viewer.
|
|
185
|
-
*/
|
|
186
|
-
texture: string;
|
|
187
|
-
/**
|
|
188
|
-
* Opacity of the plane
|
|
189
|
-
* Default: 1
|
|
190
|
-
*/
|
|
191
|
-
opacity: number;
|
|
192
|
-
/**
|
|
193
|
-
* Color of the plane
|
|
194
|
-
* Default: THREE.Color(0xff, 0xff, 0xff)
|
|
195
|
-
*/
|
|
196
|
-
color: THREE.Color;
|
|
197
|
-
/**
|
|
198
|
-
* Size of the ground plane relative to the model
|
|
199
|
-
* Default: 5
|
|
200
|
-
*/
|
|
201
|
-
size: number;
|
|
202
|
-
};
|
|
203
168
|
/**
|
|
204
169
|
* Object highlight on click options
|
|
205
170
|
*/
|
|
@@ -226,16 +191,16 @@ export type ViewerSettings = {
|
|
|
226
191
|
opacity: number;
|
|
227
192
|
};
|
|
228
193
|
/**
|
|
229
|
-
*
|
|
194
|
+
* Ghost material options
|
|
230
195
|
*/
|
|
231
|
-
|
|
196
|
+
ghost: {
|
|
232
197
|
/**
|
|
233
|
-
*
|
|
198
|
+
* Ghost material color
|
|
234
199
|
* Default: rgb(78, 82, 92)
|
|
235
200
|
*/
|
|
236
201
|
color: THREE.Color;
|
|
237
202
|
/**
|
|
238
|
-
*
|
|
203
|
+
* Ghost material opacity
|
|
239
204
|
* Default: 0.08
|
|
240
205
|
*/
|
|
241
206
|
opacity: number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@module viw-webgl-viewer
|
|
3
3
|
*/
|
|
4
4
|
import { ViewerSettings, PartialViewerSettings } from './settings/viewerSettings';
|
|
5
|
-
import { ICamera } from './camera/
|
|
5
|
+
import { ICamera } from './camera/ICamera';
|
|
6
6
|
import { Input } from './inputs/input';
|
|
7
7
|
import { Selection } from './selection';
|
|
8
8
|
import { Environment } from './environment/environment';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as VIM from '../../core-viewers/webgl/index';
|
|
5
5
|
import { SideState } from '../sidePanel/sideState';
|
|
6
|
-
import { Isolation } from './isolation';
|
|
7
6
|
import { ComponentCamera } from './camera';
|
|
7
|
+
import { Isolation } from './isolation';
|
|
8
8
|
/**
|
|
9
9
|
* Custom viewer input scheme for the vim component
|
|
10
10
|
*/
|
|
@@ -14,7 +14,6 @@ export declare class ComponentInputs implements VIM.InputScheme {
|
|
|
14
14
|
private _default;
|
|
15
15
|
private _isolation;
|
|
16
16
|
private _sideState;
|
|
17
|
-
private _help;
|
|
18
17
|
constructor(viewer: VIM.Viewer, camera: ComponentCamera, isolation: Isolation, sideState: SideState);
|
|
19
18
|
private _getSelection;
|
|
20
19
|
onMainAction(hit: VIM.InputAction): void;
|